Code covered by the BSD License  

Highlights from
ClustalW Interface

ClustalW Interface

by

 

10 Dec 2002 (Updated )

MATLAB tools for working with ClustalW.

clustalwcmd(varargin)
function obj = clustalwcmd(varargin)
%CLUSTALWCMD Constructor for CLUSTALWCMD objects
%  CLUSTALWCMD objects contain fields corresponding to the command line
%  arguments used to call ClustalW.  

% recognized arguments
options = clustalwfields;
needsarg = clustalwfields('needsarg');


% create empty structure

obj = cell2struct(repmat({''},numel(options),1),options,1);



% set defaults, assuming clustalw formats
obj.align = true;
obj.tree = false;
obj.bootstrap = 1000;
obj.quicktree = false;
obj.output = '';
obj.outorder = 'aligned';
obj.case = 'lower';
obj.seqnos = 'off';    
obj.score = 'percent';
obj.pwmatrix = 'gonnet';
obj.pwdnamatrix = 'iub';
obj.usetree = '';
obj.matrix = 'gonnet';
obj.dnamatrix = 'iub';
obj.endgaps = false;
obj.gapdist = 4;
obj.nopgap = false;
obj.nohgap = false;
obj.hgapresidues = 'GPSNDQEKR';
obj.maxdiv = 30;
obj.transweight = 0.5;
obj.usetree1 = '';
obj.usetree2 = '';
obj.nosecstr1 = false;
obj.nosecstr2 = false;
obj.secstrout = '';
obj.helixgap = 4;
obj.strandgap = 4;
obj.loopgap = 1;
obj.helixendin = 3;
obj.helixendout = 0;
obj.strandendin = 1;
obj.strandendout = 1;
obj.outputtree = 'phylip';
obj.seed = '';
obj.kimura = false;
obj.tossgaps = false;
obj.bootlabels = 'branch';

obj = class(obj,'clustalwcmd');


if ~nargin,
    % empty constructor, reutrn default    
    return
end

narg = nargin;

if isa(varargin{1},'clustalwcmd')
    obj = varargin{1};
    if nargin == 1,
        return
    end
    varargin(1) = [];
    narg = narg - 1;
end


f = 1;
while f <= narg,   
    % check to make sure varargin{f} is an option
    if ~any(strcmpi(varargin{f},options))
        error(['Unrecognized option: ' varargin{f}])
    end
    if any(strcmpi(varargin{f},needsarg))  
        if any(strcmpi(varargin{f+1},options))
            error(['Input for "' varargin{f} '" matches option name "' varargin{f+1} '"'])
        end
        obj.(lower(varargin{f})) = varargin{f+1};
        f = f + 2;
    else 
        obj.(lower(varargin{f})) = true;
        f = f+1;
    end            
end




Contact us