clustalw-2.1/0000755000175000017500000000000011467270447010227 500000000000000clustalw-2.1/src/0000755000175000017500000000000011467270447011016 500000000000000clustalw-2.1/src/Help.cpp0000644000175000017500000011437711442167172012340 00000000000000/** * Author: Andreas Wilm * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * 2007-12-12: Andreas Wilm (UCD): initial implementation * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "clustalw_version.h" #include "Help.h" using namespace std; Help::Help() { section s; string version = CLUSTALW_VERSION; // all sections were added in order of appearance in original // clustalw_help // To add new entries use the template below. // Paste content as text, // escape all " with \", // add " at the beginning of the line, // and \n" at the end of the line // template: // s.marker = ""; // s.title = ""; // s.content = ""; // sections.push_back(s); s.marker = "NEW"; s.title = "NEW FEATURES/OPTIONS"; s.content = "==UPGMA==" " \n" " The UPGMA algorithm has been added to allow faster tree construction. The user now\n" " has the choice of using Neighbour Joining or UPGMA. The default is still NJ, but the\n" " user can change this by setting the clustering parameter.\n" " \n" " -CLUSTERING= :NJ or UPGMA\n" " \n" "==ITERATION==\n" "\n" " A remove first iteration scheme has been added. This can be used to improve the final\n" " alignment or improve the alignment at each stage of the progressive alignment. During the \n" " iteration step each sequence is removed in turn and realigned. If the resulting alignment \n" " is better than the previous alignment it is kept. This process is repeated until the score\n" " converges (the score is not improved) or until the maximum number of iterations is \n" " reached. The user can iterate at each step of the progressive alignment by setting the \n" " iteration parameter to TREE or just on the final alignment by seting the iteration \n" " parameter to ALIGNMENT. The default is no iteration. The maximum number of iterations can \n" " be set using the numiter parameter. The default number of iterations is 3.\n" " \n" " -ITERATION= :NONE or TREE or ALIGNMENT\n" " \n" " -NUMITER=n :Maximum number of iterations to perform\n" " \n" "==HELP==\n" " \n" " -FULLHELP :Print out the complete help content\n" " \n" "==MISC==\n" "\n" " -MAXSEQLEN=n :Maximum allowed sequence length\n" " \n" " -QUIET :Reduce console output to minimum\n" " \n" " -STATS=file :Log some alignents statistics to file\n" ""; sections.push_back(s); s.marker = "1"; s.title = "General help for CLUSTAL W (" + version + ")"; s.content = "Clustal W is a general purpose multiple alignment program for DNA or proteins.\n" "\n" "SEQUENCE INPUT: all sequences must be in 1 file, one after another. \n" "7 formats are automatically recognised: NBRF-PIR, EMBL-SWISSPROT, \n" "Pearson (Fasta), Clustal (*.aln), GCG-MSF (Pileup), GCG9-RSF and GDE flat file.\n" "All non-alphabetic characters (spaces, digits, punctuation marks) are ignored\n" "except \"-\" which is used to indicate a GAP (\".\" in MSF-RSF). \n" "\n" "To do a MULTIPLE ALIGNMENT on a set of sequences, use item 1 from this menu to \n" "INPUT them; go to menu item 2 to do the multiple alignment.\n" "\n" "PROFILE ALIGNMENTS (menu item 3) are used to align 2 alignments. Use this to\n" "add a new sequence to an old alignment, or to use secondary structure to guide \n" "the alignment process. GAPS in the old alignments are indicated using the \"-\" \n" "character. PROFILES can be input in ANY of the allowed formats; just \n" "use \"-\" (or \".\" for MSF-RSF) for each gap position.\n" "\n" "PHYLOGENETIC TREES (menu item 4) can be calculated from old alignments (read in\n" "with \"-\" characters to indicate gaps) OR after a multiple alignment while the \n" "alignment is still in memory.\n" "\n" "\n" "The program tries to automatically recognise the different file formats used\n" "and to guess whether the sequences are amino acid or nucleotide. This is not\n" "always foolproof.\n" "\n" "FASTA and NBRF-PIR formats are recognised by having a \">\" as the first \n" "character in the file. \n" "\n" "EMBL-Swiss Prot formats are recognised by the letters\n" "ID at the start of the file (the token for the entry name field). \n" "\n" "CLUSTAL format is recognised by the word CLUSTAL at the beginning of the file.\n" "\n" "GCG-MSF format is recognised by one of the following:\n" " - the word PileUp at the start of the file. \n" " - the word !!AA_MULTIPLE_ALIGNMENT or !!NA_MULTIPLE_ALIGNMENT\n" " at the start of the file.\n" " - the word MSF on the first line of the line, and the characters ..\n" " at the end of this line.\n" "\n" "GCG-RSF format is recognised by the word !!RICH_SEQUENCE at the beginning of\n" "the file.\n" "\n" "\n" "If 85% or more of the characters in the sequence are from A,C,G,T,U or N, the\n" "sequence will be assumed to be nucleotide. This works in 97.3% of cases\n" "but watch out!\n" ""; sections.push_back(s); s.marker = "2"; s.title = "Help for multiple alignments"; s.content = "If you have already loaded sequences, use menu item 1 to do the complete\n" "multiple alignment. You will be prompted for 2 output files: 1 for the \n" "alignment itself; another to store a dendrogram that describes the similarity\n" "of the sequences to each other.\n" "\n" "Multiple alignments are carried out in 3 stages (automatically done from menu\n" "item 1 ...Do complete multiple alignments now):\n" "\n" "1) all sequences are compared to each other (pairwise alignments);\n" "\n" "2) a dendrogram (like a phylogenetic tree) is constructed, describing the\n" "approximate groupings of the sequences by similarity (stored in a file).\n" "\n" "3) the final multiple alignment is carried out, using the dendrogram as a guide.\n" "\n" "\n" "PAIRWISE ALIGNMENT parameters control the speed-sensitivity of the initial\n" "alignments.\n" "\n" "MULTIPLE ALIGNMENT parameters control the gaps in the final multiple alignments.\n" "\n" "\n" "RESET GAPS (menu item 7) will remove any new gaps introduced into the sequences\n" "during multiple alignment if you wish to change the parameters and try again.\n" "This only takes effect just before you do a second multiple alignment. You\n" "can make phylogenetic trees after alignment whether or not this is ON.\n" "If you turn this OFF, the new gaps are kept even if you do a second multiple\n" "alignment. This allows you to iterate the alignment gradually. Sometimes, the \n" "alignment is improved by a second or third pass.\n" "\n" "SCREEN DISPLAY (menu item 8) can be used to send the output alignments to the \n" "screen as well as to the output file.\n" "\n" "You can skip the first stages (pairwise alignments; dendrogram) by using an\n" "old dendrogram file (menu item 3); or you can just produce the dendrogram\n" "with no final multiple alignment (menu item 2).\n" "\n" "\n" "OUTPUT FORMAT: Menu item 9 (format options) allows you to choose from 6 \n" "different alignment formats (CLUSTAL, GCG, NBRF-PIR, PHYLIP, GDE, NEXUS, and FASTA). \n" "\n" ""; sections.push_back(s); s.marker = "3"; s.title = "Help for pairwise alignment parameters"; s.content = "A distance is calculated between every pair of sequences and these are used to\n" "construct the dendrogram which guides the final multiple alignment. The scores\n" "are calculated from separate pairwise alignments. These can be calculated using\n" "2 methods: dynamic programming (slow but accurate) or by the method of Wilbur\n" "and Lipman (extremely fast but approximate). \n" "\n" "You can choose between the 2 alignment methods using menu option 8. The\n" "slow-accurate method is fine for short sequences but will be VERY SLOW for \n" "many (e.g. >100) long (e.g. >1000 residue) sequences. \n" "\n" "SLOW-ACCURATE alignment parameters:\n" " These parameters do not have any affect on the speed of the alignments. \n" "They are used to give initial alignments which are then rescored to give percent\n" "identity scores. These % scores are the ones which are displayed on the \n" "screen. The scores are converted to distances for the trees.\n" "\n" "1) Gap Open Penalty: the penalty for opening a gap in the alignment.\n" "2) Gap extension penalty: the penalty for extending a gap by 1 residue.\n" "3) Protein weight matrix: the scoring table which describes the similarity\n" " of each amino acid to each other.\n" "4) DNA weight matrix: the scores assigned to matches and mismatches \n" " (including IUB ambiguity codes).\n" "\n" "\n" "FAST-APPROXIMATE alignment parameters:\n" "\n" "These similarity scores are calculated from fast, approximate, global align-\n" "ments, which are controlled by 4 parameters. 2 techniques are used to make\n" "these alignments very fast: 1) only exactly matching fragments (k-tuples) are\n" "considered; 2) only the 'best' diagonals (the ones with most k-tuple matches)\n" "are used.\n" "\n" "K-TUPLE SIZE: This is the size of exactly matching fragment that is used. \n" "INCREASE for speed (max= 2 for proteins; 4 for DNA), DECREASE for sensitivity.\n" "For longer sequences (e.g. >1000 residues) you may need to increase the default.\n" "\n" "GAP PENALTY: This is a penalty for each gap in the fast alignments. It has\n" "little affect on the speed or sensitivity except for extreme values.\n" "\n" "TOP DIAGONALS: The number of k-tuple matches on each diagonal (in an imaginary\n" "dot-matrix plot) is calculated. Only the best ones (with most matches) are\n" "used in the alignment. This parameter specifies how many. Decrease for speed;\n" "increase for sensitivity.\n" "\n" "WINDOW SIZE: This is the number of diagonals around each of the 'best' \n" "diagonals that will be used. Decrease for speed; increase for sensitivity.\n" ""; sections.push_back(s); s.marker = "4"; s.title = "Help for multiple alignment parameters"; s.content = "These parameters control the final multiple alignment. This is the core of the\n" "program and the details are complicated. To fully understand the use of the\n" "parameters and the scoring system, you will have to refer to the documentation.\n" "\n" "Each step in the final multiple alignment consists of aligning two alignments \n" "or sequences. This is done progressively, following the branching order in \n" "the GUIDE TREE. The basic parameters to control this are two gap penalties and\n" "the scores for various identical-non-indentical residues. \n" "\n" "1) and 2) The GAP PENALTIES are set by menu items 1 and 2. These control the \n" "cost of opening up every new gap and the cost of every item in a gap. \n" "Increasing the gap opening penalty will make gaps less frequent. Increasing \n" "the gap extension penalty will make gaps shorter. Terminal gaps are not \n" "penalised.\n" "\n" "3) The DELAY DIVERGENT SEQUENCES switch delays the alignment of the most\n" "distantly related sequences until after the most closely related sequences have \n" "been aligned. The setting shows the percent identity level required to delay\n" "the addition of a sequence; sequences that are less identical than this level\n" "to any other sequences will be aligned later.\n" "\n" "\n" "\n" "4) The TRANSITION WEIGHT gives transitions (A <--> G or C <--> T \n" "i.e. purine-purine or pyrimidine-pyrimidine substitutions) a weight between 0\n" "and 1; a weight of zero means that the transitions are scored as mismatches,\n" "while a weight of 1 gives the transitions the match score. For distantly related\n" "DNA sequences, the weight should be near to zero; for closely related sequences\n" "it can be useful to assign a higher score.\n" "\n" "\n" "5) PROTEIN WEIGHT MATRIX leads to a new menu where you are offered a choice of\n" "weight matrices. The default for proteins in version 1.8 is the PAM series \n" "derived by Gonnet and colleagues. Note, a series is used! The actual matrix\n" "that is used depends on how similar the sequences to be aligned at this \n" "alignment step are. Different matrices work differently at each evolutionary\n" "distance. \n" "\n" "6) DNA WEIGHT MATRIX leads to a new menu where a single matrix (not a series)\n" "can be selected. The default is the matrix used by BESTFIT for comparison of\n" "nucleic acid sequences.\n" "\n" "Further help is offered in the weight matrix menu.\n" "\n" "\n" "7) In the weight matrices, you can use negative as well as positive values if\n" "you wish, although the matrix will be automatically adjusted to all positive\n" "scores, unless the NEGATIVE MATRIX option is selected.\n" "\n" "8) PROTEIN GAP PARAMETERS displays a menu allowing you to set some Gap Penalty\n" "options which are only used in protein alignments.\n" ""; sections.push_back(s); s.marker = "A"; s.title = "Help for protein gap parameters."; s.content = "1) RESIDUE SPECIFIC PENALTIES are amino acid specific gap penalties that reduce\n" "or increase the gap opening penalties at each position in the alignment or\n" "sequence. See the documentation for details. As an example, positions that \n" "are rich in glycine are more likely to have an adjacent gap than positions that\n" "are rich in valine.\n" "\n" "2) 3) HYDROPHILIC GAP PENALTIES are used to increase the chances of a gap within\n" "a run (5 or more residues) of hydrophilic amino acids; these are likely to\n" "be loop or random coil regions where gaps are more common. The residues that \n" "are \"considered\" to be hydrophilic are set by menu item 3.\n" "\n" "4) GAP SEPARATION DISTANCE tries to decrease the chances of gaps being too\n" "close to each other. Gaps that are less than this distance apart are penalised\n" "more than other gaps. This does not prevent close gaps; it makes them less\n" "frequent, promoting a block-like appearance of the alignment.\n" "\n" "5) END GAP SEPARATION treats end gaps just like internal gaps for the purposes\n" "of avoiding gaps that are too close (set by GAP SEPARATION DISTANCE above).\n" "If you turn this off, end gaps will be ignored for this purpose. This is\n" "useful when you wish to align fragments where the end gaps are not biologically\n" "meaningful.\n" ""; sections.push_back(s); s.marker = "5"; s.title = "Help for output format options."; s.content = "Several output formats are offered. You can choose any (or all 6 if you wish). \n" "\n" "CLUSTAL format output is a self explanatory alignment format. It shows the\n" "sequences aligned in blocks. It can be read in again at a later date to\n" "(for example) calculate a phylogenetic tree or add a new sequence with a \n" "profile alignment.\n" "\n" "GCG output can be used by any of the GCG programs that can work on multiple\n" "alignments (e.g. PRETTY, PROFILEMAKE, PLOTALIGN). It is the same as the GCG\n" ".msf format files (multiple sequence file); new in version 7 of GCG.\n" "\n" "Fasta output cis widely used because of it's simplicity. Each sequence name is\n" "preceeded by a '>'-sign. The sequence itself is printed out in the following lines\n" "\n" "PHYLIP format output can be used for input to the PHYLIP package of Joe \n" "Felsenstein. This is an extremely widely used package for doing every \n" "imaginable form of phylogenetic analysis (MUCH more than the the modest intro-\n" "duction offered by this program).\n" "\n" "NBRF-PIR: this is the same as the standard PIR format with ONE ADDITION. Gap\n" "characters \"-\" are used to indicate the positions of gaps in the multiple \n" "alignment. These files can be re-used as input in any part of clustal that\n" "allows sequences (or alignments or profiles) to be read in. \n" "\n" "GDE: this is the flat file format used by the GDE package of Steven Smith.\n" "\n" "NEXUS: the format used by several phylogeny programs, including PAUP and\n" "MacClade.\n" "\n" "GDE OUTPUT CASE: sequences in GDE format may be written in either upper or\n" "lower case.\n" "\n" "CLUSTALW SEQUENCE NUMBERS: residue numbers may be added to the end of the\n" "alignment lines in clustalw format.\n" "\n" "OUTPUT ORDER is used to control the order of the sequences in the output\n" "alignments. By default, the order corresponds to the order in which the\n" "sequences were aligned (from the guide tree-dendrogram), thus automatically\n" "grouping closely related sequences. This switch can be used to set the order\n" "to the same as the input file.\n" "\n" "PARAMETER OUTPUT: This option allows you to save all your parameter settings\n" "in a parameter file. This file can be used subsequently to rerun Clustal W\n" "using the same parameters.\n" ""; sections.push_back(s); s.marker = "6"; s.title = "Help for profile and structure alignments"; s.content = "By PROFILE ALIGNMENT, we mean alignment using existing alignments. Profile \n" "alignments allow you to store alignments of your favourite sequences and add\n" "new sequences to them in small bunches at a time. A profile is simply an\n" "alignment of one or more sequences (e.g. an alignment output file from CLUSTAL\n" "W). Each input can be a single sequence. One or both sets of input sequences\n" "may include secondary structure assignments or gap penalty masks to guide the\n" "alignment. \n" "\n" "The profiles can be in any of the allowed input formats with \"-\" characters\n" "used to specify gaps (except for MSF-RSF where \".\" is used).\n" "\n" "You have to specify the 2 profiles by choosing menu items 1 and 2 and giving\n" "2 file names. Then Menu item 3 will align the 2 profiles to each other. \n" "Secondary structure masks in either profile can be used to guide the alignment.\n" "\n" "Menu item 4 will take the sequences in the second profile and align them to\n" "the first profile, 1 at a time. This is useful to add some new sequences to\n" "an existing alignment, or to align a set of sequences to a known structure. \n" "In this case, the second profile would not be pre-aligned.\n" "\n" "\n" "The alignment parameters can be set using menu items 5, 6 and 7. These are\n" "EXACTLY the same parameters as used by the general, automatic multiple\n" "alignment procedure. The general multiple alignment procedure is simply a\n" "series of profile alignments. Carrying out a series of profile alignments on\n" "larger and larger groups of sequences, allows you to manually build up a\n" "complete alignment, if necessary editing intermediate alignments.\n" "\n" "SECONDARY STRUCTURE OPTIONS. Menu Option 0 allows you to set 2D structure\n" "parameters. If a solved structure is available, it can be used to guide the \n" "alignment by raising gap penalties within secondary structure elements, so \n" "that gaps will preferentially be inserted into unstructured surface loops.\n" "Alternatively, a user-specified gap penalty mask can be supplied directly.\n" "\n" "A gap penalty mask is a series of numbers between 1 and 9, one per position in \n" "the alignment. Each number specifies how much the gap opening penalty is to be \n" "raised at that position (raised by multiplying the basic gap opening penalty\n" "by the number) i.e. a mask figure of 1 at a position means no change\n" "in gap opening penalty; a figure of 4 means that the gap opening penalty is\n" "four times greater at that position, making gaps 4 times harder to open.\n" "\n" "The format for gap penalty masks and secondary structure masks is explained\n" "in the help under option 0 (secondary structure options).\n" ""; sections.push_back(s); s.marker = "B"; s.title = "Help for secondary structure - gap penalty masks"; s.content = "The use of secondary structure-based penalties has been shown to improve the\n" "accuracy of multiple alignment. Therefore CLUSTAL W now allows gap penalty \n" "masks to be supplied with the input sequences. The masks work by raising gap \n" "penalties in specified regions (typically secondary structure elements) so that\n" "gaps are preferentially opened in the less well conserved regions (typically \n" "surface loops).\n" "\n" "Options 1 and 2 control whether the input secondary structure information or\n" "gap penalty masks will be used.\n" "\n" "Option 3 controls whether the secondary structure and gap penalty masks should\n" "be included in the output alignment.\n" "\n" "Options 4 and 5 provide the value for raising the gap penalty at core Alpha \n" "Helical (A) and Beta Strand (B) residues. In CLUSTAL format, capital residues \n" "denote the A and B core structure notation. The basic gap penalties are\n" "multiplied by the amount specified.\n" "\n" "Option 6 provides the value for the gap penalty in Loops. By default this \n" "penalty is not raised. In CLUSTAL format, loops are specified by \".\" in the \n" "secondary structure notation.\n" "\n" "Option 7 provides the value for setting the gap penalty at the ends of \n" "secondary structures. Ends of secondary structures are observed to grow \n" "and-or shrink in related structures. Therefore by default these are given \n" "intermediate values, lower than the core penalties. All secondary structure \n" "read in as lower case in CLUSTAL format gets the reduced terminal penalty.\n" "\n" "Options 8 and 9 specify the range of structure termini for the intermediate \n" "penalties. In the alignment output, these are indicated as lower case. \n" "For Alpha Helices, by default, the range spans the end helical turn. For \n" "Beta Strands, the default range spans the end residue and the adjacent loop \n" "residue, since sequence conservation often extends beyond the actual H-bonded\n" "Beta Strand.\n" "\n" "CLUSTAL W can read the masks from SWISS-PROT, CLUSTAL or GDE format input\n" "files. For many 3-D protein structures, secondary structure information is\n" "recorded in the feature tables of SWISS-PROT database entries. You should\n" "always check that the assignments are correct - some are quite inaccurate.\n" "CLUSTAL W looks for SWISS-PROT HELIX and STRAND assignments e.g.\n" "\n" "FT HELIX 100 115\n" "FT STRAND 118 119\n" "\n" "The structure and penalty masks can also be read from CLUSTAL alignment format \n" "as comment lines beginning \"!SS_\" or \"!GM_\" e.g.\n" "\n" "!SS_HBA_HUMA ..aaaAAAAAAAAAAaaa.aaaAAAAAAAAAAaaaaaaAaaa.........aaaAAAAAA\n" "!GM_HBA_HUMA 112224444444444222122244444444442222224222111111111222444444\n" "HBA_HUMA VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGK\n" "\n" "Note that the mask itself is a set of numbers between 1 and 9 each of which is \n" "assigned to the residue(s) in the same column below. \n" "\n" "In GDE flat file format, the masks are specified as text and the names must\n" "begin with \"SS_ or \"GM_.\n" "\n" "Either a structure or penalty mask or both may be used. If both are included in\n" "an alignment, the user will be asked which is to be used.\n" ""; sections.push_back(s); s.marker = "C"; s.title = "Help for secondary structure - gap penalty mask output options"; s.content = "The options in this menu let you choose whether or not to include the masks\n" "in the CLUSTAL W output alignments. Showing both is useful for understanding\n" "how the masks work. The secondary structure information is itself very useful\n" "in judging the alignment quality and in seeing how residue conservation\n" "patterns vary with secondary structure.\n" ""; sections.push_back(s); s.marker = "7"; s.title = "Help for phylogenetic trees"; s.content = "1) Before calculating a tree, you must have an ALIGNMENT in memory. This can be\n" "input in any format or you should have just carried out a full multiple\n" "alignment and the alignment is still in memory. \n" "\n" "\n" "*************** Remember YOU MUST ALIGN THE SEQUENCES FIRST!!!! ***************\n" "\n" "\n" "The methods used are NJ (Neighbour Joining) and UPGMA. First\n" "you calculate distances (percent divergence) between all pairs of sequence from\n" "a multiple alignment; second you apply the NJ or UPGMA method to the distance matrix.\n" "\n" "2) EXCLUDE POSITIONS WITH GAPS? With this option, any alignment positions where\n" "ANY of the sequences have a gap will be ignored. This means that 'like' will be\n" "compared to 'like' in all distances, which is highly desirable. It also\n" "automatically throws away the most ambiguous parts of the alignment, which are\n" "concentrated around gaps (usually). The disadvantage is that you may throw away\n" "much of the data if there are many gaps (which is why it is difficult for us to\n" "make it the default). \n" "\n" "\n" "\n" "3) CORRECT FOR MULTIPLE SUBSTITUTIONS? For small divergence (say <10%) this\n" "option makes no difference. For greater divergence, it corrects for the fact\n" "that observed distances underestimate actual evolutionary distances. This is\n" "because, as sequences diverge, more than one substitution will happen at many\n" "sites. However, you only see one difference when you look at the present day\n" "sequences. Therefore, this option has the effect of stretching branch lengths\n" "in trees (especially long branches). The corrections used here (for DNA or\n" "proteins) are both due to Motoo Kimura. See the documentation for details. \n" "\n" "Where possible, this option should be used. However, for VERY divergent\n" "sequences, the distances cannot be reliably corrected. You will be warned if\n" "this happens. Even if none of the distances in a data set exceed the reliable\n" "threshold, if you bootstrap the data, some of the bootstrap distances may\n" "randomly exceed the safe limit. \n" "\n" "4) To calculate a tree, use option 4 (DRAW TREE NOW). This gives an UNROOTED\n" "tree and all branch lengths. The root of the tree can only be inferred by\n" "using an outgroup (a sequence that you are certain branches at the outside\n" "of the tree .... certain on biological grounds) OR if you assume a degree\n" "of constancy in the 'molecular clock', you can place the root in the 'middle'\n" "of the tree (roughly equidistant from all tips).\n" "\n" "5) TOGGLE PHYLIP BOOTSTRAP POSITIONS\n" "By default, the bootstrap values are correctly placed on the tree branches of\n" "the phylip format output tree. The toggle allows them to be placed on the\n" "nodes, which is incorrect, but some display packages (e.g. TreeTool, TreeView\n" "and Phylowin) only support node labelling but not branch labelling. Care\n" "should be taken to note which branches and labels go together.\n" "\n" "6) OUTPUT FORMATS: four different formats are allowed. None of these displays\n" "the tree visually. Useful display programs accepting PHYLIP format include\n" "NJplot (from Manolo Gouy and supplied with Clustal W), TreeView (Mac-PC), and\n" "PHYLIP itself - OR get the PHYLIP package and use the tree drawing facilities\n" "there. (Get the PHYLIP package anyway if you are interested in trees). The\n" "NEXUS format can be read into PAUP or MacClade.\n" ""; sections.push_back(s); s.marker = "8"; s.title = "Help for choosing a weight matrix"; s.content = "For protein alignments, you use a weight matrix to determine the similarity of\n" "non-identical amino acids. For example, Tyr aligned with Phe is usually judged \n" "to be 'better' than Tyr aligned with Pro.\n" "\n" "There are three 'in-built' series of weight matrices offered. Each consists of\n" "several matrices which work differently at different evolutionary distances. To\n" "see the exact details, read the documentation. Crudely, we store several\n" "matrices in memory, spanning the full range of amino acid distance (from almost\n" "identical sequences to highly divergent ones). For very similar sequences, it\n" "is best to use a strict weight matrix which only gives a high score to\n" "identities and the most favoured conservative substitutions. For more divergent\n" "sequences, it is appropriate to use \"softer\" matrices which give a high score\n" "to many other frequent substitutions.\n" "\n" "1) BLOSUM (Henikoff). These matrices appear to be the best available for \n" "carrying out database similarity (homology searches). The matrices used are:\n" "Blosum 80, 62, 45 and 30. (BLOSUM was the default in earlier Clustal W\n" "versions)\n" "\n" "2) PAM (Dayhoff). These have been extremely widely used since the late '70s.\n" "We use the PAM 20, 60, 120 and 350 matrices.\n" "\n" "3) GONNET. These matrices were derived using almost the same procedure as the\n" "Dayhoff one (above) but are much more up to date and are based on a far larger\n" "data set. They appear to be more sensitive than the Dayhoff series. We use the\n" "GONNET 80, 120, 160, 250 and 350 matrices. This series is the default for\n" "Clustal W version 1.8.\n" "\n" "We also supply an identity matrix which gives a score of 1.0 to two identical \n" "amino acids and a score of zero otherwise. This matrix is not very useful.\n" "Alternatively, you can read in your own (just one matrix, not a series).\n" "\n" "A new matrix can be read from a file on disk, if the filename consists only\n" "of lower case characters. The values in the new weight matrix must be integers\n" "and the scores should be similarities. You can use negative as well as positive\n" "values if you wish, although the matrix will be automatically adjusted to all\n" "positive scores.\n" "\n" "\n" "\n" "For DNA, a single matrix (not a series) is used. Two hard-coded matrices are \n" "available:\n" "\n" "\n" "1) IUB. This is the default scoring matrix used by BESTFIT for the comparison\n" "of nucleic acid sequences. X's and N's are treated as matches to any IUB\n" "ambiguity symbol. All matches score 1.9; all mismatches for IUB symbols score 0.\n" " \n" " \n" "2) CLUSTALW(1.6). The previous system used by Clustal W, in which matches score\n" "1.0 and mismatches score 0. All matches for IUB symbols also score 0.\n" "\n" "INPUT FORMAT The format used for a new matrix is the same as the BLAST program.\n" "Any lines beginning with a # character are assumed to be comments. The first\n" "non-comment line should contain a list of amino acids in any order, using the\n" "1 letter code, followed by a * character. This should be followed by a square\n" "matrix of integer scores, with one row and one column for each amino acid. The\n" "last row and column of the matrix (corresponding to the * character) contain\n" "the minimum score over the whole matrix.\n" ""; sections.push_back(s); s.marker = "9"; s.title = "Help for command line parameters"; s.content = " DATA (sequences)\n" "\n" "-INFILE=file.ext :input sequences.\n" "-PROFILE1=file.ext and -PROFILE2=file.ext :profiles (old alignment).\n" "\n" "\n" " VERBS (do things)\n" "\n" "-OPTIONS :list the command line parameters\n" "-HELP or -CHECK :outline the command line params.\n" "-FULLHELP :output full help content.\n" "-ALIGN :do full multiple alignment.\n" "-TREE :calculate NJ tree.\n" "-PIM :output percent identity matrix (while calculating the tree)\n" "-BOOTSTRAP(=n) :bootstrap a NJ tree (n= number of bootstraps; def. = 1000).\n" "-CONVERT :output the input sequences in a different file format.\n" "\n" "\n" " PARAMETERS (set things)\n" "\n" "***General settings:****\n" "-INTERACTIVE :read command line, then enter normal interactive menus\n" "-QUICKTREE :use FAST algorithm for the alignment guide tree\n" "-TYPE= :PROTEIN or DNA sequences\n" "-NEGATIVE :protein alignment with negative values in matrix\n" "-OUTFILE= :sequence alignment file name\n" "-OUTPUT= :CLUSTAL(default), GCG, GDE, PHYLIP, PIR, NEXUS and FASTA\n" "-OUTORDER= :INPUT or ALIGNED\n" "-CASE :LOWER or UPPER (for GDE output only)\n" "-SEQNOS= :OFF or ON (for Clustal output only)\n" "-SEQNO_RANGE=:OFF or ON (NEW: for all output formats)\n" "-RANGE=m,n :sequence range to write starting m to m+n\n" "-MAXSEQLEN=n :maximum allowed input sequence length\n" "-QUIET :Reduce console output to minimum\n" "-STATS= :Log some alignents statistics to file\n" "\n" "***Fast Pairwise Alignments:***\n" "-KTUPLE=n :word size\n" "-TOPDIAGS=n :number of best diags.\n" "-WINDOW=n :window around best diags.\n" "-PAIRGAP=n :gap penalty\n" "-SCORE :PERCENT or ABSOLUTE\n" "\n" "\n" "***Slow Pairwise Alignments:***\n" "-PWMATRIX= :Protein weight matrix=BLOSUM, PAM, GONNET, ID or filename\n" "-PWDNAMATRIX= :DNA weight matrix=IUB, CLUSTALW or filename\n" "-PWGAPOPEN=f :gap opening penalty \n" "-PWGAPEXT=f :gap opening penalty\n" "\n" "\n" "***Multiple Alignments:***\n" "-NEWTREE= :file for new guide tree\n" "-USETREE= :file for old guide tree\n" "-MATRIX= :Protein weight matrix=BLOSUM, PAM, GONNET, ID or filename\n" "-DNAMATRIX= :DNA weight matrix=IUB, CLUSTALW or filename\n" "-GAPOPEN=f :gap opening penalty \n" "-GAPEXT=f :gap extension penalty\n" "-ENDGAPS :no end gap separation pen. \n" "-GAPDIST=n :gap separation pen. range\n" "-NOPGAP :residue-specific gaps off \n" "-NOHGAP :hydrophilic gaps off\n" "-HGAPRESIDUES= :list hydrophilic res. \n" "-MAXDIV=n :% ident. for delay\n" "-TYPE= :PROTEIN or DNA\n" "-TRANSWEIGHT=f :transitions weighting\n" "-ITERATION= :NONE or TREE or ALIGNMENT\n" "-NUMITER=n :maximum number of iterations to perform\n" "-NOWEIGHTS :disable sequence weighting\n" "\n" "\n" "***Profile Alignments:***\n" "-PROFILE :Merge two alignments by profile alignment\n" "-NEWTREE1= :file for new guide tree for profile1\n" "-NEWTREE2= :file for new guide tree for profile2\n" "-USETREE1= :file for old guide tree for profile1\n" "-USETREE2= :file for old guide tree for profile2\n" "\n" "\n" "***Sequence to Profile Alignments:***\n" "-SEQUENCES :Sequentially add profile2 sequences to profile1 alignment\n" "-NEWTREE= :file for new guide tree\n" "-USETREE= :file for old guide tree\n" "\n" "\n" "***Structure Alignments:***\n" "-NOSECSTR1 :do not use secondary structure-gap penalty mask for profile 1 \n" "-NOSECSTR2 :do not use secondary structure-gap penalty mask for profile 2\n" "-SECSTROUT=STRUCTURE or MASK or BOTH or NONE :output in alignment file\n" "-HELIXGAP=n :gap penalty for helix core residues \n" "-STRANDGAP=n :gap penalty for strand core residues\n" "-LOOPGAP=n :gap penalty for loop regions\n" "-TERMINALGAP=n :gap penalty for structure termini\n" "-HELIXENDIN=n :number of residues inside helix to be treated as terminal\n" "-HELIXENDOUT=n :number of residues outside helix to be treated as terminal\n" "-STRANDENDIN=n :number of residues inside strand to be treated as terminal\n" "-STRANDENDOUT=n:number of residues outside strand to be treated as terminal \n" "\n" "\n" "***Trees:***\n" "-OUTPUTTREE=nj OR phylip OR dist OR nexus\n" "-SEED=n :seed number for bootstraps.\n" "-KIMURA :use Kimura's correction. \n" "-TOSSGAPS :ignore positions with gaps.\n" "-BOOTLABELS=node OR branch :position of bootstrap values in tree display\n" "-CLUSTERING= :NJ or UPGMA\n" ""; sections.push_back(s); s.marker = "0"; s.title = "Help for tree output format options"; s.content = "Four output formats are offered: 1) Clustal, 2) Phylip, 3) Just the distances\n" "4) Nexus\n" "\n" "None of these formats displays the results graphically. Many packages can\n" "display trees in the the PHYLIP format 2) below. It can also be imported into\n" "the PHYLIP programs RETREE, DRAWTREE and DRAWGRAM for graphical display. \n" "NEXUS format trees can be read by PAUP and MacClade.\n" "\n" "1) Clustal format output. \n" "This format is verbose and lists all of the distances between the sequences and\n" "the number of alignment positions used for each. The tree is described at the\n" "end of the file. It lists the sequences that are joined at each alignment step\n" "and the branch lengths. After two sequences are joined, it is referred to later\n" "as a NODE. The number of a NODE is the number of the lowest sequence in that\n" "NODE. \n" "\n" "2) Phylip format output.\n" "This format is the New Hampshire format, used by many phylogenetic analysis\n" "packages. It consists of a series of nested parentheses, describing the\n" "branching order, with the sequence names and branch lengths. It can be used by\n" "the RETREE, DRAWGRAM and DRAWTREE programs of the PHYLIP package to see the\n" "trees graphically. This is the same format used during multiple alignment for\n" "the guide trees. \n" "\n" "Use this format with NJplot (Manolo Gouy), supplied with Clustal W. Some other\n" "packages that can read and display New Hampshire format are TreeView (Mac/PC),\n" "TreeTool (UNIX), and Phylowin.\n" "\n" "3) The distances only.\n" "This format just outputs a matrix of all the pairwise distances in a format\n" "that can be used by the Phylip package. It used to be useful when one could not\n" "produce distances from protein sequences in the Phylip package but is now\n" "redundant (Protdist of Phylip 3.5 now does this).\n" "\n" "4) NEXUS FORMAT TREE. This format is used by several popular phylogeny programs,\n" "including PAUP and MacClade. The format is described fully in:\n" "Maddison, D. R., D. L. Swofford and W. P. Maddison. 1997.\n" "NEXUS: an extensible file format for systematic information.\n" "Systematic Biology 46:590-621.\n" "\n" "5) TOGGLE PHYLIP BOOTSTRAP POSITIONS\n" "By default, the bootstrap values are placed on the nodes of the phylip format\n" "output tree. This is inaccurate as the bootstrap values should be associated\n" "with the tree branches and not the nodes. However, this format can be read and\n" "displayed by TreeTool, TreeView and Phylowin. An option is available to\n" "correctly place the bootstrap values on the branches with which they are\n" "associated.\n" ""; sections.push_back(s); // mark // replace-string " \" // replace-regexp ^ " // replace-regexp $ \\n" // std::cout << "exiting Help::Help" << "\n"; } Help::~Help() { sections.clear(); } vector Help::ListSectionMarkers() { vector markers; for (unsigned int i=0; isections.size(); i++) { markers.push_back(this->sections[i].marker); } return markers; } string Help::GetSection(char marker) { string s(1, marker); return GetSection(s); } string Help::GetSection(string marker) { for (unsigned int i=0; isections.size(); i++) { if (this->sections[i].marker == marker) { return this->sections[i].content; } } return ""; } string Help::GetSectionTitle(char marker) { string s(1, marker); return GetSectionTitle(s); } string Help::GetSectionTitle(string marker) { for (unsigned int i=0; isections.size(); i++) { if (this->sections[i].marker == marker) { return this->sections[i].title; } } return ""; } clustalw-2.1/src/general/0000755000175000017500000000000011467270447012433 500000000000000clustalw-2.1/src/general/UserParameters.cpp0000644000175000017500000006263411446137416016027 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This file contains the implementation of the UserParameter functions * Mark Larkin Dec 8 2005 * * Modified: 17 January 2008 Paul McGettigan added in the O aminoacid residue to handle Pyrrolysine */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "UserParameters.h" #include "clustalw_version.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif namespace clustalw { using namespace std; UserParameters::UserParameters(bool log) { // FIXME: huge parts should be merged/replaced with // setParamsToDefault (which is not used at all) gapPos1 = NUMRES - 2; /* code for gaps inserted by clustalw */ gapPos2 = NUMRES - 1; /* code for gaps already in alignment */ //revisionLevel = CLU_SHORT_VERSION_STRING; revisionLevel = CLUSTALW_VERSION; interactive = false; gui = false; seqName = ""; DNAGapOpen = 15.0; DNAGapExtend = 6.66; AAGapOpen = 10.0; AAGapExtend = 0.2; gapDist = 4; outputOrder = ALIGNED; // Note: All macros should be replaced by const divergenceCutoff = 30; hydResidues = "GPSNDQEKR"; noWeights = false; negMatrix = false; noHydPenalties = false; noVarPenalties = true; noPrefPenalties = false; useEndGaps = false; endGapPenalties = false; resetAlignmentsNew = false; resetAlignmentsAll = false; outputStructPenalties = OUTSECST; structPenalties1 = NONE; structPenalties2 = NONE; useSS1 = true; useSS2 = true; helixPenalty = 4; strandPenalty = 4; loopPenalty = 1; helixEndMinus = 3; helixEndPlus = 0; strandEndMinus = 1; strandEndPlus = 1; helixEndPenalty = 2; strandEndPenalty = 2; useAmbiguities = false; DNAPWGapOpen = 15.0; DNAPWGapExtend = 6.66; AAPWGapOpen = 10.0; AAPWGapExtend = 0.1; quickPairAlign = false; transitionWeight = 0.5; DNAKtup = 2; DNAWindowGap = 5; DNASignif = 4; DNAWindow = 4; AAKtup = 1; AAWindowGap = 3; AASignif = 5; AAWindow = 5; percent = true; tossgaps = false; kimura = false; bootNumTrials = 1000; bootRanSeed = 111; debug = 0; explicitDNAFlag = false; lowercase = true; clSeqNumbers = false; seqRange = false; outputClustal = true; outputGcg = false; outputPhylip = false; outputNbrf = false; outputGde = false; outputNexus = false; outputFasta = false; showAlign = true; saveParameters = false; outputTreeClustal = false; outputTreePhylip = true; outputTreeDistances = false; outputTreeNexus = false; outputPim = false; bootstrapFormat = BS_BRANCH_LABELS; profile1Name = ""; // Initialise to blank strings profile2Name = ""; empty = true; profile1Empty = true; profile2Empty = true; outfileName = ""; //profile1NumSeqs = 0; // MARK: Set to default before used. useTreeFile = false; newTreeFile = false; useTree1File = false; useTree2File = false; newTree1File = false; newTree2File = false; aminoAcidCodes = "ABCDEFGHIKLMNOPQRSTUVWXYZ-"; maxAA = aminoAcidCodes.length() - 2; // Some variables need the alignment to be read in before they can be set. // I am putting the default as protein. Note: this should not make a difference // as they are not used before they have been set a value again!! gapOpen = AAGapOpen; gapExtend = AAGapExtend; PWGapOpen = AAPWGapOpen; PWGapExtend = AAPWGapExtend; gapPos1 = NUMRES - 2; gapPos2 = NUMRES - 1; profileNum = 0; menuFlag = false; // MARK: I set to default value. DNAFlag = false; // MARK: I set to default value. distanceTree = true; // MARK: I set to default value. ktup = AAKtup; window = AAWindow; windowGap = AAWindowGap; signif = AASignif; rangeFrom = -1; rangeTo = -1; rangeFromToSet = false; QTscorePlotScale = 5; QTresExceptionCutOff = 5; QTseqWeightCalculated = false; QTminLenLowScoreSegment = 1; QTlowScoreDNAMarkingScale = 5; // Set defaults for iteration variables. numIterations = 3; doRemoveFirstIteration = NONE; maxAllowedSeqLength = INT_MAX; clusterAlgorithm = NJ; displayInfo = true; helpFlag = false; fullHelpFlag = false; quiet = false; } // FIXME:never used void UserParameters::setParamsToDefault() { DNAGapOpen = 15.0; DNAGapExtend = 6.66; AAGapOpen = 10.0; AAGapExtend = 0.2; gapDist = 4; outputOrder = ALIGNED; divergenceCutoff = 30; hydResidues = "GPSNDQEKR"; noWeights = false; negMatrix = false; noHydPenalties = false; noVarPenalties = true; noPrefPenalties = false; useEndGaps = false; endGapPenalties = false; resetAlignmentsNew = false; resetAlignmentsAll = false; outputStructPenalties = OUTSECST; structPenalties1 = NONE; structPenalties2 = NONE; useSS1 = true; useSS2 = true; helixPenalty = 4; strandPenalty = 4; loopPenalty = 1; helixEndMinus = 3; helixEndPlus = 0; strandEndMinus = 1; strandEndPlus = 1; helixEndPenalty = 2; strandEndPenalty = 2; useAmbiguities = false; DNAPWGapOpen = 15.0; DNAPWGapExtend = 6.66; AAPWGapOpen = 10.0; AAPWGapExtend = 0.1; quickPairAlign = false; transitionWeight = 0.5; DNAKtup = 2; DNAWindowGap = 5; DNASignif = 4; DNAWindow = 4; AAKtup = 1; AAWindowGap = 3; AASignif = 5; AAWindow = 5; percent = true; tossgaps = false; kimura = false; bootNumTrials = 1000; bootRanSeed = 111; debug = 0; lowercase = true; clSeqNumbers = false; seqRange = false; outputClustal = true; outputGcg = false; outputPhylip = false; outputNbrf = false; outputGde = false; outputNexus = false; outputFasta = false; outputTreeClustal = false; outputTreePhylip = true; outputTreeDistances = false; outputTreeNexus = false; outputPim = false; bootstrapFormat = BS_BRANCH_LABELS; useTreeFile = false; newTreeFile = false; useTree1File = false; useTree2File = false; newTree1File = false; newTree2File = false; rangeFrom = -1; rangeTo = -1; rangeFromToSet = false; QTscorePlotScale = 5; QTresExceptionCutOff = 5; QTminLenLowScoreSegment = 1; QTlowScoreDNAMarkingScale = 5; distanceTree = true; // MARK: I set to default value. numIterations = 3; if(getDNAFlag()) { setDNAParams(); } else { setProtParams(); } clusterAlgorithm = NJ; displayInfo = true; helpFlag = false; fullHelpFlag = false; quiet = false; doRemoveFirstIteration = NONE; maxAllowedSeqLength = INT_MAX; } /* * The function createParameterOutput is used to put all the user parameters in * a file. It is used for testing and for saving parameters. * * * FIXME: AW: Some parameters are missing here (e.g. the new ones like * clustering, etc) * */ void UserParameters::createParameterOutput(void) { string parname, temp; string path; string message; utilityObject->getPath(seqName, &path); parname = path + "par"; if(menuFlag) { message = "\nEnter a name for the parameter output file [" + parname + "]"; utilityObject->getStr(message, temp); if(temp != "") { parname = temp; } } ofstream outfile; outfile.open(parname.c_str(), ofstream::out); if(!outfile) { return; // Failed to open } outfile << "clustalw \\\n"; if (!empty && profile1Empty) { outfile << "-infile=" << seqName << " \\\n"; } if (!profile1Empty) { outfile << "-profile1=" << profile1Name << "\\\n"; } if (!profile2Empty) { outfile << "-profile2=" << profile2Name << " \\\n"; } if (DNAFlag == true) { outfile << "-type=dna \\\n"; } else { outfile << "-type=protein \\\n"; } if (quickPairAlign) { outfile << "-quicktree \\\n"; outfile << "-ktuple=" << ktup << " \\\n"; outfile << "-window=" << window << " \\\n"; outfile << "-pairgap=" << windowGap << " \\\n"; outfile << "-topdiags=" << signif << " \\\n"; if (percent) { outfile << "-score=percent \\\n"; } else { outfile << "-score=absolute \\\n"; } } else { if (!DNAFlag) { //outfile << "-pwmatrix=" << pwMatrixName << " \\\n"; outfile << "-pwgapopen=" << fixed << setprecision(2) << AAPWGapOpen << " \\\n"; outfile << "-pwgapext=" << AAPWGapExtend << " \\\n"; } else { outfile << "-pwgapopen=" << fixed << setprecision(2) << PWGapOpen << " \\\n"; outfile << "-pwgapext=" << PWGapExtend << " \\\n"; } } if (!DNAFlag) { //outfile << "-matrix=" << matrixName << " \\\n"; outfile << "-gapopen=" << fixed << setprecision(2) << AAGapOpen << " \\\n"; outfile << "-gapext=" << AAGapExtend << " \\\n"; } else { outfile << "-gapopen=" << fixed << setprecision(2) << DNAGapOpen << " \\\n"; outfile << "-gapext=" << DNAGapExtend << " \\\n"; } outfile << "-maxdiv=" << divergenceCutoff << " \\\n"; if (!useEndGaps) { outfile << "-endgaps \\\n"; } if (!DNAFlag) { if (negMatrix) { outfile << "-negative \\\n"; } if (noPrefPenalties) { outfile << "-nopgap \\\n"; } if (noHydPenalties) { outfile << "-nohgap \\\n"; } if (noVarPenalties) { outfile << "-novgap \\\n"; } outfile << "-hgapresidues=" << hydResidues << " \\\n"; outfile << "-gapdist=" << gapDist << " \\\n"; } else { outfile << "-transweight=" << transitionWeight << " \\\n"; } if (outputGcg) { outfile << "-output=gcg \\\n"; } else if (outputGde) { outfile << "-output=gde \\\n"; } else if (outputNbrf) { outfile << "-output=pir \\\n"; } else if (outputPhylip) { outfile << "-output=phylip \\\n"; } else if (outputNexus) { outfile << "-output=nexus \\\n"; } if (outfileName[0]!=EOS) { outfile << "-outfile=" << outfileName << " \\\n"; } if (outputOrder==ALIGNED) { outfile << "-outorder=aligned \\\n"; } else { outfile << "-outorder=input \\\n"; } if (outputGde) { if (lowercase) { outfile << "-case=lower \\\n"; } else { outfile << "-case=upper \\\n"; } } outfile << "-interactive\n"; outfile.close(); } /* * The function resIndex returns the index of the character c in the string t. * */ int UserParameters::resIndex(string t, char c) { register int i; for (i = 0; t[i] && t[i] != c; i++) ; if (t[i]) { return (i); } else { return -1; } } void UserParameters::setDNAMultiGap() { gapOpen = DNAGapOpen; gapExtend = DNAGapExtend; } void UserParameters::setProtMultiGap() { gapOpen = AAGapOpen; gapExtend = AAGapExtend; } void UserParameters::setDNAParams() { gapOpen = DNAGapOpen; gapExtend = DNAGapExtend; PWGapOpen = DNAPWGapOpen; PWGapExtend = DNAPWGapExtend; ktup = DNAKtup; window = DNAWindow; signif = DNASignif; windowGap = DNAWindowGap; } void UserParameters::setProtParams() { gapOpen = AAGapOpen; gapExtend = AAGapExtend; PWGapOpen = AAPWGapOpen; PWGapExtend = AAPWGapExtend; ktup = AAKtup; window = AAWindow; signif = AASignif; windowGap = AAWindowGap; } void UserParameters::setPWParamToProtein() { PWGapOpen = AAPWGapOpen; PWGapExtend = AAPWGapExtend; ktup = AAKtup; window = AAWindow; signif = AASignif; windowGap = AAWindowGap; } void UserParameters::setPWParamToDNA() { PWGapOpen = DNAPWGapOpen; PWGapExtend = DNAPWGapExtend; ktup = DNAKtup; window = DNAWindow; signif = DNASignif; windowGap = DNAWindowGap; } void UserParameters::setPWProteinParam() { AAPWGapOpen = PWGapOpen; AAPWGapExtend = PWGapExtend; AAKtup = ktup; AAWindow = window; AASignif = signif; AAWindowGap = windowGap; } void UserParameters::setPWDNAParam() { DNAPWGapOpen = PWGapOpen; DNAPWGapExtend = PWGapExtend; DNAKtup = ktup; DNAWindow = window; DNASignif = signif; DNAWindowGap = windowGap; } /* * The rest of the functions are get, set and toggle functions for the variables. */ string UserParameters::getRevisionLevel() { return revisionLevel; } void UserParameters::setRevisionLevel(string value) { revisionLevel = value; } void UserParameters::setInteractive(bool value) { interactive = value; } void UserParameters::setGui(bool value) { gui = value; } void UserParameters::setGapOpen(float value) { gapOpen = value; } void UserParameters::setGapExtend(float value) { gapExtend = value; } void UserParameters::setPWGapOpen(float value) { PWGapOpen = value; } void UserParameters::setPWGapExtend(float value) { PWGapExtend = value; } void UserParameters::setMaxAA(int value) { maxAA = value; } void UserParameters::setGapPos1(int value) { gapPos1 = value; } void UserParameters::setGapPos2(int value) { gapPos2 = value; } void UserParameters::setProfileNum(int value) { profileNum = value; } void UserParameters::setMenuFlag(bool value) { menuFlag = value; } void UserParameters::setDNAFlag(bool value) { if(value == true) { setDNAParams(); } else { setProtParams(); } DNAFlag = value; } void UserParameters::setDistanceTree(bool value) { distanceTree = value; } void UserParameters::setSeqName(string value) { seqName = value; } void UserParameters::setDNAGapOpen(float value) { DNAGapOpen = value; } void UserParameters::setDNAGapExtend(float value) { DNAGapExtend = value; } void UserParameters::setProteinGapOpen(float value) { AAGapOpen = value; } void UserParameters::setProteinGapExtend(float value) { AAGapExtend = value; } void UserParameters::setGapDist(int value) { gapDist = value; } void UserParameters::setOutputOrder(int value) { outputOrder = value; } void UserParameters::toggleOutputOrder() { if (outputOrder == INPUT) { outputOrder = ALIGNED; } else { outputOrder = INPUT; } } void UserParameters::setDivergenceCutoff(int value) { divergenceCutoff = value; } void UserParameters::setHydResidues(string value) { //hydResidues = value; char hydResidue; string tempHydRes = ""; int inputStringLength = value.length(); if(inputStringLength > 0) { // NOTE this was causing an error, but I fixed it. Was giving an // out of range error. for (int i = 0; i < MAXHYDRESIDUES && i < inputStringLength; i++) { hydResidue = toupper(value.at(i)); if (isalpha(hydResidue)) { tempHydRes += hydResidue; } else // Not Alphabetic character! { break; } } if(tempHydRes.size() > 0) { hydResidues = tempHydRes; } } } void UserParameters::setNoWeights(bool value) { noWeights = value; } void UserParameters::setUseNegMatrix(bool value) { negMatrix = value; } void UserParameters::toggleUseNegMatrix() { negMatrix ^= true; } void UserParameters::setNoHydPenalties(bool value) { noHydPenalties = value; } void UserParameters::toggleNoHydPenalties() { noHydPenalties ^= true; } void UserParameters::setNoVarPenalties(bool value) { noVarPenalties = value; } void UserParameters::setNoPrefPenalties(bool value) { noPrefPenalties = value; } void UserParameters::toggleNoPrefPenalties() { noPrefPenalties ^= true; } void UserParameters::setUseEndGaps(bool value) { useEndGaps = value; } void UserParameters::toggleUseEndGaps() { useEndGaps ^= true; } void UserParameters::setEndGapPenalties(bool value) { endGapPenalties = value; } void UserParameters::toggleResetAlignmentsNew() { resetAlignmentsNew ^= true; } void UserParameters::setResetAlignmentsNew(bool value) { resetAlignmentsNew = value; } void UserParameters::setResetAlignmentsAll(bool value) { resetAlignmentsAll = value; } void UserParameters::setOutputStructPenalties(int value) { outputStructPenalties = value; } void UserParameters::setStructPenalties1(int value) { structPenalties1 = value; } void UserParameters::setStructPenalties2(int value) { structPenalties2 = value; } void UserParameters::setUseSS1(bool value) { useSS1 = value; } void UserParameters::toggleUseSS1() { useSS1 ^= true; } void UserParameters::setUseSS2(bool value) { useSS2 = value; } void UserParameters::toggleUseSS2() { useSS2 ^= true; } void UserParameters::setHelixPenalty(int value) { helixPenalty = value; } void UserParameters::setStrandPenalty(int value) { strandPenalty = value; } void UserParameters::setLoopPenalty(int value) { loopPenalty = value; } void UserParameters::setHelixEndMinus(int value) { helixEndMinus = value; } void UserParameters::setHelixEndPlus(int value) { helixEndPlus = value; } void UserParameters::setStrandEndMinus(int value) { strandEndMinus = value; } void UserParameters::setStrandEndPlus(int value) { strandEndPlus = value; } void UserParameters::setHelixEndPenalty(int value) { helixEndPenalty = value; } void UserParameters::setStrandEndPenalty(int value) { strandEndPenalty = value; } void UserParameters::setUseAmbiguities(bool value) { useAmbiguities = value; } void UserParameters::setDNAPWGapOpenPenalty(float value) { DNAPWGapOpen = value; } void UserParameters::setDNAPWGapExtendPenalty(float value) { DNAPWGapExtend = value; } void UserParameters::setProteinPWGapOpenPenalty(float value) { AAPWGapOpen = value; } void UserParameters::setProteinPWGapExtendPenalty(float value) { AAPWGapExtend = value; } void UserParameters::toggleQuickPairAlign() { quickPairAlign ^= true; } void UserParameters::setQuickPairAlign(bool value) { quickPairAlign = value; } void UserParameters::setTransitionWeight(float value) { transitionWeight = value; } void UserParameters::setDNAKtup(int value) { DNAKtup = value; } void UserParameters::setDNAWindowGap(int value) { DNAWindowGap = value; } void UserParameters::setDNASignif(int value) { DNASignif = value; } void UserParameters::setDNAWindow(int value) { DNAWindow = value; } void UserParameters::setAAKtup(int value) { AAKtup = value; } void UserParameters::setAAWindowGap(int value) { AAWindowGap = value; } void UserParameters::setAASignif(int value) { AASignif = value; } void UserParameters::setAAWindow(int value) { AAWindow = value; } void UserParameters::setPercent(bool value) { percent = value; } void UserParameters::toggleTossGaps() { tossgaps ^= true; } void UserParameters::setTossGaps(bool value) { tossgaps = value; } void UserParameters::setKimura(bool value) { kimura = value; } void UserParameters::toggleKimura() { kimura ^= true; } void UserParameters::setBootNumTrials(int value) { bootNumTrials = value; } void UserParameters::setBootRanSeed(unsigned int value) { bootRanSeed = value; } void UserParameters::setDebug(int value) { debug = value; } void UserParameters::setExplicitDNAFlag(bool value) { explicitDNAFlag = value; } void UserParameters::setLowercase(bool value) { lowercase = value; } void UserParameters::toggleLowercase() { lowercase ^= true; } void UserParameters::setClSeqNumbers(bool value) { clSeqNumbers = value; } void UserParameters::toggleClSeqNumbers() { clSeqNumbers ^= true; } void UserParameters::setSeqRange(bool value) { seqRange = value; } void UserParameters::toggleSeqRange() { seqRange ^= true; } void UserParameters::setOutputClustal(bool value) { outputClustal = value; } void UserParameters::toggleOutputClustal() { outputClustal ^= true; } void UserParameters::setOutputGCG(bool value) { outputGcg = value; } void UserParameters::toggleOutputGCG() { outputGcg ^= true; } void UserParameters::setOutputPhylip(bool value) { outputPhylip = value; } void UserParameters::toggleOutputPhylip() { outputPhylip ^= true; } void UserParameters::setOutputNbrf(bool value) { outputNbrf = value; } void UserParameters::toggleOutputNbrf() { outputNbrf ^= true; } void UserParameters::setOutputGde(bool value) { outputGde = value; } void UserParameters::toggleOutputGde() { outputGde ^= true; } void UserParameters::setOutputNexus(bool value) { outputNexus = value; } void UserParameters::toggleOutputNexus() { outputNexus ^= true; } void UserParameters::setOutputFasta(bool value) { outputFasta = value; } void UserParameters::toggleOutputFasta() { outputFasta ^= true; } void UserParameters::setShowAlign(bool value) { showAlign = value; } void UserParameters::toggleShowAlign() { showAlign ^= true; } void UserParameters::setSaveParameters(bool value) { saveParameters = value; } void UserParameters::toggleSaveParameters() { saveParameters ^= true; } void UserParameters::setOutputTreeClustal(bool value) { outputTreeClustal = value; } void UserParameters::toggleOutputTreeClustal() { outputTreeClustal ^= true; } void UserParameters::setOutputTreePhylip(bool value) { outputTreePhylip = value; } void UserParameters::toggleOutputTreePhylip() { outputTreePhylip ^= true; } void UserParameters::setOutputTreeDistances(bool value) { outputTreeDistances = value; } void UserParameters::toggleOutputTreeDistances() { outputTreeDistances ^= true; } void UserParameters::setOutputTreeNexus(bool value) { outputTreeNexus = value; } void UserParameters::toggleOutputTreeNexus() { outputTreeNexus ^= true; } void UserParameters::setOutputPim(bool value) { outputPim = value; } void UserParameters::setBootstrapFormat(int value) { bootstrapFormat = value; } void UserParameters::toggleBootstrapFormat() { if (bootstrapFormat == BS_NODE_LABELS) { bootstrapFormat = BS_BRANCH_LABELS; } else { bootstrapFormat = BS_NODE_LABELS; } } void UserParameters::setProfile1Name(string value) { profile1Name = value; } void UserParameters::setProfile2Name(string value) { profile2Name = value; } void UserParameters::setEmpty(bool value) { empty = value; } void UserParameters::setProfile1Empty(bool value) { profile1Empty = value; } void UserParameters::setProfile2Empty(bool value) { profile2Empty = value; } void UserParameters::setOutfileName(string value) { outfileName = value; } /*void UserParameters::setProfile1NumSeqs(int value) { profile1NumSeqs = value; }*/ // MARK CHANGE Jan 10 void UserParameters::setUseTreeFile(bool value) { useTreeFile = value; } void UserParameters::setNewTreeFile(bool value) { newTreeFile = value; } void UserParameters::setUseTree1File(bool value) { useTree1File = value; } void UserParameters::setUseTree2File(bool value) { useTree2File = value; } void UserParameters::setNewTree1File(bool value) { newTree1File = value; } void UserParameters::setNewTree2File(bool value) { newTree2File = value; } void UserParameters::setAminoAcidCodes(string value) { aminoAcidCodes = value; } void UserParameters::setKtup(int value) { ktup = value; } void UserParameters::setWindow(int value) { window = value; } void UserParameters::setWindowGap(int value) { windowGap = value; } void UserParameters::setSignif(int value) { signif = value; } void UserParameters::setRangeFrom(int from) { rangeFrom = from; rangeFromToSet = true; } void UserParameters::setRangeTo(int to) { rangeTo = to; rangeFromToSet = true; } int UserParameters::getQTScorePlotScale() { return QTscorePlotScale; } void UserParameters::setQTScorePlotScale(int score) { QTscorePlotScale = score; } int UserParameters::getQTResExceptionCutOff() { return QTresExceptionCutOff; } void UserParameters::setQTResExceptionCutOff(int cutOff) { QTresExceptionCutOff = cutOff; } bool UserParameters::getQTseqWeightCalculated() { return QTseqWeightCalculated; } void UserParameters::setQTseqWeightCalculated(bool calculated) { QTseqWeightCalculated = calculated; } int UserParameters::getQTminLenLowScoreSegment() { return QTminLenLowScoreSegment; } void UserParameters::setQTminLenLowScoreSegment(int minLen) { QTminLenLowScoreSegment = minLen; } int UserParameters::getQTlowScoreDNAMarkingScale() { return QTlowScoreDNAMarkingScale; } void UserParameters::setQTlowScoreDNAMarkingScale(int dnaScale) { QTlowScoreDNAMarkingScale = dnaScale; } bool UserParameters::IterationIsEnabled() { if (doRemoveFirstIteration == clustalw::NONE) return false; else return true; } } clustalw-2.1/src/general/statsObject.h0000644000175000017500000000034511442167171015003 00000000000000/** * Author: Andreas Wilm * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef STATSOBJECT_H #define STATSOBJECT_H #include "Stats.h" namespace clustalw { extern Stats* statsObject; } #endif clustalw-2.1/src/general/RandomAccessLList.h0000644000175000017500000001352311442167171016032 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Author: Mark Larkin UCD Conway Institute * * This class is to be used as a linked list type container. * The features are as follows: * 1) It allows efficient deletions anywhere. * 2) It also allows efficient random access. * 3) Its maximum size is fixed at creation. * 4) Items can only be added at the end. * 5) when it is destroyed it will delete the structure, but not the elements. * * Limitations: * It returns the ListElements directly, this is not the best way. A better way would be * to return an iterator of some kind, but this would take alot more work. At the moment * it is possible to have 2 LList objects and get an element from one list, and delete * it from another list. But this is ok for the time being. I will fix this later. */ #ifndef RANDOMACCESSLLIST_H #define RANDOMACCESSLLIST_H namespace clustalw { template class ListElement { public: ListElement() { // Do nothing } ListElement(T* e, ListElement* n, ListElement* p, unsigned int _index) { element = e; next = n; prev = p; index = _index; } ~ListElement() { element = 0; next = 0; } unsigned int getIndex(){return index;} T* element; ListElement* next; ListElement* prev; private: unsigned int index; }; template class RandomAccessLList { public: RandomAccessLList(int size) : maxSize(size), numElements(0) { elements = new ListElement*[size]; for(int i = 0; i < size; i++) { elements[i] = 0; } } ~RandomAccessLList() { for(int i = 0; i < maxSize; i++) { if(elements[i] != 0) { delete elements[i]; } } delete [] elements; } unsigned int getNumElements(){return numElements;} void addElementToBack(T* element) { if(numElements < maxSize) { // Add the element elements[numElements] = new ListElement(element, 0, 0, numElements); if(numElements == 0) { // First element elements[numElements]->next = 0; elements[numElements]->prev = 0; firstElementInList = elements[numElements]; numElements++; } else if(numElements > 0) // If it is not the first element { elements[numElements - 1]->next = elements[numElements]; elements[numElements]->prev = elements[numElements - 1]; elements[numElements]->next = 0; numElements++; } } } ListElement* getAt(int index) { if(index >= 0 && index < maxSize) { return elements[index]; } else { cout << "\nCannot get item : " << index << "\n"; return 0; } } ListElement* getFirst() { return firstElementInList; } void removeItem(ListElement* item) { if(item != 0 ) { int index = item->getIndex(); if(elements[index] != 0) { if(item->prev == 0 && item->next == 0) // Last item in the list { firstElementInList = 0; delete item; // Not sure if this is good or not. item = 0; numElements--; } else if(item->prev == 0) // remove First in the list { firstElementInList = item->next; firstElementInList->prev = 0; item->next = 0; delete item; // Not sure if this is good or not. item = 0; numElements--; } else if(item->next == 0) // remove last item { ListElement* prevElem = item->prev; prevElem->next = 0; item->prev = 0; delete item; // Not sure if this is good or not. item = 0; numElements--; } else // remove middle item { ListElement* prevElem = item->prev; ListElement* nextElem = item->next; prevElem->next = nextElem; nextElem->prev = prevElem; item->prev = 0; item->next = 0; delete item; // Not sure if this is good or not. item = 0; numElements--; } elements[index] = 0; } } else { cout << "ERROR: trying to remove item outside the bounds\n"; } } private: ListElement** elements; ListElement* firstElementInList; int maxSize; unsigned int numElements; }; } #endif clustalw-2.1/src/general/general.h0000644000175000017500000000217011442167171014131 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /* Mark tidy up Nov 2005 */ /* General purpose header file - rf 12/90 */ #ifndef _H_general #define _H_general namespace clustalw { /* Macintosh specific rf 12/9/94 */ #ifdef OS_MAC //#define const /* THINK C doesn't know about these identifiers */ //#define signed //#define volatile //#define int long //#define pint short /* cast ints in printf statements as pint*/ //#define int int /* cast ints for sequence lengths */ //#define lint int /* cast ints for profile scores */ #else //#define pint int /* cast ints in printf statements as pint */ //#define int int /* cast ints for sequence lengths */ //#define lint int /* cast ints for profile scores */ #endif /* definitions for all machines */ #define EOS '\0' /* End-Of-String */ #define MAXLINE 5000 /* Max. line length */ } #endif /* ifndef _H_general */ clustalw-2.1/src/general/SequenceNotFoundException.h0000644000175000017500000000066011442167171017622 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef SEQUENCENOTFOUNDEXCEPTION_H #define SEQUENCENOTFOUNDEXCEPTION_H // standard exceptions #include #include using namespace std; class SequenceNotFoundException: public exception { virtual const char* what() const throw () { return "Could not find sequence with given id\n"; } }; #endif clustalw-2.1/src/general/param.h0000644000175000017500000000046711442167171013623 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #define MAXARGS 100 typedef struct { char *str; int *flag; int type; char **arg; } CmdLineData; #define NOARG 0 #define INTARG 1 #define FLTARG 2 #define STRARG 3 #define FILARG 4 #define OPTARG 5 clustalw-2.1/src/general/OutputFile.h0000644000175000017500000000155111442167171014616 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef OUTPUTFILE_H #define OUTPUTFILE_H #include #include namespace clustalw { class OutputFile { public: OutputFile(); ~OutputFile(); bool openFile(std::string* fileName, const std::string msg, const std::string* path, const std::string ext, const std::string fileType); bool isOpen(); //void writeToFile(std::string* info); std::ofstream* getPtrToFile(); private: std::string getOutputFileName(const std::string prompt, std::string path, const std::string fileExtension); std::auto_ptr file; std::string typeOfFileMsg; // used for closing message! std::string name; }; } #endif clustalw-2.1/src/general/Utility.h0000644000175000017500000000432611452736413014166 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef UTILITY_H #define UTILITY_H #include #include #include #include #include #include #include "clustalw.h" class QLabel; using namespace std; namespace clustalw { class Utility { public: Utility(); virtual ~Utility(){}; char* rTrim(char *str); void rTrim(string *str); char* blankToUnderscore(char *str); string blankToUnderscore(string str); void getStr(string instr, string& outstr); char getChoice(string instr); double getReal(const char *instr, double minx, double maxx, double def); int getInt(const char *instr,int minx,int maxx, int def); unsigned long getUniqueSequenceIdentifier(); bool lineType(char *line, const char *code); bool blankLine(char *line); bool blankLineNumericLabel(char *line); void getPath(string str, string *path); virtual char promptForYesNo(char *title, const char *prompt); virtual char promptForYesNo(const char *title, const char *prompt); virtual void error( char *msg,...); virtual void error( const char *msg,...); virtual void warning( char *msg,...); virtual void warning( const char *msg,...); virtual void info( char *msg,...); virtual void info( const char *msg,...); virtual void myname( char *myname ); template T MIN(T x, T y){if (x <= y){return x;}return y;} template T MAX(T x, T y){if (x >= y){return x;}return y;} // Note the following function will never be used from this class. It is for the // QT version. I need it here so that I can add the function to QTUtility. virtual void setInfoLabelPtr(QLabel* ptrToLabelObj); bool isNumeric(char ch); double average(std::vector& v); double stdDev(std::vector& v); double median(std::vector v); /* Attributes */ void beQuiet(bool b) {quiet=b;}; private: /* Functions */ /* Attributes */ bool quiet; }; } #endif clustalw-2.1/src/general/ClustalWResources.h0000644000175000017500000000316611442167171016153 00000000000000/** * Implements a singleton that maintains program resources. * The single instance is (re)instantiated on demand like: * Resources *res = Resources::Instance(); * * 24-05-07,Nigel Brown(EMBL): created. * 3-7-07, Mark Larkin, modified this class for clustalw */ #ifndef RESOURCESCLUSTALW_H #define RESOURCESCLUSTALW_H #include using namespace std; namespace clustalw { enum ClustalWResourcePathType { DefaultPath, InstallPath, ExecutablePath, HomePath }; class ClustalWResources { public: /* return the Resources singleton */ static ClustalWResources *Instance(); /* setters */ void setPathToExecutable(std::string pathToFiles); /* getters */ std::string getDefaultPath() { return defaultPath; } std::string getInstallPath() { return installPath; } std::string getExecutablePath() { return executablePath; } std::string getHomePath() { return homePath; } std::string findFile(const char *file, const ClustalWResourcePathType where = DefaultPath) const; std::string findFile(const std::string file, const ClustalWResourcePathType where = DefaultPath) const; std::string searchPathsForFile(const std::string fileName) const; /* debug */ void dump(); protected: /* hide the constructors */ ClustalWResources(); ClustalWResources(const ClustalWResources&); ClustalWResources& operator= (const ClustalWResources&); std::string dirname(std::string path); private: std::string defaultPath; std::string installPath; std::string executablePath; std::string homePath; }; } #endif //RESOURCES_H clustalw-2.1/src/general/InvalidCombination.cpp0000644000175000017500000000215411442167171016622 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This class will be used to report invalid combinations of residue type and * aligntype. Correct values are either 0 or 1. * Note: It will not be possible for a user to cause this exception, only programmer. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include namespace clustalw { class InvalidCombination { public: InvalidCombination(int alignResidueType, int alignType) : _alignResidueType(alignResidueType), _alignType(alignType) {} void whatHappened(std::ostream &os = std::cerr) { os << "Incorrect Combination of alignResidueType and alignType.\n" << "Values should be 0 or 1\n" << "alignResidueType = " << _alignResidueType << "\n" << "alignType = " << _alignType << "\n"; } private: int _alignResidueType; int _alignType; }; } clustalw-2.1/src/general/SymMatrix.cpp0000644000175000017500000000026411442167171015006 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "SymMatrix.h" clustalw-2.1/src/general/VectorUtility.h0000644000175000017500000000273511442167171015351 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef VECTORUTILITY_H #define VECTORUTILITY_H #include namespace vectorutils { /** * The function mergeVectors will add the contents of * the other two vectors to the end of the first vector. */ template void mergeVectors(std::vector* vecToAddTo, std::vector* vector1, std::vector* vector2) { typename std::vector::iterator beginInsert = vecToAddTo->end(); typename std::vector::iterator beginVec1 = vector1->begin(); typename std::vector::iterator endVec1 = vector1->end(); typename std::vector::iterator beginVec2 = vector2->begin(); typename std::vector::iterator endVec2 = vector2->end(); // Add the first vector vecToAddTo->insert(beginInsert, beginVec1, endVec1); beginInsert = vecToAddTo->end(); // Add the second vector vecToAddTo->insert(beginInsert, beginVec2, endVec2); } /** * The function mergeVectors will add the contents of the second vector * to the end of the first vector. */ template void mergeVectors(std::vector* vecToAddTo, std::vector* vector1) { typename std::vector::iterator beginInsert = vecToAddTo->end(); typename std::vector::iterator beginVec1 = vector1->begin(); typename std::vector::iterator endVec1 = vector1->end(); // Add the first vector vecToAddTo->insert(beginInsert, beginVec1, endVec1); } } #endif clustalw-2.1/src/general/SquareMat.h0000644000175000017500000000371511442167171014424 00000000000000 /** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #include #include #include namespace clustalw { using namespace std; template class SquareMat { public: SquareMat():m_dimRow(0), m_dimCol(0){;} SquareMat(int size) { m_dimRow = size; m_dimCol = size; for (int i=0; i < size; i++) { vector x(size); int y = x.size(); m_2DVector.push_back(x); } } void SetAt(int nRow, int nCol, const T& value) { m_2DVector[nRow][nCol] = value; } T GetAt(int nRow, int nCol) { return m_2DVector[nRow][nCol]; } void GrowRow(int newSize) { if (newSize <= m_dimRow) return; m_dimRow = newSize; for(int i = 0 ; i < newSize - m_dimCol; i++) { vector x(m_dimRow); m_2DVector.push_back(x); } } void GrowCol(int newSize) { if(newSize <= m_dimCol) return; m_dimCol = newSize; for (int i=0; i & operator[](int x) { return m_2DVector[x]; } private: vector< vector > m_2DVector; unsigned int m_dimRow; unsigned int m_dimCol; }; } clustalw-2.1/src/general/Utility.cpp0000644000175000017500000002421511452741135014515 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. * * @author Mark Larkin, Conway Institute, UCD. mark.larkin@ucd.ie * * Changes: * * 2007-12-03, Andreas Wilm (UCD): replaced gets with fgets, and * got rid of some compiler warning * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "Utility.h" #include "general/userparams.h" namespace clustalw { /** constructor */ Utility::Utility() { quiet=false; } /** * Removes trailing blanks from a string */ void Utility::rTrim(string *str) { string::reverse_iterator rit = str->rbegin(); while(rit != str->rend() && isspace(*rit)) { str->erase((++rit).base()); } } /** * Removes trailing blanks from a string * @param str String to remove trailing blanks from. * @return Pointer to the processed string */ char * Utility::rTrim(char *str) { register int p; p = strlen(str) - 1; while (isspace(str[p])) { p--; } str[p + 1] = EOS; return str; } /** * Replace blanks in a string with underscores. Also replaces , ; : ( or ) with _. * @param str String to process. * @return Pointer to the processed string */ char * Utility::blankToUnderscore(char *str) { int i, p; p = strlen(str) - 1; for (i = 0; i <= p; i++) if ((str[i] == ' ') || (str[i] == ';') || (str[i] == ',') || (str[i] == '(') || (str[i] == ')') || (str[i] == ':')) { str[i] = '_'; } return str; } /** * Replace blanks in a string with underscores. Also replaces , ; : ( or ) with _. * @param str String to process. * @return Pointer to the processed string */ string Utility::blankToUnderscore(string str) { int i, p; p = str.size() - 1; for (i = 0; i <= p; i++) if ((str[i] == ' ') || (str[i] == ';') || (str[i] == ',') || (str[i] == '(') || (str[i] == ')') || (str[i] == ':')) { str[i] = '_'; } return str; } /** * * @param instr * @return */ char Utility::getChoice(string instr) { cout << instr << ": "; cout.flush(); char choice; cin.get(choice); // We only want one character, so we ignore the rest. if(choice != '\n') { cin.ignore(150, '\n'); } cin.clear(); if(isalpha(choice) || isNumeric(choice)) { return choice; } else if(choice == '\n') { return '\n'; } else { return ' '; } } bool Utility::isNumeric(char ch) { if(ch >= '0' && ch <= '9') { return true; } return false; } /** * * @param instr * @param outstr */ void Utility::getStr(string instr, string& outstr) { cout << instr << ": "; cout.flush(); string temp; getline(cin, temp, '\n'); outstr = temp; cin.clear(); } /** * * @param instr * @param minx * @param maxx * @param def * @return */ double Utility::getReal(const char *instr, double minx, double maxx, double def) { int status; float ret; char line[MAXLINE]; while (true) { fprintf(stdout, "%s (%.1f-%.1f) [%.1f]: ", instr, minx, maxx, def); //gets(line); fgets(line, MAXLINE, stdin); status = sscanf(line, "%f", &ret); if (status == EOF) { return def; } if (ret > maxx) { fprintf(stderr, "ERROR: Max. value=%.1f\n\n", maxx); continue; } if (ret < minx) { fprintf(stderr, "ERROR: Min. value=%.1f\n\n", minx); continue; } break; } return (double)ret; } /** * * @param instr * @param minx * @param maxx * @param def * @return */ int Utility::getInt(const char *instr, int minx, int maxx, int def) { int ret, status; char line[MAXLINE]; while (true) { fprintf(stdout, "%s (%d..%d) [%d]: ", instr, minx, maxx, def); //gets(line); fgets(line, MAXLINE, stdin); status = sscanf(line, "%d", &ret); if (status == EOF) { return def; } if (ret > maxx) { fprintf(stderr, "ERROR: Max. value=%d\n\n", maxx); continue; } if (ret < minx) { fprintf(stderr, "ERROR: Min. value=%d\n\n", minx); continue; } break; } return ret; } /** * * @param line * @param code * @return */ bool Utility::lineType(char *line, const char *code) { // AW: introduced sanity check int n; if (strlen(line) 10) return false; else return true; } /** * * @param str * @param path */ void Utility::getPath(string str, string *path) { int i; string _temp; _temp = str; for (i = _temp.length() - 1; i > - 1; --i) { if (str[i] == DIRDELIM) { i = - 1; break; } if (str[i] == '.') { break; } } if (i < 0) { _temp += "."; } else { _temp = _temp.substr(0, i + 1); } *path = _temp; } /** * * @param title * @param prompt * @return * * */ char Utility::promptForYesNo(char *title, const char *prompt) { cout << "\n" << title << "\n"; string promptMessage = string(prompt) + "(y/n) ? [y]"; string answer; getStr(promptMessage, answer); if(!answer.empty()) { if ((answer[0] != 'n') && (answer[0] != 'N')) { return ('y'); } } return ('n'); } /** * * @param title * @param prompt * @return * */ char Utility::promptForYesNo(const char *title, const char *prompt) { cout << "\n" << title << "\n"; string promptMessage = string(prompt) + "(y/n) ? [y]"; string answer; getStr(promptMessage, answer); if(!answer.empty()) { if ((answer[0] != 'n') && (answer[0] != 'N')) { return ('y'); } } return ('n'); } /** * * @param msg */ void Utility::error( char *msg,...) { va_list ap; va_start(ap, msg); fprintf(stderr, "\n\nERROR: "); vfprintf(stderr, msg, ap); fprintf(stderr, "\n\n"); va_end(ap); } /** * * @param msg */ void Utility::warning( char *msg,...) { va_list ap; va_start(ap, msg); fprintf(stderr, "\n\nWARNING: "); vfprintf(stderr, msg, ap); fprintf(stderr, "\n\n"); va_end(ap); } /** * * @param msg */ void Utility::error( const char *msg,...) { va_list ap; va_start(ap, msg); fprintf(stderr, "\n\nERROR: "); vfprintf(stderr, msg, ap); fprintf(stderr, "\n\n"); va_end(ap); } /** * * @param msg */ void Utility::warning( const char *msg,...) { va_list ap; va_start(ap, msg); fprintf(stderr, "\n\nWARNING: "); vfprintf(stderr, msg, ap); fprintf(stderr, "\n\n"); va_end(ap); } /** * * @param msg */ void Utility::info( char *msg,...) { va_list ap; va_start(ap, msg); if(! quiet) { fprintf(stdout, "\n"); vfprintf(stdout, msg, ap); va_end(ap); } } /** * * @param msg */ void Utility::info(const char *msg,...) { va_list ap; if(! quiet) { va_start(ap, msg); fprintf(stdout, "\n"); vfprintf(stdout, msg, ap); va_end(ap); } } /** * */ void Utility::myname( char *myname) { strcpy(myname, "clustalw\0"); } /** * Change: * Mark 25-1-2007. I made this change to get around the problem of having to keep track * of output indexes in the alignment stage. This function returns the next unique id. */ unsigned long Utility::getUniqueSequenceIdentifier() { static unsigned long nextSequenceIdentifier = MinIdentifier; return nextSequenceIdentifier++; } void Utility::setInfoLabelPtr(QLabel* ptrToLabelObj) { // Dont do anything. This is here to allow the function to be added to QTUtility. // Polymorphism wont work with different functions in the classes. } double Utility::average(std::vector& v) { double tmp = 0.0; std::vector::iterator i; if (v.size() == 0) return 0.0; for (i=v.begin(); i != v.end(); i++) tmp += *i; return (tmp / v.size()); } double Utility::stdDev(std::vector& v) { std::vector::iterator i; double tmp = 0.0; double avg = average(v); if (v.size() == 0) return 0.0; for(i=v.begin(); i != v.end(); ++i) tmp += (*i - avg) * (*i - avg); return sqrt(tmp / v.size()); } double Utility::median(std::vector v) { // From Moo & Koenig, "Accelerated C++: typedef vector::size_type vec_sz; vec_sz size = v.size(); if (v.size() == 0) return 0.0; std::sort(v.begin(), v.end()); vec_sz mid = size/2; return size % 2 == 0 ? (v[mid] + v[mid-1]) / 2 : v[mid]; } } clustalw-2.1/src/general/DebugLog.cpp0000644000175000017500000000310411442167171014535 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "DebugLog.h" #include #include namespace clustalw { DebugLog::DebugLog(std::string _logFileName) : logFileName(_logFileName), logFile(0), numScores(0), sumSoFar(0.0), averageScore(0.0), minScore(0.0), maxScore(0.0) { logFile = new std::ofstream(); logFile->open(logFileName.c_str(), ios::out); if(logFile->is_open()) { std::cout << "Logging debug info to file: " << logFileName << std::endl; } else { std::cerr << "Could not open log file.\n"; } } DebugLog::~DebugLog() { // Release the file! logFile->close(); delete logFile; } void DebugLog::logMsg(std::string msg) { if(logFile->is_open()) { (*logFile) << msg << "\n"; } } void DebugLog::logScore(float x) { if(x < minScore) { minScore = x; } if(x > maxScore) { maxScore = x; } sumSoFar += x; numScores++; } void DebugLog::printScoreInfo() { if(numScores > 0) { averageScore = sumSoFar / static_cast(numScores); ostringstream outs; outs << "SCORE INFO--------------------------------------------------->" << " The score was calculated " << numScores << " times. The average = " << averageScore << "\n" << "The max score=" << maxScore << " The min score=" << minScore << "\n"; logMsg(outs.str()); } } } clustalw-2.1/src/general/Stats.h0000644000175000017500000000565211442167171013622 00000000000000/** * Author: Andreas Wilm * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. * */ #ifndef STATS_H #define STATS_H namespace clustalw { using namespace std; /** Log simple statistics about input and output * * @section LICENSE * FIXME: please add license text * * @section DESCRIPTION * The hashing functions have to be enabled at compile/configure time * otherwise they will not be used. * * */ class Stats { public: /* FUNCTIONS */ /** constructor */ Stats(); /** destructor */ ~Stats(); /** set the name of the file where stats are logged to * @param f filename */ void setStatsFile(string f) {logfilename=f;}; /** * return name of used stats file * @return file name */ string getStatsFile() {return logfilename;}; /** enable stats logging */ void setEnabled(bool b) {enabled=b;}; /** check if stats logging is enabled * @return true if enabled, false otherwise */ bool isEnabled() {return enabled;}; /** log the command line arguments * @param argc number arguments * @param argv argument array */ void logCmdLine(int argc, char **argv); /** log statistics about sequence input * @param alnObj: input "alignment" (confusing isn't it?) */ void logInputSeqStats(Alignment *alnObj); /** log statistics about sequence input * @param alnObj: input "alignment" (confusing isn't it?) */ void logAlignedSeqStats(Alignment *alnObj); /* ATTRIBUTES */ private: /* FUNCTIONS */ /** Compute pairwise identity of two sequences * * Adopted from Sean Eddy'ssquid:aligneval.c * He defines pairwise identity as fraction: * idents / min(len1, len2) * * Function is case sensitive! * * @param alnObj alignment object * @param s1 index of first sequence * @param s2 index of first sequence * @return pairwise identity as float */ float pairwiseIdentity(Alignment *alnObj, int s1, int s2); #ifdef HAVE_MHASH_H /** compute md5 hash from string * @param thread string to hash * @return hash string, or NULL on failure */ char * Md5Hash(const char *thread); /** compute md5 hash for a sequence * @param alnObj alignment object * @param s index of sequence * @return md5 hash string */ string Md5ForSeq(Alignment *alnObj, int s); /** compute md5 hash for all sequences * sorts and concatenates all sequences beforehand * thus sequence order doesn't matter * * @param alnObj alignment object * @param s index of sequence * @return md5 hash string */ string ConcatInputHash(Alignment *alnObj); #endif /* ATTRIBUTES */ /** the filename used for logging statistics */ string logfilename; /** logging of statistics enabled */ bool enabled; }; } #endif clustalw-2.1/src/general/userparams.h0000644000175000017500000000041211442167171014673 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef USERPARAMS_H #define USERPARAMS_H #include "UserParameters.h" namespace clustalw { // MARK Dec 12 2005 extern UserParameters *userParameters; } #endif clustalw-2.1/src/general/UserParameters.h0000644000175000017500000004230711446137133015463 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Mark Larkin 9 Dec 2005. * Note that most of the variables in this class are from param.h. * * Change log: * Jan 18th 2006: Changed all of the c style strings into c++ string objects! * Mark 30-1-2007: Added useLEScoringFunction and access functions. * 31-01-07,Nigel Brown(EMBL): Revision string now obtained from clustalw * specific versionw.h and updated from 1.83 to 2.1. */ #ifndef USERPARAMETERS_H #define USERPARAMETERS_H #include #include #include "utils.h" #include "general.h" #include "clustalw.h" namespace clustalw { class UserParameters { public: /* Functions */ UserParameters(bool log = false); void setParamsToDefault(); void createParameterOutput(); int resIndex(string t,char c); void setDNAMultiGap(); void setProtMultiGap(); void setDNAParams(); void setProtParams(); void setPWProteinParam(); void setPWDNAParam(); void setPWParamToProtein(); void setPWParamToDNA(); string getRevisionLevel(); void setRevisionLevel(string value); bool getInteractive(){return interactive;}; void setInteractive(bool value); bool getGui(){return gui;}; void setGui(bool value); float getGapOpen(){return gapOpen;}; void setGapOpen(float value); float getGapExtend(){return gapExtend;}; void setGapExtend(float value); float getPWGapOpen(){return PWGapOpen;}; void setPWGapOpen(float value); float getPWGapExtend(){return PWGapExtend;}; void setPWGapExtend(float value); float getAAGapOpen(){return AAGapOpen;} void setAAGapOpen(float gap){AAGapOpen = gap;} float getAAGapExtend(){return AAGapExtend;} void setAAGapExtend(float gap){AAGapExtend = gap;} float getAAPWGapOpen(){return AAPWGapOpen;} void setAAPWGapOpen(float gap){AAPWGapOpen = gap;} float getAAPWGapExtend(){return AAPWGapExtend;} void setAAPWGapExtend(float gap){AAPWGapExtend = gap;} int getMaxAA(){return maxAA;}; void setMaxAA(int value); int getGapPos1(){return gapPos1;}; void setGapPos1(int value); int getGapPos2(){return gapPos2;}; void setGapPos2(int value); int getProfileNum(){return profileNum;}; void setProfileNum(int value); bool getMenuFlag(){return menuFlag;}; void setMenuFlag(bool value); bool getDNAFlag(){return DNAFlag;}; void setDNAFlag(bool value); bool getDistanceTree(){return distanceTree;}; void setDistanceTree(bool value); string getSeqName(){return seqName;}; void setSeqName(string value); float getDNAGapOpen(){return DNAGapOpen;}; void setDNAGapOpen(float value); float getDNAGapExtend(){return DNAGapExtend;}; void setDNAGapExtend(float value); float getProteinGapOpen(){return AAGapOpen;}; void setProteinGapOpen(float value); float getProteinGapExtend(){return AAGapExtend;}; void setProteinGapExtend(float value); int getGapDist(){return gapDist;}; void setGapDist(int value); int getOutputOrder(){return outputOrder;}; void setOutputOrder(int value); void toggleOutputOrder(); int getDivergenceCutoff(){return divergenceCutoff;}; void setDivergenceCutoff(int value); string getHydResidues(){return hydResidues;}; void setHydResidues(string value); bool getNoWeights(){return noWeights;}; void setNoWeights(bool value); bool getUseNegMatrix(){return negMatrix;}; void setUseNegMatrix(bool value); void toggleUseNegMatrix(); bool getNoHydPenalties(){return noHydPenalties;}; void setNoHydPenalties(bool value); void toggleNoHydPenalties(); bool getNoVarPenalties(){return noVarPenalties;}; void setNoVarPenalties(bool value); bool getNoPrefPenalties(){return noPrefPenalties;}; void setNoPrefPenalties(bool value); void toggleNoPrefPenalties(); bool getUseEndGaps(){return useEndGaps;}; void setUseEndGaps(bool value); void toggleUseEndGaps(); bool getEndGapPenalties(){return endGapPenalties;}; void setEndGapPenalties(bool value); bool getResetAlignmentsNew(){return resetAlignmentsNew;}; void setResetAlignmentsNew(bool value); bool getResetAlignmentsAll(){return resetAlignmentsAll;}; void toggleResetAlignmentsNew(); void setResetAlignmentsAll(bool value); int getOutputStructPenalties(){return outputStructPenalties;}; void setOutputStructPenalties(int value); int getStructPenalties1(){return structPenalties1;}; void setStructPenalties1(int value); int getStructPenalties2(){return structPenalties2;}; void setStructPenalties2(int value); bool getUseSS1(){return useSS1;}; void setUseSS1(bool value); void toggleUseSS1(); bool getUseSS2(){return useSS2;}; void setUseSS2(bool value); void toggleUseSS2(); int getHelixPenalty(){return helixPenalty;}; void setHelixPenalty(int value); int getStrandPenalty(){return strandPenalty;}; void setStrandPenalty(int value); int getLoopPenalty(){return loopPenalty;}; void setLoopPenalty(int value); int getHelixEndMinus(){return helixEndMinus;}; void setHelixEndMinus(int value); int getHelixEndPlus(){return helixEndPlus;}; void setHelixEndPlus(int value); int getStrandEndMinus(){return strandEndMinus;}; void setStrandEndMinus(int value); int getStrandEndPlus(){return strandEndPlus;}; void setStrandEndPlus(int value); int getHelixEndPenalty(){return helixEndPenalty;}; void setHelixEndPenalty(int value); int getStrandEndPenalty(){return strandEndPenalty;}; void setStrandEndPenalty(int value); bool getUseAmbiguities(){return useAmbiguities;}; void setUseAmbiguities(bool value); float getDNAPWGapOpenPenalty(){return DNAPWGapOpen;}; void setDNAPWGapOpenPenalty(float value); float getDNAPWGapExtendPenalty(){return DNAPWGapExtend;}; void setDNAPWGapExtendPenalty(float value); float getProteinPWGapOpenPenalty(){return AAPWGapOpen;}; void setProteinPWGapOpenPenalty(float value); float getProteinPWGapExtendPenalty(){return AAPWGapExtend;}; void setProteinPWGapExtendPenalty(float value); bool getQuickPairAlign(){return quickPairAlign;}; void setQuickPairAlign(bool value); void toggleQuickPairAlign(); // Mark new!!! float getTransitionWeight(){return transitionWeight;}; void setTransitionWeight(float value); int getDNAKtup(){return DNAKtup;}; void setDNAKtup(int value); int getDNAWindowGap(){return DNAWindowGap;}; void setDNAWindowGap(int value); int getDNASignif(){return DNASignif;}; void setDNASignif(int value); int getDNAWindow(){return DNAWindow;}; void setDNAWindow(int value); int getAAKtup(){return AAKtup;}; void setAAKtup(int value); int getAAWindowGap(){return AAWindowGap;}; void setAAWindowGap(int value); int getAASignif(){return AASignif;}; void setAASignif(int value); int getAAWindow(){return AAWindow;}; void setAAWindow(int value); bool getPercent(){return percent;}; void setPercent(bool value); bool getTossGaps(){return tossgaps;}; void setTossGaps(bool value); void toggleTossGaps(); bool getKimura(){return kimura;}; void setKimura(bool value); void toggleKimura(); int getBootNumTrials(){return bootNumTrials;}; void setBootNumTrials(int value); unsigned int getBootRanSeed(){return bootRanSeed;}; void setBootRanSeed(unsigned int value); int getDebug(){return debug;}; void setDebug(int value); bool getExplicitDNAFlag(){return explicitDNAFlag;}; void setExplicitDNAFlag(bool value); bool getLowercase(){return lowercase;}; void setLowercase(bool value); void toggleLowercase(); bool getClSeqNumbers(){return clSeqNumbers;}; void setClSeqNumbers(bool value); void toggleClSeqNumbers(); bool getSeqRange(){return seqRange;}; void setSeqRange(bool value); void toggleSeqRange(); bool getOutputClustal(){return outputClustal;}; void setOutputClustal(bool value); void toggleOutputClustal(); bool getOutputGCG(){return outputGcg;}; void setOutputGCG(bool value); void toggleOutputGCG(); bool getOutputPhylip(){return outputPhylip;}; void setOutputPhylip(bool value); void toggleOutputPhylip(); bool getOutputNbrf(){return outputNbrf;}; void setOutputNbrf(bool value); void toggleOutputNbrf(); bool getOutputGde(){return outputGde;}; void setOutputGde(bool value); void toggleOutputGde(); bool getOutputNexus(){return outputNexus;}; void setOutputNexus(bool value); void toggleOutputNexus(); bool getOutputFasta(){return outputFasta;}; void setOutputFasta(bool value); void toggleOutputFasta(); bool getShowAlign(){return showAlign;}; void setShowAlign(bool value); void toggleShowAlign(); bool getSaveParameters(){return saveParameters;}; void setSaveParameters(bool value); void toggleSaveParameters(); bool getOutputTreeClustal(){return outputTreeClustal;}; void setOutputTreeClustal(bool value); void toggleOutputTreeClustal(); bool getOutputTreePhylip(){return outputTreePhylip;}; void setOutputTreePhylip(bool value); void toggleOutputTreePhylip(); bool getOutputTreeDistances(){return outputTreeDistances;}; void setOutputTreeDistances(bool value); void toggleOutputTreeDistances(); bool getOutputTreeNexus(){return outputTreeNexus;}; void setOutputTreeNexus(bool value); void toggleOutputTreeNexus(); bool getOutputPim(){return outputPim;}; void setOutputPim(bool value); int getBootstrapFormat(){return bootstrapFormat;}; void setBootstrapFormat(int value); void toggleBootstrapFormat(); string getProfile1Name(){return profile1Name;}; void setProfile1Name(string value); string getProfile2Name(){return profile2Name;}; void setProfile2Name(string value); bool getEmpty(){return empty;}; void setEmpty(bool value); bool getProfile1Empty(){return profile1Empty;}; void setProfile1Empty(bool value); bool getProfile2Empty(){return profile2Empty;}; void setProfile2Empty(bool value); string getOutfileName(){return outfileName;}; void setOutfileName(string value); bool getUseTreeFile(){return useTreeFile;}; void setUseTreeFile(bool value); bool getNewTreeFile(){return newTreeFile;}; void setNewTreeFile(bool value); bool getUseTree1File(){return useTree1File;}; void setUseTree1File(bool value); bool getUseTree2File(){return useTree2File;}; void setUseTree2File(bool value); bool getNewTree1File(){return newTree1File;}; void setNewTree1File(bool value); bool getNewTree2File(){return newTree2File;}; void setNewTree2File(bool value); string getAminoAcidCodes(){return aminoAcidCodes;}; char getAminoAcidCode(int i){return aminoAcidCodes[i];}; void setAminoAcidCodes(string value); int getKtup(){return ktup;}; void setKtup(int value); int getWindow(){return window;}; void setWindow(int value); int getWindowGap(){return windowGap;}; void setWindowGap(int value); int getSignif(){return signif;}; void setSignif(int value); int getRangeFrom(){return rangeFrom;}; int getRangeTo(){return rangeTo;}; void setRangeFrom(int from); void setRangeTo(int to); bool getRangeFromToSet(){return rangeFromToSet;}; void setRangeFromToSet(bool set){rangeFromToSet = set;}; int getQTScorePlotScale(); void setQTScorePlotScale(int score); int getQTResExceptionCutOff(); void setQTResExceptionCutOff(int cutOff); bool getQTseqWeightCalculated(); void setQTseqWeightCalculated(bool calculated); int getQTminLenLowScoreSegment(); void setQTminLenLowScoreSegment(int minLen); int getQTlowScoreDNAMarkingScale(); void setQTlowScoreDNAMarkingScale(int dnaScale); // Access functions for the iteration variables. void setNumIterations(int num){numIterations = num;} int getNumIterations(){return numIterations;} void setDoRemoveFirstIteration(int doIter){doRemoveFirstIteration = doIter;} int getDoRemoveFirstIteration(){return doRemoveFirstIteration;} bool IterationIsEnabled(); void setClusterAlgorithm(int clust){clusterAlgorithm = clust;} int getClusterAlgorithm(){return clusterAlgorithm;} void setDisplayInfo(bool display){displayInfo = display;} bool getDisplayInfo(){return displayInfo;} bool getHelpFlag() {return helpFlag;} void setHelpFlag(bool b) {helpFlag = b;} bool getFullHelpFlag() {return fullHelpFlag;} void setFullHelpFlag(bool b) {fullHelpFlag = b;} void setMaxAllowedSeqLength(int num){maxAllowedSeqLength = num;} int getMaxAllowedSeqLength(){return maxAllowedSeqLength;} bool ResetGapsIsEnabled() {return (resetAlignmentsNew || resetAlignmentsAll);}; /* Attributes */ private: /* Functions */ /* Attributes */ string revisionLevel; bool interactive; bool gui; float gapOpen; float gapExtend; float PWGapOpen; float PWGapExtend; int maxAA; int gapPos1; int gapPos2; int profileNum; bool menuFlag; bool DNAFlag; bool distanceTree; string seqName; float DNAGapOpen; float DNAGapExtend; float AAGapOpen; float AAGapExtend; int gapDist; int outputOrder; int divergenceCutoff; string hydResidues; bool noWeights; bool negMatrix; bool noHydPenalties; bool noVarPenalties; bool noPrefPenalties; bool useEndGaps; bool endGapPenalties; bool resetAlignmentsNew; bool resetAlignmentsAll; int outputStructPenalties; int structPenalties1; int structPenalties2; bool useSS1; bool useSS2; int helixPenalty; int strandPenalty; int loopPenalty; int helixEndMinus; int helixEndPlus; int strandEndMinus; int strandEndPlus; int helixEndPenalty; int strandEndPenalty; bool useAmbiguities; float DNAPWGapOpen; float DNAPWGapExtend; float AAPWGapOpen; float AAPWGapExtend; bool quickPairAlign; float transitionWeight; int DNAKtup; int DNAWindowGap; int DNASignif; int DNAWindow; int AAKtup; int AAWindowGap; int AASignif; int AAWindow; bool percent; bool tossgaps; bool kimura; int bootNumTrials; unsigned int bootRanSeed; int debug; bool explicitDNAFlag; bool lowercase; /* Flag for GDE output - set on comm. line*/ bool clSeqNumbers; bool seqRange; bool outputClustal; bool outputGcg; bool outputPhylip; bool outputNbrf; bool outputGde; bool outputNexus; bool outputFasta; bool showAlign; bool saveParameters; bool outputTreeClustal; bool outputTreePhylip; bool outputTreeDistances; bool outputTreeNexus; bool outputPim; int bootstrapFormat; string profile1Name; string profile2Name; bool empty; bool profile1Empty; bool profile2Empty; string outfileName; //int profile1NumSeqs; MARK CHANGE Jan 10 bool useTreeFile; bool newTreeFile; bool useTree1File; bool useTree2File; bool newTree1File; bool newTree2File; string aminoAcidCodes; int ktup; int window; int windowGap; int signif; int rangeFrom; int rangeTo; bool rangeFromToSet; int QTscorePlotScale; int QTresExceptionCutOff; bool QTseqWeightCalculated; int QTminLenLowScoreSegment; int QTlowScoreDNAMarkingScale; // New variables for iteration int numIterations; int doRemoveFirstIteration; int clusterAlgorithm; bool displayInfo; bool helpFlag; bool fullHelpFlag; bool quiet; int maxAllowedSeqLength; }; } #endif clustalw-2.1/src/general/ClustalWResources.cpp0000644000175000017500000000640611442167171016506 00000000000000/** * Implements a singleton that maintains program resources. * The single instance is (re)instantiated on demand like: * Resources *res = Resources::Instance(); * * 24-05-07,Nigel Brown(EMBL): created. * 3-7-07, Mark Larkin, modified this class for clustalw */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ClustalWResources.h" #include #include "clustalw.h" #include using namespace std; namespace clustalw { //environment variables static const char *CLUW_INSTALL_DIR = "CLUW_INSTALL_DIR"; //return the sole instance ClustalWResources *ClustalWResources::Instance() { static ClustalWResources instance; return &instance; } ClustalWResources::ClustalWResources() { //defaultPath defaultPath = "."; //executablePath executablePath = "."; //installPath installPath = "."; char *env; if ((env = getenv(CLUW_INSTALL_DIR)) != 0) { installPath = string(env); } homePath = ""; } void ClustalWResources::setPathToExecutable(string path) { executablePath = dirname(path); } string ClustalWResources::dirname(string path) { string tempString; int size = path.size(); tempString = path; for (int i = size - 1; i > 0; i--) { if (tempString[i] == DIRDELIM) // Mark, no standard function in c++ { tempString.erase(i); break; } } return tempString; } void ClustalWResources::dump() { printf("%s => %s [%s]\n%s => %s\n%s => %s\n", "installPath", installPath.c_str(), CLUW_INSTALL_DIR, "executablePath", executablePath.c_str(), "homePath", homePath.c_str() ); } string ClustalWResources::findFile(const char *file, const ClustalWResourcePathType where) const { return findFile(string(file), where); } string ClustalWResources::findFile(const string file, const ClustalWResourcePathType where) const { const string *path; ifstream ifs; switch (where) { case InstallPath: path = &installPath; break; case ExecutablePath: path = &executablePath; break; case HomePath: path = &homePath; break; default: path = &defaultPath; break; } char delim[1]; delim[0] = DIRDELIM; delim[1] = 0; string fileName = *path + string(delim) + file; ifs.open(fileName.c_str(), ifstream::in); if (ifs.fail()) { return string(); } if (ifs.is_open() && ifs.good()) { ifs.close(); return fileName; } return string(); //not found/readable } // Search for a (string) file in a succession of likely locations and // return the full path as (string). // string ClustalWResources::searchPathsForFile(const string fileName) const { string file; while (1) { file = findFile(fileName, InstallPath); if (file != "") break; file = findFile(fileName, ExecutablePath); if (file != "") break; file = findFile(fileName, HomePath); if (file != "") break; file = findFile(fileName); if (file != "") break; file = fileName; // give up break; } return file; } } clustalw-2.1/src/general/Stats.cpp0000644000175000017500000002302011442167171014142 00000000000000/** * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "../alignment/Alignment.h" #ifdef HAVE_MHASH_H #include "mhash.h" #endif #include "Stats.h" using namespace std; namespace clustalw { Stats::Stats() { enabled = false; } Stats::~Stats() { } /* adopted from Sean Eddy'ssquid:aligneval.c */ /* Function: PairwiseIdentity() * * Purpose: Calculate the pairwise fractional identity between * two aligned sequences s1 and s2. This is simply * (idents / MIN(len1, len2)). * * Note how many ways there are to calculate pairwise identity, * because of the variety of choices for the denominator: * idents/(idents+mismat) has the disadvantage that artifactual * gappy alignments would have high "identities". * idents/(AVG|MAX)(len1,len2) both have the disadvantage that * alignments of fragments to longer sequences would have * artifactually low "identities". * * Case sensitive; also, watch out in nucleic acid alignments; * U/T RNA/DNA alignments will be counted as mismatches! */ /* float PairwiseIdentity(char @s1, char @s2) { int idents; /@ total identical positions @/ int len1, len2; /@ lengths of seqs @/ int x; /@ position in aligned seqs @/ idents = len1 = len2 = 0; for (x = 0; s1[x] != '\0' && s2[x] != '\0'; x++) { if (!isgap(s1[x])) { len1++; if (s1[x] == s2[x]) idents++; } if (!isgap(s2[x])) len2++; } if (len2 < len1) len1 = len2; return (len1 == 0 ? 0.0 : (float) idents / (float) len1); } */ /* s1/s2 are unit-offset as usual * */ float Stats::pairwiseIdentity(Alignment *alnObj, int s1, int s2) { int idents; /* total identical positions */ int len1, len2; /* real lengths of seqs */ int x; /* position in aligned seqs */ const vector* seq1 = alnObj->getSequence(s1); const vector* seq2 = alnObj->getSequence(s2); idents = len1 = len2 = 0; // cerr << "comparing " << alnObj->getName(s1).c_str() << ":" << alnObj->getName(s2).c_str() << " " << s1 << ":" << s2 << "\n"; // sequence length should be identical, but be paranoid for (x = 1; x<=alnObj->getSeqLength(s1) && x<=alnObj->getSeqLength(s2); x++) { if (! alnObj->isGap(s1, x)) { len1++; //cerr << " pos " << x << ": " << (*seq1)[x] << ":" << (*seq2)[x] << "\n"; if ((*seq1)[x] == (*seq2)[x]) idents++; } //DEBUG //else { //cerr << " gap at pos " << x << " (" << s1 << ")\n"; //} if (! alnObj->isGap(s2, x)) len2++; //DEBUG //else // cerr << " gap at pos " << x << " (" << s2 << ")\n"; } if (len2 < len1) len1 = len2; return (len1 == 0 ? 0.0 : (float) idents / (float) len1); } #ifdef HAVE_MHASH_H string Stats::ConcatInputHash(Alignment *alnObj) { vector rawSeqArray; string ret; char *hash; // collect all sequences and sort const clustalw::SeqArray* seqArray = alnObj->getSeqArray(); for(int s = 1; s <= alnObj->getNumSeqs(); s++) { string seq; for(int r = 1; r <= alnObj->getSeqLength(s); r++) { int val = (*seqArray)[s][r]; seq.append(1, clustalw::userParameters->getAminoAcidCode(val)); } rawSeqArray.push_back(seq); } std::sort(rawSeqArray.begin(), rawSeqArray.end()); // concatenate sorted seqs string concatSeq; std::vector::iterator iter; for(iter=rawSeqArray.begin(); iter != rawSeqArray.end(); ++iter) concatSeq.append(*iter); // build hash and return hash = Md5Hash(concatSeq.c_str()); if (hash==NULL) { ret="HASHING_FAILURE"; } else { for (int i=0; igetSeqArray(); char *hash; string ret; for(int l = 1; l <= alnObj->getSeqLength(s); l++) { int val = (*seqArray)[s][l]; // continue if gap if((val < 0) || (val > userParameters->getMaxAA())) continue; seq.append(1, clustalw::userParameters->getAminoAcidCode(val)); } std::transform(seq.begin(), seq.end(), seq.begin(), ::toupper); hash = Md5Hash(seq.c_str()); if (hash==NULL) { ret = "HASHING_FAILURE"; } else { ret = hash; } return ret; } /* create md5 hash from input string * returns NULL on failure * user must free returned string */ char * Stats::Md5Hash(const char *thread) { MHASH td; char *tmpcstr; int i; unsigned char *hash; char *rethash; td = mhash_init(MHASH_MD5); if (td == MHASH_FAILED) return NULL; if (thread==NULL) return NULL; mhash(td, thread, strlen(thread)); //mhash_deinit(td, hash); hash = (unsigned char*) mhash_end(td); rethash = (char*) calloc(mhash_get_block_size(MHASH_MD5)*2+1, sizeof(char)); for (i = 0; i < mhash_get_block_size(MHASH_MD5); i++) { sprintf(&rethash[i*2], "%.2x", hash[i]); } return rethash; } #endif // HAVE_MHASH_H void Stats::logCmdLine(int argc, char **argv) { FILE *fp = fopen(logfilename.c_str(), "a"); if (fp == NULL) { cerr << "couldn't open file " << logfilename << " for logging of stats\n"; return; } if (argc > 1) { for (int i=1; i lengths; time_t t = time(NULL); tm s = *localtime(&t); int shortest; string hash; FILE *fp = fopen(logfilename.c_str(), "a"); if (fp == NULL) { cerr << "couldn't open file " << logfilename << " for logging of stats\n"; return; } fprintf(fp, "logging job: %s on %s", userParameters->getSeqName().c_str(), asctime(&s)); fprintf(fp, "clustal version: %s\n", userParameters->getRevisionLevel().c_str()); fprintf(fp, "seq type: "); if (userParameters->getDNAFlag()) fprintf(fp, "DNA"); else fprintf(fp, "protein"); fprintf(fp, "\n"); fprintf(fp, "numseqs: %d\n", alnObj->getNumSeqs()); // create a vector of seq lengths for later // and get shortest seq at the same time shortest=alnObj->getLengthLongestSequence(); for (i = 1; i <= alnObj->getNumSeqs(); i++) { int l = alnObj->getSeqLength(i); lengths.push_back(l); if (lgetLengthLongestSequence()); fprintf(fp, "seqlen shortest: %d\n", shortest); fprintf(fp, "seqlen avg: %.2f\n", utilityObject->average(lengths)); fprintf(fp, "seqlen std-dev: %.2f\n", utilityObject->stdDev(lengths)); fprintf(fp, "seqlen median: %.2f\n", utilityObject->median(lengths)); #ifdef HAVE_MHASH_H //hash = concatInputHash(alnObj); //fprintf(fp, "seq hash: %s\n", hash.c_str()); for (int s = 1; s <= alnObj->getNumSeqs(); s++) { string md5 = Md5ForSeq(alnObj, s); fprintf(fp, "md5 for seq %d: %s\n", s, md5.c_str()); } #else fprintf(fp, "md5: disabled\n"); #endif fclose(fp); } /* log some statistics for aligned sequences, i.e. alnObj should hold * the already aligned sequences * */ void Stats::logAlignedSeqStats(Alignment *alnObj) { FILE *fp = fopen(logfilename.c_str(), "a"); if (fp == NULL) { cerr << "couldn't open file " << logfilename << " for logging of stats\n"; return; } // alignment length is the length of any sequence fprintf(fp, "aln len: %d\n", alnObj->getSeqLength(1)); std::vector pwIdents; double lowestPwId = 1.0; double hightestPwId = 0.0; // create vector of pairwise identities for(int s1 = 1; s1 <= alnObj->getNumSeqs(); s1++) { for(int s2 = s1+1; s2 <= alnObj->getNumSeqs(); s2++) { double thisPwId = pairwiseIdentity(alnObj, s1, s2); pwIdents.push_back(thisPwId); if (thisPwId>hightestPwId) hightestPwId=thisPwId; if (thisPwIdgetName(s1).c_str(), alnObj->getName(s2).c_str(), s1, s2, PairwiseIdentity(alnObj, s1, s2)); } } fprintf(fp, "aln pw-id highest: %.2f\n", hightestPwId); fprintf(fp, "aln pw-id lowest: %.2f\n", lowestPwId); fprintf(fp, "aln pw-id avg: %.2f\n", utilityObject->average(pwIdents)); fprintf(fp, "aln pw-id std-dev: %.2f\n", utilityObject->stdDev(pwIdents)); fprintf(fp, "aln pw-id median: %.2f\n", utilityObject->median(pwIdents)); fclose(fp); } } clustalw-2.1/src/general/utils.h0000644000175000017500000000036011442167171013653 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef UTILS_H #define UTILS_H #include "Utility.h" namespace clustalw { // MARK Dec 12 2005 extern Utility *utilityObject; } #endif clustalw-2.1/src/general/DebugLog.h0000644000175000017500000000175211442167171014211 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This class is used to log messages to a file that is specified when the object * is created. * The file is closed when the object is destroyed. The user simply needs to * create a DebugLog * object, and then call the logMsg function whenever they wish to write something to the * file. */ #ifndef DEBUGLOG_H #define DEBUGLOG_H #include #include namespace clustalw { using namespace std; class DebugLog { public: DebugLog(std::string); ~DebugLog(); void logMsg(std::string); void logScore(float x); void printScoreInfo(); private: /* Attributes */ std::string logFileName; std::ofstream* logFile; int numScores; float sumSoFar; float averageScore; float minScore; float maxScore; /* Functions */ DebugLog(); }; } #endif clustalw-2.1/src/general/VectorOutOfRange.cpp0000644000175000017500000000163311442167171016246 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "VectorOutOfRange.h" #include #include #include namespace clustalw { VectorOutOfRange::~VectorOutOfRange() throw() { // Dont need to do anything } const char* VectorOutOfRange::what() const throw() { std::ostringstream message; message << "\nIn Vector "<< _name << ", vector index " << _index << " exceeds bounds 1-" << _max << "\n"; std::string outputMessage = message.str(); return outputMessage.c_str(); } const char* VectorOutOfRange::what() { std::ostringstream message; message << "\nIn Vector "<< _name << ", vector index " << _index << " exceeds bounds 1-" << _max << "\n"; std::string outputMessage = message.str(); return outputMessage.c_str(); } } clustalw-2.1/src/general/VectorOutOfRange.h0000644000175000017500000000116311442167171015711 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #include #include namespace clustalw { class VectorOutOfRange : public std::exception { public: VectorOutOfRange(std::string vectorName, int index, int max) : _name(vectorName), _index(index), _max(max) {} ~VectorOutOfRange() throw(); int index(){return _index;} int max(){return _max;} const char* what() const throw(); const char* what(); private: std::string _name; int _index; int _max; }; } clustalw-2.1/src/general/clustalw.h0000644000175000017500000001544711442167171014365 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. * * Changes: * * 13-02-07,Nigel Brown(EMBL): Increased maximum sequence identifier * width MAXNAMES from 30 to 150. * 20-12-07, Paul McGettigan: bug #53 change MAXNAMESTODISPLAY back to 10 from 30 */ #ifndef CLUSTALW_H #define CLUSTALW_H /* Mark tidy up Nov 2005 */ /*********************CLUSTALW.H*********************************************/ /****************************************************************************/ /* *** AW NOT NEEDED ANYMORE since 2.0.9 *** done via including config.h(clustalw) or DEFINE(clustalx) * Main header file for ClustalW. Uncomment ONE of the following 4 lines * depending on which compiler you wish to use. */ /* NOT SUPPORTED #define VMS 1 VAX or ALPHA VMS */ /* Think_C for Macintosh */ //#define MAC 1 */ /* Turbo C for PC's */ // #define WINDOWS 1 /* unix */ //#define UNIX 1 // d #define DEBUGFULL 0 const bool DEBUGLOG = false; /***************************************************************************/ /***************************************************************************/ #include "general.h" #include "Array2D.h" #include "SquareMat.h" #include "SymMatrix.h" #include #include using namespace std; namespace clustalw { typedef SymMatrix DistMatrix; typedef std::vector > TreeGroups; struct TreeNames { string phylipName; string clustalName; string distName; string nexusName; string pimName; }; struct AlignmentFileNames { string treeFile; string profile2TreeFile; string clustalFile; string nrbfFile; string gcgFile; string phylipFile; string gdeFile; string nexusFile; string fastaFile; }; struct TreeNode { // phylogenetic tree structure struct TreeNode *left; struct TreeNode *right; struct TreeNode *parent; float dist; int leaf; int order; string name; }; struct PhyloTree { TreeGroups treeDesc; vector leftBranch; vector rightBranch; }; struct SeqInfo { int firstSeq; int lastSeq; int numSeqs; }; struct LowScoreSegParams { int firstSeq; int nSeqs; int lastSeq; int nCols; vector* seqWeight; Array2D* lowScoreRes; bool seqWeightCalculated; }; /* Global constants */ const int extraEndElemNum = 2; const int ENDALN = 127; const int OK = -200; const int CANNOTOPENFILE = -300; const int NOSEQUENCESINFILE = -400; const int OTHERERROR = -500; const int ALLNAMESNOTDIFFERENT = -600; const int MUSTREADINPROFILE1FIRST = -700; const int EMPTYSEQUENCE = -800; const int SEQUENCETOOBIG = -900; const int BADFORMAT = -1000; const int AABLOSUM = 0; const int AAPAM = 1; const int AAGONNET = 2; const int AAIDENTITY = 3; const int AAUSERDEFINED = 4; const int PWAABLOSUM = 0; const int PWAAPAM = 1; const int PWAAGONNET = 2; const int PWAAIDENTITY = 3; const int PWAAUSER = 4; const int DNAIUB = 0; const int DNACLUSTALW = 1; const int DNAUSERDEFINED = 2; const int AAHISTIDENTITY = 0; const int AAHISTGONNETPAM80 = 1; const int AAHISTGONNETPAM120 = 2; const int AAHISTGONNETPAM250 = 3; const int AAHISTGONNETPAM350 = 4; const int AAHISTUSER = 5; const int QTAASEGGONNETPAM80 = 0; const int QTAASEGGONNETPAM120 = 1; const int QTAASEGGONNETPAM250 = 2; const int QTAASEGGONNETPAM350 = 3; const int QTAASEGUSER = 4; const int MAXHYDRESIDUES = 9; // Only allowing 9 hyd residue choices const int Protein = 0; const int DNA = 1; const int Pairwise = 0; const int MultipleAlign = 1; const int OUTSECST = 0; const int OUTGAP = 1; const int OUTBOTH = 2; const int OUTNONE = 3; const int MAXNAMES = 150; /* Max chars read for seq. names */ //nige, was 30 //const int MAXNAMESTODISPLAY = 30; // Used for printout. Mark 18-7-07 //const int MAXNAMESTODISPLAY = 10; // Bug #53. Paul 20-12-07 const int MAXNAMESTODISPLAY = 30; //Paul replicate 1.83 behavour 9-2-08 const int MINNAMESTODISPLAY = 10; //Paul replicate 1.83 behavour 9-2-08 const int MAXTITLES = 60; /* Title length */ const int FILENAMELEN = 256; /* Max. file name length */ const int UNKNOWN = 0; const int EMBLSWISS = 1; const int PIR = 2; const int PEARSON = 3; const int GDE = 4; const int CLUSTAL = 5; /* DES */ const int MSF = 6; /* DES */ const int RSF = 7; /* JULIE */ const int USER = 8; /* DES */ const int PHYLIP = 9; /* DES */ const int NEXUS = 10; /* DES */ const int FASTA = 11; /* Ramu */ const int NONE = 0; const int SECST = 1; const int GMASK = 2; const int PROFILE = 0; const int SEQUENCE = 1; const int BS_NODE_LABELS = 2; const int BS_BRANCH_LABELS = 1; const int PAGE_LEN = 22; /* Number of lines of help sent to screen */ const int PAGEWIDTH = 80; /* maximum characters on output file page */ const int LINELENGTH = 60; /* Output file line length */ const int GCG_LINELENGTH = 50; const int NJ = 1; const int UPGMA = 2; const int ALIGNMENT = 1; const int TREE = 2; const int MinIdentifier = 1; const string VALID_COMMAND_SEP = "-/"; #ifdef OS_MAC const char default_commandsep = '-'; const char DIRDELIM = '/'; const int INT_SCALE_FACTOR = 100; /* Scaling factor to convert float to integer for profile scores */ #elif OS_WINDOWS const char default_commandsep = '/'; const char DIRDELIM = '\\'; const int INT_SCALE_FACTOR = 100; /* Scaling factor to convert float to integer for profile scores */ #elif OS_UNIX const char default_commandsep = '-'; const char DIRDELIM = '/'; const int INT_SCALE_FACTOR = 1000; /* Scaling factor to convert float to integer for profile scores */ #endif const int NUMRES = 32; /* max size of comparison matrix */ const int INPUT = 0; const int ALIGNED = 1; const int LEFT = 1; const int RIGHT = 2; const int NODE = 0; const int LEAF = 1; const int GAPCOL = 32; /* position of gap open penalty in profile */ const int LENCOL = 33; /* position of gap extension penalty in profile */ typedef struct { /* Holds values for the pairwise scales */ float gapOpenScale; float gapExtendScale; int intScale; }PairScaleValues; typedef struct { float scale; float intScale; }PrfScaleValues; typedef struct node { /* phylogenetic tree structure */ struct node *left; struct node *right; struct node *parent; float dist; int leaf; int order; char name[64]; } stree, *treeptr; typedef struct { char title[30]; char string[30]; } MatMenuEntry; typedef struct { int noptions; MatMenuEntry opt[10]; } MatMenu; const int MAXMAT = 10; typedef struct { int llimit; int ulimit; vector* matptr; vector* AAXref; } SeriesMat; /* * UserMatSeries holds the number of matrices in the series and */ typedef struct { int nmat; SeriesMat mat[MAXMAT]; } UserMatrixSeries; } #endif clustalw-2.1/src/general/Array2D.h0000644000175000017500000000534211442167171013764 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef ARRAY2D_H #define ARRAY2D_H #include #include namespace clustalw { using namespace std; template class Array2D { public: Array2D():m_dimRow(0), m_dimCol(0){;} Array2D(int nRow, int nCol) { m_dimRow = nRow; m_dimCol = nCol; for (int i=0; i < nRow; i++) { vector x(nCol); int y = x.size(); m_2DVector.push_back(x); } } int getRowSize() { return m_dimRow; } int getColSize() { return m_dimCol; } void SetAt(int nRow, int nCol, const T& value) { m_2DVector[nRow][nCol] = value; } T GetAt(int nRow, int nCol) { return m_2DVector[nRow][nCol]; } void GrowRow(int newSize) { if (newSize <= (int)m_dimRow) return; m_dimRow = newSize; for(int i = 0 ; i < newSize - (int)m_dimCol; i++) { vector x(m_dimRow); m_2DVector.push_back(x); } } void GrowCol(int newSize) { if(newSize <= (int)m_dimCol) return; m_dimCol = newSize; for (int i=0; i < (int)m_dimRow; i++) m_2DVector[i].resize(newSize); } void ResizeRect(int row, int col) { GrowRow(row); GrowCol(col); } /* This is to get everything initialised to a value */ void GrowRow(int newSize, const T& value) { if (newSize <= m_dimRow) return; m_dimRow = newSize; for(int i = 0 ; i < newSize - m_dimCol; i++) { vector x(m_dimRow, value); m_2DVector.push_back(x); } } void GrowCol(int newSize, const T& value) { if(newSize <= m_dimCol) return; m_dimCol = newSize; for (int i=0; i & operator[](int x) { return m_2DVector[x]; } private: vector< vector > m_2DVector; unsigned int m_dimRow; unsigned int m_dimCol; }; } #endif clustalw-2.1/src/general/SymMatrix.h0000644000175000017500000002005511442167171014453 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * The SymMatrix class is used to store the distance matrix. It stores it in a double * array. * This class throws an out_of_range exception if we try to access an element outside * of the array bounds. It will throw a bad_alloc if we cannot allocate enough memory for * the distance matrix. */ #ifndef SYMMATRIX_H #define SYMMATRIX_H #include #include #include #include #include #include #include namespace clustalw { using namespace std; class SymMatrix { public: SymMatrix() : elements(0), numSeqs(0), subElements(0), firstSeq(0), numSeqsInSub(0){;} SymMatrix(int size) : elements(0), numSeqs(0), subElements(0), firstSeq(0), numSeqsInSub(0) { // Size is the numSeqs + 1 numSeqs = size - 1; sizeElements = ((numSeqs + 1) * (numSeqs + 2)) >> 1; try { elements = new double[sizeElements]; setAllArrayToVal(elements, sizeElements, 0.0); } catch(bad_alloc& e) { cout << "Could not allocate a distance matrix for " << numSeqs << " seqs.\n"; throw e; } } ~SymMatrix() { if(elements) { delete [] elements; } if(subElements) { delete [] subElements; } } inline void SetAt(int nRow, int nCol, const double& value) { index = getIndex(nRow, nCol, numSeqs); elements[index] = value; } inline double GetAt(int nRow, int nCol) { index = getIndex(nRow, nCol, numSeqs); return elements[index]; } inline void ResizeRect(int size, double val = 0.0) { numSeqs = size - 1; sizeElements = ((numSeqs + 1) * (numSeqs + 2)) >> 1; if(elements) { delete [] elements; } try { elements = new double[sizeElements]; setAllArrayToVal(elements, sizeElements, val); } catch(bad_alloc& e) { cout << "Could not allocate a distance matrix for " << numSeqs << " seqs. Need to terminate program.\n"; throw e; } } inline void setAllArrayToVal(double* array, int size, double val) { for(int i = 0; i < size; i++) { array[i] = val; } } inline int getSize() { return numSeqs + 1; } inline void clearArray() { sizeElements = 0; numSeqs = 0; if(elements) { delete [] elements; elements = 0; } numSeqsInSub = 0; sizeSubElements = 0; if(subElements) { delete [] subElements; subElements = 0; } } void printArray() { printArray(elements, sizeElements); } void printSubArray() { printArray(subElements, sizeSubElements); } void printArray(double* array, int size) { int numThisTime = 1; int numSoFar = 0; for(int i = 0; i < size; i++) { numSoFar++; if(numSoFar == numThisTime) { cout << " " << setw(4) << array[i] << "\n"; numSoFar = 0; numThisTime++; } else { cout << " " << setw(4) << array[i]; } } cout << "\n"; } inline int getIndex(const int &i, const int &j, const int &nSeqs) const { if(i == 0 || j == 0) { return 0; } int _i = i - 1, _j = j - 1; if (_i == _j) { if ((_i >= nSeqs) || (_i < 0)) { throw out_of_range("index out of range\n"); } return (_i * (_i + 3)) >> 1; } if (_i > _j) { if ((_i >= nSeqs) || (_j < 0)) { throw out_of_range("index out of range\n"); } return ((_i * (_i + 1)) >> 1) + _j; } if ((_j >= nSeqs) || (_i < 0)) { throw out_of_range("index out of range\n"); } return ((_j * (_j + 1)) >> 1) + _i; } //inline inline double operator() (unsigned row, unsigned col) const { return elements[getIndex(row, col, numSeqs)]; } inline double& operator() (unsigned row, unsigned col) { return elements[getIndex(row, col, numSeqs)]; } inline double* getElements() { return elements; } inline double* getDistMatrix(int fSeq, int nSeqsInSub) { if(fSeq == 1 && numSeqs == nSeqsInSub) { return elements; // We want the whole array. } else { // Calculate the subMatrix and return it!!! try { if(subElements) { delete [] subElements; } sizeSubElements = ((nSeqsInSub + 1) * (nSeqsInSub + 2)) >> 1; numSeqsInSub = nSeqsInSub; subElements = new double[sizeSubElements]; setAllArrayToVal(subElements, sizeSubElements, 0.0); int currIndex = 0; subElements[0] = 0.0; int lSeq = fSeq + numSeqsInSub - 1; // NOTE this is wrong!!!!! Need to fix for(int i = fSeq; i <= lSeq; i++) { for(int j = i + 1; j <= lSeq; j++) { currIndex = getIndex(i - fSeq + 1, j - fSeq + 1, numSeqsInSub); subElements[currIndex] = elements[getIndex(i, j, numSeqs)]; } } return subElements; } catch(bad_alloc& e) { cout << "Out of Memory!\n"; throw e; } } } void clearSubArray() { if(subElements) { delete [] subElements; } subElements = 0; sizeSubElements = 0; numSeqsInSub = 0; } void makeSimilarityMatrix() { double value; for (int i = 0; i < numSeqs; i++) { SetAt(i + 1, i + 1, 0.0); for (int j = 0; j < i; j++) { value = 100.0 - (GetAt(i + 1, j + 1)) * 100.0; SetAt(i + 1, j + 1, value); //distMat->SetAt(j + 1, i + 1, value); } } } private: double* elements; int sizeElements; int numSeqs; int index; double* subElements; // To be used to return a sub matrix. int firstSeq, numSeqsInSub; int sizeSubElements; }; } #endif clustalw-2.1/src/general/OutputFile.cpp0000644000175000017500000000455611442167171015161 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "OutputFile.h" #include "utils.h" #include "userparams.h" namespace clustalw { OutputFile::OutputFile() { } OutputFile::~OutputFile() { // If it is open, close it and say that a file has been created!!!!! if(file.get()) { file->close(); utilityObject->info("%s file created: [%s]\n", typeOfFileMsg.c_str(), name.c_str()); } } bool OutputFile::openFile(std::string* fileName, const std::string msg, const std::string* path, const std::string ext, const std::string fileType) { if (fileName->empty()) { *fileName = getOutputFileName(msg, *path, ext); if(fileName->empty()) { return false; } } file.reset(new std::ofstream(fileName->c_str(), std::ofstream::trunc)); if(!file->is_open()) { utilityObject->error("Cannot open output file [%s]\n", fileName->c_str()); return false; } name = *fileName; typeOfFileMsg = fileType; return true; } bool OutputFile::isOpen() { return file->is_open(); } std::ofstream* OutputFile::getPtrToFile() { return file.get(); } std::string OutputFile::getOutputFileName(const std::string prompt, std::string path, const std::string fileExtension) { std::string temp; std::string _fileName; // Will return this name. std::string message; _fileName = path + fileExtension; if(_fileName.compare(userParameters->getSeqName()) == 0) { cerr << "WARNING: Output file name is the same as input file.\n"; if (userParameters->getMenuFlag()) { message = "\n\nEnter new name to avoid overwriting [" + _fileName + "]: "; utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } } else if (userParameters->getMenuFlag()) { message = prompt + " [" + _fileName + "]"; utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } return _fileName; } } clustalw-2.1/src/general/debuglogObject.h0000644000175000017500000000037711442167171015442 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef DEBUGLOGOBJECT_H #define DEBUGLOGOBJECT_H #include "DebugLog.h" namespace clustalw { // MARK Dec 12 2005 extern DebugLog* logObject; } #endif clustalw-2.1/src/Clustal.cpp0000644000175000017500000014501611453075774013061 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines (for dendrograms, not for help file). Remerged * this change 13-04-07. * * Mark 10-5-2007: Bug fix # 42. call getWeightsForQtLowScore function in * QTcalcWeightsForLowScoreSeg instead of getWeightsFromDistMat. * * Mark 22-5-07, changed the distmatrix to be the size of alignObject.numSeqs * Mark Change 20-6-07, added call to calculateMaxLengths() * Mark, 3-7-07, Changed getHelp. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "Clustal.h" #include "pairwise/FullPairwiseAlign.h" #include "pairwise/FastPairwiseAlign.h" #include "multipleAlign/MSA.h" #include "multipleAlign/LowScoreSegProfile.h" #include "multipleAlign/Iteration.h" #include "tree/TreeInterface.h" #include "general/debuglogObject.h" #include "general/statsObject.h" #include "alignment/ObjectiveScore.h" #include "general/ClustalWResources.h" #include "Help.h" #include using namespace std; namespace clustalw { Clustal::Clustal() { #ifdef WINDOWS helpFileName = string("clustalw.hlp"); #else helpFileName = string("clustalw_help"); #endif checkTree = true; newSeq = 0; sequencesMsg = "\nUse the existing GUIDE TREE file, "; profile1Msg = "\nUse the existing GUIDE TREE file for Profile 1, " ; profile2Msg = "\nUse the existing GUIDE TREE file for Profile 2, "; newProfile1TreePrompt = "\nEnter name for new GUIDE TREE file for profile 1 ["; newProfile2TreePrompt = "\nEnter name for new GUIDE TREE file for profile 2 ["; initInterface(); } /** *********************************************************************** * The function align is used to do a full multiple sequence alignment. * **************************************************************************/ // FIXME: merge doAlignUseOldTree in here void Clustal::align(string* phylipName, bool createOutput) { //time_t start, end; //double dif; //start = time (NULL); //ObjectiveScore score; //double _score = score.getSagaScore(&alignmentObj); //cout << "SAGA score " << _score << "\n"; string path; int count; AlignmentOutput alignOutput; if(userParameters->getEmpty() && userParameters->getMenuFlag()) { utilityObject->error("No sequences in memory. Load sequences first."); return; } userParameters->setStructPenalties1(NONE); userParameters->setStructPenalties2(NONE); alignmentObj.clearSecStruct1(); alignmentObj.clearSecStruct2(); utilityObject->getPath(userParameters->getSeqName(), &path); if(createOutput && (userParameters->getMenuFlag() || !userParameters->getInteractive())) { if(!alignOutput.openAlignmentOutput(path)) { return; } } else if(createOutput) { // We are using clustalQT. // Open all the files. if(!alignOutput.QTOpenFilesForOutput(QTFileNames)) { return; // could not open the files. } } if (userParameters->getSaveParameters()) { userParameters->createParameterOutput(); } if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetAlign(); } if(userParameters->getDisplayInfo()) { cout << "Start of Pairwise alignments\n"; cout << "Aligning...\n"; } if(userParameters->getDNAFlag()) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } if (statsObject->isEnabled()) { statsObject->logInputSeqStats(&alignmentObj); } /// STEP 1: PAIRWISE ALIGNMENT TO GENERATE DISTANCE MATRIX SymMatrix distMat; int _numSeqs = alignmentObj.getNumSeqs(); distMat.ResizeRect(_numSeqs + 1); PairwiseAlignBase* pairwiseDist; if (userParameters->getQuickPairAlign()) { pairwiseDist = new FastPairwiseAlign(); } else { pairwiseDist = new FullPairwiseAlign(); } // Generate distance matrix! pairwiseDist->pairwiseAlign(&alignmentObj, &distMat, 0, _numSeqs, 0, _numSeqs); delete pairwiseDist; bool success = false; auto_ptr progSteps; vector seqWeight(_numSeqs + 1); #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Calling getWeightsAndStepsFromDistMat\n"); } #endif TreeInterface calcSteps; progSteps = calcSteps.getWeightsAndStepsFromDistMat(&seqWeight, &distMat, &alignmentObj, 1, _numSeqs, phylipName, &success); //cout << "weights and steps calculated!\n"; //end = time (NULL); //dif = difftime(end, start); //cout << "It took " << dif << " seconds so Far\n"; if(!success) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Unsuccessful!!!\n"); } #endif return; } #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("doing multiSeqAlign\n"); } #endif MSA* msaObj = new MSA(); count = msaObj->multiSeqAlign(&alignmentObj, &distMat, &seqWeight, progSteps.get(), 0); delete msaObj; //cout << "alignment finished!\n"; //end = time (NULL); //dif = difftime(end, start); //cout << "It took " << dif << " seconds so Far\n"; if (count <= 0) { return; } if (userParameters->getMenuFlag()) { cout << "\n\n\n"; } /// Do iteration to improve alignment!!! if(userParameters->getDoRemoveFirstIteration() == ALIGNMENT) { //userParameters->setNumIterations(_numSeqs * 2); Iteration iterateObj; iterateObj.removeFirstIterate(&alignmentObj); alignmentObj.calculateMaxLengths(); // Mark Change 20-6-07 if(userParameters->getDisplayInfo()) cout << "Finished iteration\n"; } if (statsObject->isEnabled()) { statsObject->logAlignedSeqStats(&alignmentObj); } /// STEP 4: OUTPUT THE ALIGNMENT if(createOutput) { alignOutput.createAlignmentOutput(&alignmentObj, 1, _numSeqs); } (*phylipName) = ""; //end = time (NULL); //dif = difftime(end, start); //cout << "It took " << dif << " seconds\n"; } /** **************************************************************************** * The function sequencesAlignToProfile is used to align a set of sequences to * * a profile * *******************************************************************************/ void Clustal::sequencesAlignToProfile(string* phylipName) { string path; string treeName; bool useTree; int i, j, count; float dscore; bool saveSS2; AlignmentOutput alignOutput; if(userParameters->getProfile1Empty() && userParameters->getMenuFlag()) { utilityObject->error("No profile in memory. Input 1st profile first.\n"); return; } if(userParameters->getProfile2Empty() && userParameters->getMenuFlag()) { utilityObject->error("No sequences in memory. Input sequences first.\n"); return; } utilityObject->getPath(userParameters->getProfile2Name(), &path); if(userParameters->getMenuFlag() || !userParameters->getInteractive()) { if(!alignOutput.openAlignmentOutput(path)) { return; } } else { // We are using clustalQT. // Open all the files. if(!alignOutput.QTOpenFilesForOutput(QTFileNames)) { return; // could not open the files. } } newSeq = alignmentObj.getProfile1NumSeqs() + 1; // check for secondary structure information for list of sequences saveSS2 = userParameters->getUseSS2(); if (userParameters->getStructPenalties2() != NONE && userParameters->getUseSS2() == true && (alignmentObj.getNumSeqs() - alignmentObj.getProfile1NumSeqs() > 1)) { if (userParameters->getStructPenalties2() == SECST) { utilityObject->warning("\n\nWARNING: ignoring secondary structure for a list of sequences\n\n"); } else if (userParameters->getStructPenalties2() == GMASK) { utilityObject->warning("\n\nWARNING: ignoring gap penalty mask for a list of sequences\n\n"); } userParameters->setUseSS2(false); } DistMatrix distMat; int _numSeqs = alignmentObj.getNumSeqs(); distMat.ResizeRect(_numSeqs + 1); // // Convert to similarities!!!!!!!! // This is calcualting the similarities of the sequences in the profile part // for (i = 1; i <= newSeq; i++) { for (j = i + 1; j <= newSeq; j++) { dscore = alignmentObj.countid(i,j); distMat(i, j) = ((double)100.0 - (double)dscore)/(double)100.0; distMat(j, i) = distMat(i, j); } } //distMat.printArray(); InFileStream _treeFile; //nige useTree = false; // // Note put this into a separate function!!!!! // if (_numSeqs >= 2) { useTree = useExistingGuideTree(Sequences, phylipName, path); } if (userParameters->getSaveParameters()) { userParameters->createParameterOutput(); } if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetProfile2(); } else { alignmentObj.fixGaps(); } int _length = 0; if (userParameters->getStructPenalties1() == SECST) { _length = alignmentObj.getSeqLength(1); calcGapPenaltyMask(_length, alignmentObj.getSecStructMask1(), alignmentObj.getGapPenaltyMask1()); } if (userParameters->getStructPenalties2() == SECST) { _length = alignmentObj.getSeqLength(alignmentObj.getProfile1NumSeqs() + 1); calcGapPenaltyMask(_length, alignmentObj.getSecStructMask2(), alignmentObj.getGapPenaltyMask2()); } // PROGRESSIVE ALIGNMENT ALGORITHM // vector seqWeights(_numSeqs + 1); bool success = false; if (useTree == false) // create the new tree file, if necessary { if(userParameters->getDisplayInfo()) { cout << "Start of Pairwise alignments\n"; cout << "Aligning...\n"; } if(userParameters->getDNAFlag()) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } // STEP 1: CALCULATE DISTANCE MATRIX USING PAIRWISE ALIGNMENT // PairwiseAlignBase* pairwiseDist; if (userParameters->getQuickPairAlign()) { pairwiseDist = new FastPairwiseAlign(); } else { pairwiseDist = new FullPairwiseAlign(); } // Generate distance matrix! pairwiseDist->pairwiseAlign(&alignmentObj, &distMat, 0, _numSeqs, newSeq-2, _numSeqs); delete pairwiseDist; if(userParameters->getDisplayInfo()) cout << "\n\n"; TreeInterface calcSeqWeights; calcSeqWeights.getWeightsFromDistMat(&seqWeights, &distMat, &alignmentObj, 1, _numSeqs, phylipName, &success); } else { TreeInterface calcSeqWeights; calcSeqWeights.getWeightsFromGuideTree(&alignmentObj, &distMat, phylipName, &seqWeights, 1, _numSeqs, &success); } if(!success) { return; } // If it is true, call the function here to get the seqweights etc from it. // if users request only the guide tree, return if (userParameters->getNewTreeFile()) { return; } MSA* msaObj = new MSA(); count = msaObj->seqsAlignToProfile(&alignmentObj, &distMat, &seqWeights, newSeq - 2, *phylipName); delete msaObj; userParameters->setUseSS2(saveSS2); if (count <= 0) { return; } if (userParameters->getMenuFlag()) { cout << "\n\n\n"; } /// STEP 4: OUTPUT THE ALIGNMENT // alignOutput.createAlignmentOutput(&alignmentObj, 1, _numSeqs); (*phylipName) = ""; } /** **************************************************************************** * The function profileAlign is used to align two profiles * *******************************************************************************/ void Clustal::profileAlign(string* p1TreeName, string* p2TreeName) { string path; //string treeName; bool useTree1, useTree2; int count, i, j, dscore; int _profile1NumSeqs = alignmentObj.getProfile1NumSeqs(); AlignmentOutput alignOutput; if(userParameters->getProfile1Empty() || userParameters->getProfile2Empty()) { utilityObject->error("No sequences in memory. Load sequences first.\n\n"); return; } utilityObject->getPath(userParameters->getProfile1Name(), &path); if(userParameters->getMenuFlag() || !userParameters->getInteractive()) { if(!alignOutput.openAlignmentOutput(path)) { return; } } else { // We are using clustalQT. // Open all the files. if(!alignOutput.QTOpenFilesForOutput(QTFileNames)) { return; // could not open the files. } } if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetProfile1(); alignmentObj.resetProfile2(); } else { alignmentObj.fixGaps(); } // Check if there exists a tree for profile1 useTree1 = false; if (_profile1NumSeqs >= 2) { useTree1 = useExistingGuideTree(Profile1, p1TreeName, path); } // Check if there exists a tree for profile2 useTree2 = false; utilityObject->getPath(userParameters->getProfile2Name(), &path); if (alignmentObj.getNumSeqs() - _profile1NumSeqs >= 2) { useTree2 = useExistingGuideTree(Profile2, p2TreeName, path); } if (userParameters->getSaveParameters()) { userParameters->createParameterOutput(); } int _length = 0; if (userParameters->getStructPenalties1() == SECST) { _length = alignmentObj.getSeqLength(1); calcGapPenaltyMask(_length, alignmentObj.getSecStructMask1(), alignmentObj.getGapPenaltyMask1()); } if (userParameters->getStructPenalties2() == SECST) { _length = alignmentObj.getSeqLength(_profile1NumSeqs + 1); calcGapPenaltyMask(_length, alignmentObj.getSecStructMask2(), alignmentObj.getGapPenaltyMask2()); } // Declare the distance matrix DistMatrix distMat; int _numSeqs = alignmentObj.getNumSeqs(); distMat.ResizeRect(_numSeqs + 1); if (useTree1 == false) { if (_profile1NumSeqs >= 2) { for (i = 1; i <= _profile1NumSeqs; i++) { for (j = i + 1; j <= _profile1NumSeqs; j++) { dscore = static_cast(alignmentObj.countid(i,j)); distMat(i, j) = (100.0 - dscore)/100.0; distMat(j, i) = distMat(i, j); } } utilityObject->getPath(userParameters->getProfile1Name(), &path); // We need to get the name of the file first because the message is different! if(userParameters->getMenuFlag()) { promptForNewGuideTreeName(Profile1, p1TreeName, path); } else { string treeName; treeName = path + "dnd"; p1TreeName = new string(treeName); } } if (useTree2 == false) { if(_numSeqs - _profile1NumSeqs >= 2) { for (i = 1 + _profile1NumSeqs; i <= _numSeqs; i++) { for (j = i + 1; j <= _numSeqs; j++) { dscore = static_cast(alignmentObj.countid(i,j)); distMat(i, j) = (100.0 - dscore) / 100.0; distMat(j, i) = distMat(i, j); } } utilityObject->getPath(userParameters->getProfile2Name(), &path); if(userParameters->getMenuFlag()) { promptForNewGuideTreeName(Profile2, p2TreeName, path); } else { string treeName; treeName = path + "dnd"; p2TreeName = new string(treeName); } } } } bool success = false; vector prof1Weight, prof2Weight; prof1Weight.resize(_profile1NumSeqs); prof2Weight.resize(_numSeqs); TreeInterface tree; tree.getWeightsForProfileAlign(&alignmentObj, &distMat, p1TreeName, &prof1Weight, p2TreeName, &prof2Weight, _numSeqs, _profile1NumSeqs, useTree1, useTree2, &success); if(!success) { return; } // do an initial alignment to get the pairwise identities between the two // profiles - used to set parameters for the final alignment MSA* msaObj = new MSA(); alignmentObj.resetProfile1(); alignmentObj.resetProfile2(); count = msaObj->doProfileAlign(&alignmentObj, &distMat, &prof1Weight, &prof2Weight); delete msaObj; if (count == 0) { return; } if(userParameters->getMenuFlag()) { cout << "\n\n\n"; } alignOutput.createAlignmentOutput(&alignmentObj, 1, _numSeqs); (*p1TreeName) = ""; (*p2TreeName) = ""; } void Clustal::doGuideTreeOnly(string* phylipName) { string path; if(userParameters->getEmpty()) { utilityObject->error("No sequences in memory. Load sequences first.\n"); return; } userParameters->setStructPenalties1(NONE); userParameters->setStructPenalties2(NONE); alignmentObj.clearSecStruct1(); alignmentObj.clearSecStruct2(); if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetAlign(); } utilityObject->getPath(userParameters->getSeqName(), &path); int _numSeqs = alignmentObj.getNumSeqs(); if (_numSeqs < 2) { utilityObject->error("Less than 2 sequences in memory. Phylogenetic tree cannot be built.\n"); return; } if (userParameters->getSaveParameters()) { userParameters->createParameterOutput(); } if(userParameters->getDisplayInfo()) { cout << "Start of Pairwise alignments\n"; cout << "Aligning...\n"; } if(userParameters->getDNAFlag()) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } ///STEP 1: PAIRWISE ALIGNMENT TO GENERATE DISTANCE MATRIX // DistMatrix distMat; distMat.ResizeRect(_numSeqs + 1); PairwiseAlignBase* pairwiseDist; if (userParameters->getQuickPairAlign()) { pairwiseDist = new FastPairwiseAlign(); } else { pairwiseDist = new FullPairwiseAlign(); } // Generate distance matrix! pairwiseDist->pairwiseAlign(&alignmentObj, &distMat, 0, _numSeqs, 0, _numSeqs); delete pairwiseDist; /* AW DEBUG fprintf(stdout, "\nDEBUG: distance matrix following...\n"); distMat.printArray(); */ bool success = false; TreeInterface tree; tree.generateTreeFromDistMat(&distMat, &alignmentObj, 1, _numSeqs, phylipName, &success); if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetAlign(); } (*phylipName) = ""; } // FIXME this is to 90% identical with align(), please merge void Clustal::doAlignUseOldTree(string* phylipName) { string path; int count; AlignmentOutput alignOutput; if(userParameters->getEmpty()) { utilityObject->error("No sequences in memory. Load sequences first.\n"); return; } userParameters->setStructPenalties1(NONE); userParameters->setStructPenalties2(NONE); alignmentObj.clearSecStruct1(); alignmentObj.clearSecStruct2(); utilityObject->getPath(userParameters->getSeqName(), &path); if(userParameters->getMenuFlag() || !userParameters->getInteractive()) { if(!alignOutput.openAlignmentOutput(path)) { return; } } else { // We are using clustalQT. // Open all the files. if(!alignOutput.QTOpenFilesForOutput(QTFileNames)) { return; // could not open the files. } } if(userParameters->getResetAlignmentsNew() || userParameters->getResetAlignmentsAll()) { alignmentObj.resetAlign(); } int _numSeqs = alignmentObj.getNumSeqs(); DistMatrix distMat; distMat.ResizeRect(_numSeqs + 1); utilityObject->getPath(userParameters->getSeqName(), &path); if (_numSeqs >= 2) { if(userParameters->getMenuFlag()) { phylipName = new string(path); *phylipName = *phylipName + "dnd"; string message, answer; message = "\nEnter a name for the guide tree file [" + *phylipName + "]"; utilityObject->getStr(message, answer); if(!answer.empty()) { phylipName = new string(answer); } } if(userParameters->getMenuFlag() || !userParameters->getInteractive()) { InFileStream _treeFile; //nige _treeFile.open(phylipName->c_str()); if(!_treeFile.is_open()) { utilityObject->error("Cannot open tree file [%s]\n", phylipName->c_str()); return; } _treeFile.close(); } } else { if(userParameters->getDisplayInfo()) { cout << "Start of Pairwise alignments\n"; cout << "Aligning...\n"; } if(userParameters->getDNAFlag()) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } PairwiseAlignBase* pairwiseDist; if (userParameters->getQuickPairAlign()) { pairwiseDist = new FastPairwiseAlign(); } else { pairwiseDist = new FullPairwiseAlign(); } // Generate distance matrix! pairwiseDist->pairwiseAlign(&alignmentObj, &distMat, 0, _numSeqs, 0, _numSeqs); delete pairwiseDist; } if (userParameters->getSaveParameters()) { userParameters->createParameterOutput(); } auto_ptr progSteps; vector seqWeights(_numSeqs + 1); bool success = false; TreeInterface tree; progSteps = tree.getWeightsAndStepsFromTree(&alignmentObj, &distMat, phylipName, &seqWeights, 1, _numSeqs, &success); if(!success) { return; } MSA* msaObj = new MSA(); count = msaObj->multiSeqAlign(&alignmentObj, &distMat, &seqWeights, progSteps.get(), 0); delete msaObj; if (count <= 0) { return; } if (userParameters->getMenuFlag()) { cout << "\n\n\n"; } // same as in align() if(userParameters->getDoRemoveFirstIteration() == ALIGNMENT) { //userParameters->setNumIterations(_numSeqs * 2); Iteration iterateObj; iterateObj.removeFirstIterate(&alignmentObj); alignmentObj.calculateMaxLengths(); // Mark Change 20-6-07 if(userParameters->getDisplayInfo()) cout << "Finished iteration\n"; } alignOutput.createAlignmentOutput(&alignmentObj, 1, _numSeqs); phylipName = new string(""); } void Clustal::getFullHelp() { vector markers; Help myhelp; bool showtitle = true; markers = myhelp.ListSectionMarkers(); for (unsigned int i=0; igetMenuFlag()) { cout << helpString; } else { string::size_type lastPos = 0; string::size_type pos = helpString.find_first_of("\n", lastPos); int nlines = 0; while (pos != string::npos) { cout << helpString.substr(lastPos, pos - lastPos); nlines++; if(nlines >= PAGE_LEN) { char tempChar; cout << "\nPress [RETURN] to continue or X to stop "; cin.get(tempChar); if(toupper(tempChar) == 'X') { return; } else { nlines = 0; } } lastPos = pos; //helpString.find_first_not_of("\n", pos); pos = helpString.find_first_of("\n", lastPos+1); //cerr << "DEBUG: pos=" << pos << " lastPos=" << lastPos << "/" << helpString.length() << "\n"; } } } /** * The wrap functions will be used with interface classes to perform the tasks * that were previously done there. */ int Clustal::sequenceInput(bool append, string *offendingSeq) { int code; // If we are not appending, we need to clear the Alignment object. if(!append) { alignmentObj.clearAlignment(); } FileReader readSeqFile; code = readSeqFile.seqInput(&alignmentObj, append, offendingSeq); return code; } /** * profile1Input is a wrapper function for the profileInput. This is because the * other classes dont have access to FileReader */ int Clustal::profile1Input(string profile1Name) { int code; // I need to clear out the Alignment object. alignmentObj.clearAlignment(); userParameters->setProfileNum(1); userParameters->setSeqName(profile1Name); userParameters->setProfile1Name(profile1Name); FileReader readProfileFile; code = readProfileFile.profileInput(&alignmentObj); // If we are using the commandline check if there are seqs! if(!userParameters->getInteractive()) { // AW: FIXME code should be handled higher up the stack and check all codes // also, shouldnt we use utilityObject->error()? if(code != OK) { if (code==NOSEQUENCESINFILE) cerr << "ERROR: There are no sequences in profile2 file." << std::endl; else if (code==ALLNAMESNOTDIFFERENT) cerr << "ERROR: Not all sequence names are different" << std::endl; else cerr << "ERROR: Unhandled error code (" << code << ") returned from profileInput.\n"; // AW: should we really exit here? What if called from clustalx? exit(2); } } return code; } /** * profile2Input is a wrapper function for the profileInput. This is because the * other classes dont have access to FileReader */ int Clustal::profile2Input(string profile2Name) { int code; if(userParameters->getProfileNum() == 2) { // Remove the sequences from the previous one. int numSeqsProfile1 = alignmentObj.getProfile1NumSeqs(); alignmentObj.resizeSeqArray(numSeqsProfile1 + 1); // Clear anything from profile2 in alignment. alignmentObj.clearSecStruct2(); } userParameters->setProfileNum(2); userParameters->setSeqName(profile2Name); userParameters->setProfile2Name(profile2Name); FileReader readProfileFile; cout << "before profileInput\n"; code = readProfileFile.profileInput(&alignmentObj); cout << "after profileInput\n"; if(!userParameters->getInteractive()) { // AW: FIXME code should be handled higher up the stack and check all codes // also, shouldnt we use utilityObject->error()? if(code != OK) { if (code==NOSEQUENCESINFILE) cerr << "ERROR: There are no sequences in profile2 file." << std::endl; else if (code==ALLNAMESNOTDIFFERENT) cerr << "ERROR: Not all sequence names are different" << std::endl; else cerr << "ERROR: Unhandled error code (" << code << ") returned from profileInput.\n"; // AW: should we really exit here? What if called from clustalx? // DD: fixed if(!userParameters->getGui()) exit(2); } } return code; } /** * The function commandline_readseq is called by the command line to * read in the sequences. It also prints out the names. This was * previously done by the command line parser. */ int Clustal::commandLineReadSeq(int firstSeq) { // Clear the alignment, although obviously there shouldnt be anything in it. alignmentObj.clearAlignment(); userParameters->setProfileNum(0); int code = 0; string offendingSeq; FileReader readInputFile; code = readInputFile.readSeqs(&alignmentObj, firstSeq, &offendingSeq); if(code != OK) { if(code == CANNOTOPENFILE) { utilityObject->error("Cannot open input file. No alignment!\n"); } else if(code == NOSEQUENCESINFILE) { utilityObject->error("No sequences in file. No alignment!\n"); } else if(code == ALLNAMESNOTDIFFERENT) { utilityObject->error("Multiple sequences found with same name (found %s at least twice)!", offendingSeq.c_str()); } else if(code == EMPTYSEQUENCE) { utilityObject->error("Empty sequences found: %s\n", offendingSeq.c_str()); } else if(code == SEQUENCETOOBIG) { utilityObject->error("Sequence(s) too big: %s\n", offendingSeq.c_str()); } else if(code == BADFORMAT) { utilityObject->error("Sequences are badly formatted!\n"); } else { utilityObject->error("\nThere was a problem reading in the file. No alignment!\n"); } exit(-1); } alignmentObj.printSequencesAddedInfo(); userParameters->setEmpty(false); return code; } /* * The function outputNow is used to output the alignment. It can be called by the * menu or command line parser. */ void Clustal::outputNow() { if(alignmentObj.getNumSeqs() > 0) { string path = ""; if(!userParameters->getMenuFlag()) { string _seqName = userParameters->getSeqName(); utilityObject->getPath(_seqName, &path); } AlignmentOutput alignmentOutput; alignmentOutput.openAlignmentOutput(path); alignmentOutput.createAlignmentOutput(&alignmentObj, 1, alignmentObj.getNumSeqs()); } else { utilityObject->error("No sequences have been loaded\n"); } } void Clustal::phylogeneticTree(string* phylipName, string* clustalName, string* distName, string* nexusName, string pimName) { TreeNames treeNames; treeNames.clustalName = *clustalName; treeNames.distName = *distName; treeNames.nexusName = *nexusName; treeNames.phylipName = *phylipName; treeNames.pimName = pimName; TreeInterface tree; tree.treeFromAlignment(&treeNames, &alignmentObj); } void Clustal::bootstrapTree(string* phylipName, string* clustalName, string* nexusName) { TreeNames treeNames; treeNames.clustalName = *clustalName; treeNames.nexusName = *nexusName; treeNames.phylipName = *phylipName; TreeInterface tree; tree.bootstrapTree(&treeNames, &alignmentObj); } void Clustal::initInterface() { userParameters->setEmpty(true); userParameters->setProfile1Empty(true); userParameters->setProfile2Empty(true); } /** * The function calcGapPenaltyMask is used to calculate the gapMask from the secondary * structure information. */ void Clustal::calcGapPenaltyMask(int prfLength, vector* mask, vector* gapMask) { int i,j; vector structMask; structMask.resize(prfLength + 1); int _helixEndPlus = userParameters->getHelixEndPlus(); int _helixEndMinus = userParameters->getHelixEndMinus(); int _strandEndPlus = userParameters->getStrandEndPlus(); int _strandEndMinus = userParameters->getStrandEndMinus(); i = 0; while (i < prfLength) { if (tolower((*mask)[i]) == 'a' || (*mask)[i] == '$') { for (j = -_helixEndPlus; j < 0; j++) { if(i + j < (int)structMask.size()) { if ((i + j >= 0) && (tolower(structMask[i + j]) != 'a') && (tolower(structMask[i + j]) != 'b')) { structMask[i + j] = 'a'; } } } for (j = 0; j < _helixEndMinus; j++) { if (i + j >= prfLength || (tolower((*mask)[i + j]) != 'a' && (*mask)[i + j] != '$')) { break; } structMask[i + j] = 'a'; } i += j; while (tolower((*mask)[i]) == 'a' || (*mask)[i] == '$') { if (i >= prfLength) { break; } if ((*mask)[i] == '$') { structMask[i] = 'A'; i++; break; } else { structMask[i] = (*mask)[i]; } i++; } for (j = 0; j < _helixEndMinus; j++) { if ((i - j - 1 >= 0) && (tolower((*mask)[i - j - 1]) == 'a' || (*mask)[i - j - 1] == '$')) { structMask[i - j - 1] = 'a'; } } for (j = 0; j < _helixEndPlus; j++) { if (i + j >= prfLength) { break; } structMask[i+j] = 'a'; } } else if (tolower((*mask)[i]) == 'b' || (*mask)[i] == '%') { for (j = -_strandEndPlus; j < 0; j++) { if ((i + j >= 0) && (tolower(structMask[i + j]) != 'a') && (tolower(structMask[i + j]) != 'b')) { structMask[i + j] = 'b'; } } for (j = 0; j < _strandEndPlus; j++) { if (i + j >= prfLength || (tolower((*mask)[i + j]) != 'b' && (*mask)[i + j] != '%')) { break; } structMask[i+j] = 'b'; } i += j; while (tolower((*mask)[i]) == 'b' || (*mask)[i] == '%') { if (i >= prfLength) { break; } if ((*mask)[i] == '%') { structMask[i] = 'B'; i++; break; } else { structMask[i] = (*mask)[i]; } i++; } for (j = 0; j < _strandEndMinus; j++) { if ((i-j-1>=0) && (tolower((*mask)[i-j-1]) == 'b' || (*mask)[i-j-1] == '%')) { structMask[i - j - 1] = 'b'; } } for (j = 0; j < _strandEndPlus; j++) { if (i + j >= prfLength) { break; } structMask[i+j] = 'b'; } } else { i++; } } for(i = 0; i < prfLength;i++) { switch (structMask[i]) { case 'A': (*gapMask)[i] = userParameters->getHelixPenalty() + '0'; break; case 'a': (*gapMask)[i] = userParameters->getHelixEndPenalty() + '0'; break; case 'B': (*gapMask)[i] = userParameters->getStrandPenalty() +'0'; break; case 'b': (*gapMask)[i] = userParameters->getStrandEndPenalty() + '0'; break; default: (*gapMask)[i] = userParameters->getLoopPenalty() + '0'; break; } } } /** * The function QTcalcLowScoreSegments is used to calculate the residues in the sequences * that score badly. * @param firstSeq first seq in the alignment or profile * @param nSeqs the number of sequences * @param nCols the length of the longest seq * @param seqWeight a vector to hold the sequence weights * @param lowScoreRes * @param seqWeightCalculated */ void Clustal::QTcalcLowScoreSegments(LowScoreSegParams* params) { int i, j; float sum, prevSum; float gscale; vector weight; int sweight; vector gaps; int matrix[NUMRES][NUMRES]; vector fsum; vector bsum; vector pscore; int _maxAA = userParameters->getMaxAA(); // STEP 1: Calculate the sequence weights QTcalcWeightsForLowScoreSeg(params); subMatrix->getQTMatrixForLowScoreSeg(matrix); const SeqArray* seqArray = alignmentObj.getSeqArray(); gaps.resize(params->nCols + 1); for (j = 1; j <= params->nCols; j++) { gaps[j - 1] = 0; for(i = params->firstSeq + 1; i < params->firstSeq + params->nSeqs; i++) { if (j < alignmentObj.getSeqLength(i)) { if (((*seqArray)[i][j] < 0) || ((*seqArray)[i][j] > _maxAA)) { gaps[j-1]++; } } } } // STEP 2: Calculate the profile LowScoreSegProfile lowScoreProfile(params->nCols, params->firstSeq, params->firstSeq + params->nSeqs); weight.resize(params->firstSeq + params->nSeqs + 1); for(i = params->firstSeq;i < params->firstSeq + params->nSeqs;i++) { weight[i] = (*(params->seqWeight))[i - params->firstSeq]; } lowScoreProfile.calcLowScoreSegProfile(seqArray, matrix, &weight); const SeqArray* profile = lowScoreProfile.getProfilePtr(); sweight = 0; for(i = params->firstSeq; i < params->firstSeq + params->nSeqs; i++) { sweight += weight[i]; } //Now, use the profile scores to mark segments of each sequence which score badly. fsum.resize(params->nCols + 2); bsum.resize(params->nCols + 2); pscore.resize(params->nCols + 2); for(i = params->firstSeq + 1; i < params->firstSeq + params->nSeqs + 1; i++) { // In a forward phase, sum the profile scores. Mark negative sums as exceptions. //If the sum is positive, then it gets reset to 0. sum = 0.0; for(j = 1; j <= alignmentObj.getSeqLength(i); j++) { gscale = (float)(params->nSeqs - gaps[j - 1]) / (float)params->nSeqs; if((*seqArray)[i][j] < 0 || (*seqArray)[i][j] >= _maxAA) { pscore[j - 1] = 0.0; sum = 0.0; } else { pscore[j-1]=((*profile)[j][(*seqArray)[i][j]]- weight[i - 1] * matrix[(*seqArray)[i][j]][(*seqArray)[i][j]]) * gscale / sweight; } sum += pscore[j - 1]; if(sum > 0.0) { sum = 0.0; } fsum[j - 1] = sum; } // trim off any positive scoring residues from the end of the segments prevSum = 0; for(j = alignmentObj.getSeqLength(i) - 1; j >= 0; j--) { if(prevSum >= 0.0 && fsum[j] < 0.0 && pscore[j] >= 0.0) { fsum[j] = 0.0; } prevSum = fsum[j]; } // Now, in a backward phase, do the same summing process. sum = 0.0; for(j = alignmentObj.getSeqLength(i); j >= 1; j--) { if((*seqArray)[i][j] < 0 || (*seqArray)[i][j] >= _maxAA) { sum = 0; } else { sum += pscore[j - 1]; } if(sum > 0.0) { sum = 0.0; } bsum[j - 1] = sum; } // trim off any positive scoring residues from the start of the segments prevSum = 0; for(j = 0; j < alignmentObj.getSeqLength(i); j++) { if(prevSum >= 0.0 && bsum[j] < 0.0 && pscore[j] >= 0.0) { bsum[j] = 0.0; } prevSum = bsum[j]; } //Mark residues as exceptions if they score negative in the forward AND backward directions. for(j = 1; j <= alignmentObj.getSeqLength(i); j++) { if(fsum[j - 1] < 0.0 && bsum[j - 1] < 0.0) { if((*seqArray)[i][j] >= 0 && (*seqArray)[i][j] < _maxAA) { (*(params->lowScoreRes))[i - params->firstSeq - 1][j - 1] = -1; } } } } // Finally, apply the length cutoff to the segments - removing segments shorter //than the cutoff QTremoveShortSegments(params); } void Clustal::QTremoveShortSegments(LowScoreSegParams* params) { int i,j,k,start; //panel_data data; //GetPanelExtra(p,&data); if(params->nSeqs <= 0) return; // Reset all the exceptions - a value of 1 indicates an exception that // will be displayed. A value of -1 is used to remember exceptions that // are temporarily hidden in the display for(i = 0; i < params->nSeqs; i++) { for(j = 0; j < params->nCols; j++) { if((*(params->lowScoreRes))[i][j] == -1) { (*(params->lowScoreRes))[i][j] = 1; } } } for(i = 0; i < params->nSeqs; i++) { start = -1; for(j = 0; j <= params->nCols; j++) { if(start == -1) { if((*(params->lowScoreRes))[i][j] == 1) start = j; } else { if(j == params->nCols || (*(params->lowScoreRes))[i][j] == 0) { if(j - start < userParameters->getQTminLenLowScoreSegment()) { for(k = start; k < j; k++) { (*(params->lowScoreRes))[i][k] = -1; } } start = -1; } } } } } /** * Change: Mark 22-5-07, changed the distmatrix to be the size of alignObject.numSeqs */ void Clustal::QTcalcWeightsForLowScoreSeg(LowScoreSegParams* params) { int i, j; vector weight; float dscore; DistMatrix distMat(alignmentObj.getNumSeqs() + 1); // Mark: changed size // Aw potential trouble here: what if we don't have write // permission to current directory? #ifdef UNIX char treeName[FILENAMELEN]=".score.ph"; #else char treeName[FILENAMELEN]="tmp.ph"; #endif if(params->nSeqs <= 0) { return; } // if sequence weights have been calculated before - don't bother //doing it again (it takes too long). data.seqweight is set to NULL when // new sequences are loaded. / if(params->seqWeightCalculated == true) { return; } utilityObject->info("Calculating sequence weights..."); // count pairwise percent identities to make a phylogenetic tree // if(params->nSeqs >= 2) { //i=firstSeq + 1; i <= firstSeq + nSeqs for (i = params->firstSeq + 1; i <= params->firstSeq + params->nSeqs; i++) { //j=i + 1; i <= firstSeq + nSeqs for (j = i + 1; j <= params->firstSeq + params->nSeqs; j++) // Mark 22-5-07 { dscore = alignmentObj.countid(i, j); // Mark 22-5-07 distMat(i, j) = (100.0 - dscore) / 100.0; distMat(j, i) = distMat(i, j); } } string name = string(treeName); bool success = false; weight.resize(params->firstSeq + params->nSeqs + 1); TreeInterface tree; tree.getWeightsForQtLowScore(&weight, &distMat, &alignmentObj, params->firstSeq + 1, params->nSeqs, &name, &success); // Mark change 10-5-07 if(!success) { return; } for(i = params->firstSeq;i < params->firstSeq + params->nSeqs;i++) { (*(params->seqWeight))[i - params->firstSeq] = weight[i]; } utilityObject->info("Done."); } } void Clustal::QTSetFileNamesForOutput(AlignmentFileNames fileNames) { QTFileNames = fileNames; } bool Clustal::QTRealignSelectedRange(AlignmentFileNames fileNames, int beginPos, int endPos, bool realignEndGapPen) { bool alignEndGapPen = userParameters->getEndGapPenalties(); Alignment saveOldAlign = alignmentObj; // Take a copy of it. Note provided copy // constructor is ok. bool ok; ok = alignmentObj.removeAllOutsideRange(beginPos, endPos); if(!ok) { alignmentObj = saveOldAlign; return false; } // Temporarily set the alignment output to be input int saveOutOrder = userParameters->getOutputOrder(); userParameters->setOutputOrder(INPUT); //set end gap penalties to be realignEndGapPenalties userParameters->setEndGapPenalties(realignEndGapPen); //do the alignment if(alignmentObj.getNumSeqs() <= 0) { alignmentObj = saveOldAlign; return false; } QTSetFileNamesForOutput(fileNames); string phylipName = fileNames.treeFile; align(&phylipName, false); userParameters->setOutputOrder(saveOutOrder); // reset the end gap penalties userParameters->setEndGapPenalties(alignEndGapPen); // remove postions that only contain gaps int nSeqs = alignmentObj.getNumSeqs(); alignmentObj.removeAllGapOnlyColumns(1, nSeqs, 0); // save it to a temporary area. SeqArray realignedArea = *(alignmentObj.getSeqArray()); // Paste it back into the original alignment. alignmentObj = saveOldAlign; bool result; result = alignmentObj.updateRealignedRange(realignedArea, beginPos, endPos); if(result == false) { utilityObject->error("something went wrong while updating the realigned range\n"); } // output the alignments AlignmentOutput alignOutput; if(!alignOutput.QTOpenFilesForOutput(QTFileNames)) { return false; // could not open the files. } alignOutput.createAlignmentOutput(&alignmentObj, 1, nSeqs); return true; } void Clustal::test() { cout << "RUNNING TEST\n"; AlignmentOutput alignOutput; string path; utilityObject->getPath(userParameters->getSeqName(), &path); if(!alignOutput.openAlignmentOutput(path)) { cerr << "could not open the file\n"; return; } vector selected; int nSeqs = alignmentObj.getNumSeqs(); selected.resize(nSeqs + 1, 0); selected[9] = 1; selected[10] = 1; //selected[1] = 1; alignmentObj.removeGapOnlyColsFromSelectedSeqs(&selected); alignOutput.createAlignmentOutput(&alignmentObj, 1, nSeqs); } /** * This function is used to ask the user if they would like to use an existing guide tree. * Note: It expects that phylipName actually points to a string that has been allocated. */ bool Clustal::useExistingGuideTree(int type, string* phylipName, const string& path) { bool useTree = false; string treeName; InFileStream _treeFile; //nige bool paramUseTree; string* ptrToMsg; if(type == Sequences) { ptrToMsg = &sequencesMsg; paramUseTree = userParameters->getUseTreeFile(); } else if(type == Profile1) { ptrToMsg = &profile1Msg; paramUseTree = userParameters->getUseTree1File();; } else if(type == Profile2) { ptrToMsg = &profile2Msg; paramUseTree = userParameters->getUseTree2File();; } else { ptrToMsg = &sequencesMsg; paramUseTree = userParameters->getUseTreeFile(); } if (checkTree && userParameters->getMenuFlag()) { treeName = path + "dnd"; _treeFile.open(treeName.c_str()); _treeFile.seekg(0, std::ios::beg); if(_treeFile.is_open()) { string message = *ptrToMsg + treeName + " (y/n) ? [y]"; string answer; utilityObject->getStr(message, answer); if(answer[0] != 'n' && answer[0] != 'N') { if(!phylipName) { phylipName = new string(treeName); } else { *phylipName = treeName; } useTree = true; } _treeFile.close(); } } else if (!userParameters->getMenuFlag() && paramUseTree) { useTree = true; } return useTree; } void Clustal::promptForNewGuideTreeName(int type, string* treeName, const string& path) { string* ptrToMsg; if(type == Profile1) { ptrToMsg = &newProfile1TreePrompt; } else if(type == Profile2) { ptrToMsg = &newProfile2TreePrompt; } else { ptrToMsg = &newProfile1TreePrompt; } if(!treeName) { treeName = new string(""); } while(treeName->empty()) { string message = *ptrToMsg + path + "dnd]"; string answer; utilityObject->getStr(message, answer); if(answer.empty()) { answer = path + "dnd"; *treeName = answer; } else { *treeName = answer; } } } } clustalw-2.1/src/clustalw_version.h.in0000644000175000017500000000022711442167172015111 00000000000000#ifndef CLUSTALW_VERSION_H #define CLUSTALW_VERSION_H #define CLUSTALW_NAME "@CLUSTALW_NAME@" #define CLUSTALW_VERSION "@CLUSTALW_VERSION@" #endif clustalw-2.1/src/multipleAlign/0000755000175000017500000000000011467270447013624 500000000000000clustalw-2.1/src/multipleAlign/LowScoreSegProfile.h0000644000175000017500000000175011442167171017425 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * NOTE: This profile is not used in the multiple alignment part. It is used for the * the clustal Qt part. It is used in the calculation of low scoring segments. */ #ifndef LOWSCORESEGPROFILE_H #define LOWSCORESEGPROFILE_H #include "../alignment/Alignment.h" namespace clustalw { class LowScoreSegProfile { public: /* Functions */ LowScoreSegProfile(int prfLen, int firstS, int lastS); void calcLowScoreSegProfile(const SeqArray* seqArray, int matrix[NUMRES][NUMRES], vector* seqWeight); const SeqArray* getProfilePtr(){return &profile;}; /* Attributes */ protected: /* Functions */ /* Attributes */ SeqArray profile; int prfLength; int firstSeq, lastSeq; private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/ProfileAlignAlgorithm.h0000644000175000017500000000140511442167171020127 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef PROFILEALIGNALGORITHM_H #define PROFILEALIGNALGORITHM_H #include #include "../alignment/Alignment.h" namespace clustalw { class ProfileAlignAlgorithm { public: virtual ~ProfileAlignAlgorithm(){}; /* Functions */ virtual int profileAlign(Alignment* alnPtr, DistMatrix* distMat, vector* group, int* aligned) = 0; /* Attributes */ protected: /* Attributes */ int prfLength1; int prfLength2; SeqArray seqArray; vector alnWeight; int nseqs1; int nseqs2; private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/ProfileWithSub.cpp0000644000175000017500000000742111442167171017152 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ProfileWithSub.h" namespace clustalw { /** * * @param prfLen * @param firstS * @param lastS * @return */ ProfileWithSub::ProfileWithSub(int prfLen, int firstS, int lastS) : ProfileBase(prfLen, firstS, lastS) { } /** * */ void ProfileWithSub::resetPrf1() { profile.clear(); } /** * * @param seqArray * @param gaps * @param matrix[][] * @param seqWeight */ void ProfileWithSub::calcProfileWithSub(SeqArray* seqArray, vector* gaps, int matrix[NUMRES][NUMRES], vector* seqWeight) { vector > weighting; int sum2, aa, seq, res; int _numSeq; int col, pos; int f; float scale; int _maxAA = userParameters->getMaxAA(); int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); weighting.resize(NUMRES + 2, vector(prfLength + 2)); _numSeq = lastSeq - firstSeq; sum2 = 0; for (seq = firstSeq; seq < lastSeq; seq++) { sum2 += (*seqWeight)[seq]; } for (col = 0; col < prfLength; col++) { for (aa = 0; aa <= _maxAA; aa++) { weighting[aa][col] = 0; for (seq = firstSeq; seq < lastSeq; seq++) if (aa == (*seqArray)[seq][col]) { weighting[aa][col] += (*seqWeight)[seq]; } } weighting[_gapPos1][col] = 0; for (seq = firstSeq; seq < lastSeq; seq++) { if (_gapPos1 == (*seqArray)[seq][col]) { weighting[_gapPos1][col] += (*seqWeight)[seq]; } } weighting[_gapPos2][col] = 0; for (seq = firstSeq; seq < lastSeq; seq++) { if (_gapPos2 == (*seqArray)[seq][col]) { weighting[_gapPos2][col] += (*seqWeight)[seq]; } } } for (pos = 0; pos < prfLength; pos++) { if ((*gaps)[pos] == _numSeq) // If all gaps { for (res = 0; res <= _maxAA; res++) { profile[pos + 1][res] = matrix[res][_gapPos1]; } profile[pos + 1][_gapPos1] = matrix[_gapPos1][_gapPos1]; profile[pos + 1][_gapPos2] = matrix[_gapPos2][_gapPos1]; } else { scale = (float)(_numSeq - (*gaps)[pos]) / (float)_numSeq; for (res = 0; res <= _maxAA; res++) { f = 0; for (aa = 0; aa <= _maxAA; aa++) { f += (weighting[aa][pos] * matrix[aa][res]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][res]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][res]); profile[pos + 1][res] = (int)(((float)f / (float)sum2) * scale); } f = 0; for (aa = 0; aa <= _maxAA; aa++) { f += (weighting[aa][pos] * matrix[aa][_gapPos1]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][_gapPos1]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][_gapPos1]); profile[pos + 1][_gapPos1] = (int)(((float)f / (float)sum2) * scale); f = 0; for (aa = 0; aa <= _maxAA; aa++) { f += (weighting[aa][pos] * matrix[aa][_gapPos2]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][_gapPos2]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][_gapPos2]); profile[pos + 1][_gapPos2] = (int)(((float)f / (float)sum2) * scale); } } } } clustalw-2.1/src/multipleAlign/Iteration.h0000644000175000017500000000110511442167171015640 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef ITERATION_H #define ITERATION_H #include "../alignment/Alignment.h" #include "../general/clustalw.h" namespace clustalw { class Iteration { public: //Iteration(); bool iterationOnTreeNode(int numSeqsProf1, int numSeqsProf2, int& prfLength1, int& prfLength2, SeqArray* seqArray); bool removeFirstIterate(Alignment* alnPtr); private: void printSeqArray(SeqArray* arrayToPrint); }; } #endif clustalw-2.1/src/multipleAlign/ProfileBase.h0000644000175000017500000000453711442167171016111 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * The reason why we have 2 different types of profiles is because one of them * (ProfileWithSub) has the substitution matrix information already in it. This * increases the performance when aligning 2 profile columns. */ #ifndef PROFILEBASE_H #define PROFILEBASE_H #include "../alignment/Alignment.h" namespace clustalw { class ProfileBase { public: /* Functions */ ProfileBase(int prfLen, int firstS, int lastS); void calcGapCoeff(SeqArray* seqArray, vector* gaps, bool useStructPenalties, vector* gapPenaltyMask, int gapCoef, int lenCoef); const SeqArray* getProfilePtr(){return &profile;}; void resetProfile(){for(int i = 0; i < (int)profile.size();i++) { profile[i].clear(); } profile.clear(); }; /* Attributes */ protected: /* Functions */ void calcVPenalties(SeqArray* aln, vector* weight); void calcResidueSpecificPen(SeqArray* aln, vector* weight); void calcHydrophilicPen(SeqArray* aln, vector* weight); int localPenalty(int penalty, int n, vector* resWeight, vector* hydWeight, vector* vWeight); float percentId(vector* s1, vector* s2); /* Attributes */ vector > profile; /* number of residues used for a window for the variable zone penalties */ int vwindow; /* vll is the lower limit for the variable zone penalties (vll < pen < 1.0) */ int vll; /* "Pascarella and Argos" residue specific gap modification factors. See Table 1 in the ClustalW 1994 NAR paper http://www.ncbi.nlm.nih.gov/pubmed/7984417 */ string pascarellaRes; vector pascarellaProb; vector > vlut; static const int numLetters = 26; float reducedGap; bool nVarPen; bool nHydPen; bool nPrefPen; int gdist; int prfLength; int firstSeq, lastSeq; private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/ProfileStandard.h0000644000175000017500000000111711442167171016766 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef PROFILESTANDARD_H #define PROFILESTANDARD_H #include "../alignment/Alignment.h" #include "ProfileBase.h" namespace clustalw { class ProfileStandard : public ProfileBase { public: /* Functions */ ProfileStandard(int prfLen, int firstS, int lastS); void resetPrf2(); void calcStandardProfile(SeqArray* alignment, vector* seqWeight); /* Attributes */ private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/LowScoreSegProfile.cpp0000644000175000017500000000626611442167171017767 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "LowScoreSegProfile.h" namespace clustalw { LowScoreSegProfile::LowScoreSegProfile(int prfLen, int firstS, int lastS) : prfLength(prfLen), firstSeq(firstS), lastSeq(lastS) { profile.resize(prfLength + 2, vector(LENCOL + 2)); } void LowScoreSegProfile::calcLowScoreSegProfile(const SeqArray* seqArray, int matrix[NUMRES][NUMRES], vector* seqWeight) { vector > weighting; int d, i, res; int r, pos; int f; int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); int _maxAA = userParameters->getMaxAA(); weighting.resize(NUMRES + 2, vector(prfLength + 2)); for (r = 0; r < prfLength; r++) { for (d = 0; d <= _maxAA; d++) { weighting[d][r] = 0; for (i = firstSeq; i < lastSeq; i++) { if (r + 1 < (int)(*seqArray)[i + 1].size() - 1) { if (d == (*seqArray)[i + 1][r + 1]) { weighting[d][r] += (*seqWeight)[i]; } } } } weighting[_gapPos1][r] = 0; for (i = firstSeq; i < lastSeq; i++) { if (r + 1 < (int)(*seqArray)[i + 1].size() - 1) { if (_gapPos1 == (*seqArray)[i + 1][r + 1]) { weighting[_gapPos1][r] += (*seqWeight)[i]; } } } weighting[_gapPos2][r] = 0; for (i = firstSeq; i < lastSeq; i++) { if (r + 1 < (int)(*seqArray)[i + 1].size() - 1) { if (_gapPos2 == (*seqArray)[i + 1][r + 1]) { weighting[_gapPos2][r] += (*seqWeight)[i]; } } } } for (pos = 0; pos < prfLength; pos++) { for (res = 0; res <= _maxAA; res++) { f = 0; for (d = 0; d <= _maxAA; d++) { f += (weighting[d][pos] * matrix[d][res]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][res]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][res]); profile[pos + 1][res] = f; } f = 0; for (d = 0; d <= _maxAA; d++) { f += (weighting[d][pos] * matrix[d][_gapPos1]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][_gapPos1]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][_gapPos1]); profile[pos + 1][_gapPos1] = f; f = 0; for (d = 0; d <= _maxAA; d++) { f += (weighting[d][pos] * matrix[d][_gapPos2]); } f += (weighting[_gapPos1][pos] * matrix[_gapPos1][_gapPos2]); f += (weighting[_gapPos2][pos] * matrix[_gapPos2][_gapPos2]); profile[pos + 1][_gapPos2] = f; } } } clustalw-2.1/src/multipleAlign/ProfileBase.cpp0000644000175000017500000003226111442167171016437 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ProfileBase.h" namespace clustalw { /** * * @param prfLen * @param firstS * @param lastS */ ProfileBase::ProfileBase(int prfLen, int firstS, int lastS) : vwindow(5), vll(50), reducedGap(1.0), prfLength(prfLen), firstSeq(firstS), lastSeq(lastS) { vlut.resize(numLetters, vector(numLetters)); for(int i = 0; i < numLetters; i++) { vlut[i][i] = 1; } pascarellaRes = "ACDEFGHKILMNPQRSTVYW"; int pasprob[] = { 87, 87, 104, 69, 80, 139, 100, 104, 68, 79, 71, 137, 126, 93, 128, 124, 111, 75, 100, 77}; pascarellaProb = vector(pasprob, pasprob + 20); profile.resize(prfLength + 2, vector(LENCOL + 2)); } /** * * @param seqArray * @param gaps * @param useStructPenalties * @param gapPenaltyMask * @param gapCoef * @param lenCoef */ void ProfileBase::calcGapCoeff(SeqArray* seqArray, vector* gaps, bool useStructPenalties, vector* gapPenaltyMask, int gapCoef, int lenCoef) { int c; int i, j; int is, ie; int _numSeq, val, pcid; vector gapPos; vector vWeight, resWeight, hydWeight; float scale; int _maxAA = userParameters->getMaxAA(); _numSeq = lastSeq - firstSeq; if(_numSeq == 2) { pcid = static_cast(percentId(&(*seqArray)[firstSeq], &(*seqArray)[firstSeq + 1])); } else pcid = 0; for (j = 0; j < prfLength; j++) { (*gaps)[j] = 0; } // Check for a gap penalty mask if (useStructPenalties != false) { nVarPen = nHydPen = nPrefPen = true; gdist = 0; } else if (userParameters->getNoVarPenalties() == false && pcid > 60) { nHydPen = nPrefPen = true; nVarPen = false; } else { nVarPen = true; nHydPen = userParameters->getNoHydPenalties(); nPrefPen = userParameters->getNoPrefPenalties(); gdist = userParameters->getGapDist(); } for (i = firstSeq; i < lastSeq; i++) { // Include end gaps as gaps ? is = 0; ie = prfLength; if (userParameters->getUseEndGaps() == false && userParameters->getEndGapPenalties() == false) { for (j = 0; j < prfLength; j++) { c = (*seqArray)[i][j]; if ((c < 0) || (c > _maxAA)) is++; else break; } for (j = prfLength - 1; j >= 0; j--) { c = (*seqArray)[i][j]; if ((c < 0) || (c > _maxAA)) ie--; else break; } } for (j = is; j < ie; j++) { if (((*seqArray)[i][j] < 0) || ((*seqArray)[i][j] > _maxAA)) { (*gaps)[j]++; } } } int _DNAFlag = userParameters->getDNAFlag(); if ((!_DNAFlag) && (nVarPen == false)) { vWeight.resize(prfLength + 2); calcVPenalties(seqArray, &vWeight); } if ((!_DNAFlag) && (nPrefPen == false)) { resWeight.resize(prfLength + 2); calcResidueSpecificPen(seqArray, &resWeight); } if ((!_DNAFlag) && (nHydPen == false)) { hydWeight.resize(prfLength + 2); calcHydrophilicPen(seqArray, &hydWeight); } gapPos.resize(prfLength + 2); // mark the residues close to an existing gap (set gaps[i] = -ve) if (_DNAFlag || (gdist <= 0)) { for (i = 0; i < prfLength; i++) { gapPos[i] = (*gaps)[i]; } } else { i = 0; while (i < prfLength) { if ((*gaps)[i] <= 0) { gapPos[i] = (*gaps)[i]; i++; } else { for (j = -gdist + 1; j < 0; j++) { if ((i + j >= 0) && (i + j < prfLength) && (((*gaps)[i + j] == 0) || ((*gaps)[i + j] < j))) { gapPos[i + j] = j; } } while ((*gaps)[i] > 0) { if (i >= prfLength) { break; } gapPos[i] = (*gaps)[i]; i++; } for (j = 0; j < gdist; j++) { if ((*gaps)[i + j] > 0) { break; } if ((i + j >= 0) && (i + j < prfLength) && (((*gaps)[i + j] == 0) || ((*gaps)[i + j] < -j))) { gapPos[i + j] = -j-1; } } i += j; } } } for (j = 0; j < prfLength; j++) { if (gapPos[j] <= 0) { // apply residue-specific and hydrophilic gap penalties. if (!_DNAFlag) { profile[j + 1][GAPCOL] = localPenalty(gapCoef, j, &resWeight, &hydWeight, &vWeight); profile[j+1][LENCOL] = lenCoef; } else { profile[j + 1][GAPCOL] = gapCoef; profile[j + 1][LENCOL] = lenCoef; } // increase gap penalty near to existing gaps. if (gapPos[j] < 0) { profile[j + 1][GAPCOL] = static_cast((profile[j + 1][GAPCOL] * (2.0 + 2.0 * (gdist + gapPos[j]) / gdist))); } } else { scale = ((float)(_numSeq - (*gaps)[j]) / (float)_numSeq) * reducedGap; profile[j + 1][GAPCOL] = static_cast(scale * gapCoef); profile[j + 1][LENCOL] = static_cast(0.5 * lenCoef); } // apply the gap penalty mask if (useStructPenalties != NONE) { val = (*gapPenaltyMask)[j] - '0'; if (val > 0 && val < 10) { profile[j + 1][GAPCOL] *= val; profile[j + 1][LENCOL] *= val; } } // make sure no penalty is zero - even for all-gap positions if (profile[j + 1][GAPCOL] <= 0) { profile[j + 1][GAPCOL] = 1; } if (profile[j + 1][LENCOL] <= 0) { profile[j + 1][LENCOL] = 1; } } // set the penalties at the beginning and end of the profile if(userParameters->getEndGapPenalties() == true) { profile[0][GAPCOL] = gapCoef; profile[0][LENCOL] = lenCoef; } else { profile[0][GAPCOL] = 0; profile[0][LENCOL] = 0; profile[prfLength][GAPCOL] = 0; profile[prfLength][LENCOL] = 0; } if (userParameters->getDebug() > 0) { cout << "Opening penalties:\n"; for(i = 0; i <= prfLength; i++) { cout <<" " << i << ":" << profile[i][GAPCOL]<< " "; } cout << "\n"; } if (userParameters->getDebug() > 0) { cout << "Extension penalties:\n"; for(i = 0; i <= prfLength; i++) { cout << i << ":" << profile[i][LENCOL] << " "; } cout << "\n"; } } /** ************************************************************************************** * Protected functions * *****************************************************************************************/ /** * * @param aln * @param weight */ void ProfileBase::calcVPenalties(SeqArray* aln, vector* weight) { int ix1, ix2; int i, j, t; int _maxAA = userParameters->getMaxAA(); int aminoCodeix1, aminoCodeix2; for (i = 0; i < prfLength; i++) { (*weight)[i] = 0; t = 0; for(j = i - vwindow;j < i + vwindow; j++) { if(j >= 0 && j < prfLength) { ix1 = (*aln)[firstSeq][j]; ix2 = (*aln)[firstSeq + 1][j]; if ((ix1 < 0) || (ix1 > _maxAA) || (ix2 < 0) || (ix2 > _maxAA)) { continue; } aminoCodeix1 = userParameters->getAminoAcidCode(ix1); aminoCodeix2 = userParameters->getAminoAcidCode(ix2); (*weight)[i] += vlut[aminoCodeix1 - 'A'][aminoCodeix2 - 'A']; t++; } } /* now we have a weight -t < w < t */ (*weight)[i] +=t; if(t > 0) (*weight)[i] = ((*weight)[i] * 100)/(2 * t); else (*weight)[i] = 100; /* now we have a weight vll < w < 100 */ if ((*weight)[i] < vll) (*weight)[i] = vll; } } /** * * @param aln * @param weight */ void ProfileBase::calcResidueSpecificPen(SeqArray* aln, vector* weight) { char ix; int j, k, _numSeq; int i; int _maxAA = userParameters->getMaxAA(); int _pascarellaNumRes = pascarellaRes.size(); _numSeq = lastSeq - firstSeq; for (i = 0; i < prfLength; i++) { (*weight)[i] = 0; for (k = firstSeq; k < lastSeq; k++) { for (j = 0; j < _pascarellaNumRes; j++) { ix = (*aln)[k][i]; if ((ix < 0) || (ix > _maxAA)) continue; if (userParameters->getAminoAcidCode(ix) == pascarellaRes[j]) { (*weight)[i] += (180 - pascarellaProb[j]); break; } } } (*weight)[i] /= _numSeq; } } /** * * @param aln * @param weight */ void ProfileBase::calcHydrophilicPen(SeqArray* aln, vector* weight) { int res; int numHydResidues, j, k; int i, e, s; vector hyd; float scale; int _maxAA = userParameters->getMaxAA(); hyd.resize(prfLength + 2); string _hydResidues(userParameters->getHydResidues()); numHydResidues = _hydResidues.size(); for (i = 0; i < prfLength; i++) { (*weight)[i] = 0; } for (k = firstSeq; k < lastSeq; k++) { for (i = 0; i < prfLength; i++) { hyd[i] = 0; for (j = 0; j < numHydResidues; j++) { res = (*aln)[k][i]; if ((res < 0) || (res > _maxAA)) continue; if (userParameters->getAminoAcidCode(res) == _hydResidues[j]) { hyd[i] = 1; break; } } } i = 0; while (i < prfLength) { if (hyd[i] == 0) i++; else { s = i; while ((hyd[i] != 0) && (i < prfLength)) { i++; } e = i; if (e - s > 3) { for (j = s; j < e; j++) { (*weight)[j] += 100; } } } } } scale = lastSeq - firstSeq; for (i = 0; i < prfLength; i++) { (*weight)[i] = static_cast(((*weight)[i] / scale)); // Mark change 17-5-07 } } /** * * @param penalty * @param n * @param resWeight * @param hydWeight * @param vWeight * @return */ int ProfileBase::localPenalty(int penalty, int n, vector* resWeight, vector* hydWeight, vector* vWeight) { bool h = false; float gw; if (userParameters->getDNAFlag()) { return(1); } gw = 1.0; if (nVarPen == false) { gw *= (*vWeight)[n] / 100.0; } if (nHydPen == false) { if ((*hydWeight)[n] > 0) { gw *= 0.5; h = true; } } if ((nPrefPen == false) && (h == false)) { gw *= ((*resWeight)[n] / 100.0); } gw *= penalty; return (int)gw; } /** ********************************************************************* * Note dont think this will work. Dont have -3. Need to use lengths! * ************************************************************************/ /** * * @param s1 * @param s2 * @return */ float ProfileBase::percentId(vector* s1, vector* s2) { int i; int count, total; float score; count = total = 0; for (i = 0; i < prfLength; i++) { if (((*s1)[i] >= 0) && ((*s1)[i] < userParameters->getMaxAA())) { total++; if ((*s1)[i] == (*s2)[i]) { count++; } } if ((*s1)[i]==(-3) || (*s2)[i]==(-3)) { break; // I dont have -3 at the end! } } if(total == 0) { score = 0; } else { score = 100.0 * (float)count / (float)total; } return (score); } } clustalw-2.1/src/multipleAlign/MyersMillerProfileAlign.h0000644000175000017500000000374011442167171020451 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef MYERSMILLERPROFILEALIGN_H #define MYERSMILLERPROFILEALIGN_H #include #include "ProfileAlignAlgorithm.h" #include "ProfileStandard.h" #include "ProfileWithSub.h" namespace clustalw { class MyersMillerProfileAlign : public ProfileAlignAlgorithm { public: virtual ~MyersMillerProfileAlign(){}; /* Functions */ MyersMillerProfileAlign(); virtual int profileAlign(Alignment* alnPtr, DistMatrix* distMat, vector* group, int* aligned); /* Attributes */ private: /* Functions */ void addGGaps(Alignment* alnPtr, SeqArray* seqArray); void addGGapsMask(vector* mask,int len, vector* path1, vector* path2); int prfScore(int n, int m); int progTracepath(); void progDel(int k); void progAdd(int k); void progAlign(); int progDiff(int A, int B, int M, int N, int go1, int go2); int openPenalty1(int i, int j); int extPenalty1(int i, int j); int gapPenalty1(int i, int j, int k); int openPenalty2(int i, int j); int extPenalty2(int i, int j); int gapPenalty2(int i, int j, int k); /* Attributes */ ProfileWithSub* profileWithSub; ProfileStandard* profileStandard; int gapcoef1; int gapcoef2; int lencoef1; int lencoef2; vector displ; vector gS; vector HH; vector DD; vector RR; vector SS; vector alnPath1; vector alnPath2; int printPtr; int lastPrint; int matrix[32][32]; vector gaps; bool switchProfiles; const SeqArray* profile1; const SeqArray* profile2; int _gapPos1, _gapPos2; int alignmentLength; }; } #endif clustalw-2.1/src/multipleAlign/ProfileWithSub.h0000644000175000017500000000123211442167171016611 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef PROFILEWITHSUB_H #define PROFILEWITHSUB_H #include "../alignment/Alignment.h" #include "ProfileBase.h" namespace clustalw { class ProfileWithSub : public ProfileBase { public: /* Functions */ ProfileWithSub(int prfLen, int firstS, int lastS); void resetPrf1(); void calcProfileWithSub(SeqArray* seqArray, vector* gaps, int matrix[NUMRES][NUMRES], vector* seqWeight); /* Attributes */ private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/Iteration.cpp0000644000175000017500000002630111442167171016200 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. * * Changes: * Mark 30-5-2007: Changed iterationOnTreeNode function as it was adding in extra gaps * at the end of an alignment. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "Iteration.h" #include "../alignment/ObjectiveScore.h" #include "../general/utils.h" #include "../general/userparams.h" #include "../tree/TreeInterface.h" #include "../clustalw_version.h" #include "MSA.h" namespace clustalw { bool Iteration::iterationOnTreeNode(int numSeqsProf1, int numSeqsProf2, int& prfLength1, int& prfLength2, SeqArray* seqArray) { Alignment alignmentToIterate; int numSeqsInProfiles = numSeqsProf1 + numSeqsProf2; if(numSeqsInProfiles <= 2) { return false; } SeqArray profileSeqs; profileSeqs.resize(numSeqsInProfiles + 1); // Copy the SeqArray! for (int j = 0; ((j < numSeqsProf1 + numSeqsProf2) && (j < (int)seqArray->size())); j++) { profileSeqs[j + 1].clear(); profileSeqs[j + 1].resize(prfLength1 + 1); for (int i = 0; i < prfLength1 && i < (int)(*seqArray)[j].size(); i++) { profileSeqs[j + 1][i + 1] = (*seqArray)[j][i]; } } alignmentToIterate.addSequences(&profileSeqs); //userParameters->setNumIterations(numSeqsInProfiles * 2); bool changed = false; changed = removeFirstIterate(&alignmentToIterate); if(changed) { SeqArray* iteratedSeqs = alignmentToIterate.getSeqArrayForRealloc(); string aaCodes = userParameters->getAminoAcidCodes(); int newPrf1Length = 0, newPrf2Length = 0; for (int j = 0; j < numSeqsProf1 + numSeqsProf2; j++) { if(j < numSeqsProf1) { if(alignmentToIterate.getSeqLength(j + 1) > newPrf1Length) { newPrf1Length = alignmentToIterate.getSeqLength(j + 1); } } else if(j < numSeqsProf1 + numSeqsProf2) { if(alignmentToIterate.getSeqLength(j + 1) > newPrf2Length) { newPrf2Length = alignmentToIterate.getSeqLength(j + 1); } } } prfLength1 = newPrf1Length; // mark 30-5-2007 prfLength2 = newPrf2Length; // mark 30-5-2007 for (int j = 0; j < numSeqsProf1 + numSeqsProf2; j++) { // I need to recalculate the prfLength1 and prfLength2 (*seqArray)[j].clear(); (*seqArray)[j].assign((*iteratedSeqs)[j + 1].begin() + 1, (*iteratedSeqs)[j + 1].end()); (*seqArray)[j].resize(prfLength1 + extraEndElemNum, 31); (*seqArray)[j][prfLength1] = ENDALN; } } return true; } void Iteration::printSeqArray(SeqArray* arrayToPrint) { cout << "HERE IS THE SEQARRAY\n"; // I need to use iterators for everything here. SeqArray::iterator mainBeginIt = arrayToPrint->begin(); SeqArray::iterator mainEndIt = arrayToPrint->end(); vector::iterator begin, end; string aaCodes = userParameters->getAminoAcidCodes(); for(; mainBeginIt != mainEndIt; mainBeginIt++) { if(mainBeginIt->size() > 0) { begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); for(; begin != end; begin++) { if(*begin < (int)aaCodes.size()) { cout << aaCodes[*begin]; } else { cout << "-"; } } cout << "\n"; } } cout << "\n\n"; } /** * The function removeFirstIterate is used to perform the remove first iteration * strategy on the finished alignment. It optimises the score give in alignScore. * For iter = 1 to numIterations * For seq i = 1 to numSeqs * remove seq i * if either of the profiles has all gaps, remove this column. * realign using profileAlign * if its better, keep it. If its not better, dont keep it. * @param alnPtr The alignment object. * @return true if it has been successful, false if it has not been successful. */ bool Iteration::removeFirstIterate(Alignment* alnPtr) { if(!alnPtr) { return false; } string p1TreeName; p1TreeName = ""; string p2TreeName; int nSeqs = alnPtr->getNumSeqs(); if(nSeqs <= 2) { return false; } DistMatrix distMat; distMat.ResizeRect(nSeqs + 1); ObjectiveScore scoreObj; int iterate = userParameters->getDoRemoveFirstIteration(); userParameters->setDoRemoveFirstIteration(NONE); double firstScore = scoreObj.getScore(alnPtr); //cout << "firstScore = " << firstScore << "\n"; double score = 0; double bestScore = firstScore; double dscore; int count; bool scoreImproved = false; bool scoreImprovedAnyIteration = false; int prof1NumSeqs = 1; // This will be used for removing gaps!!! vector profile1; vector profile2; profile1.resize(nSeqs + 1, 0); profile1[1] = 1; profile2.resize(nSeqs + 1, 1); profile2[0] = 0; profile2[1] = 0; vector prof1Weight, prof2Weight; int iterations = userParameters->getNumIterations(); //cout << "Max num iterations = " << iterations << "\n"; Alignment bestAlignSoFar; TreeInterface tree; // One iteration consists of removing each of the sequences, reseting all the gap // only columns. If the score is better, the new alignment is kept. for(int n = 1; n <= iterations; n++) { scoreImproved = false; cout << "ITERATION " << n << " OF " << iterations << "\n"; for(int i = 1; i <= nSeqs; i++) { vector seqVector; Alignment iterateAlign = *alnPtr; iterateAlign.setProfile1NumSeqs(1); // We remove the sequence i from the profile, and paste into the first position // This is to make it easy to do the profile alignment. vector selected; selected.resize(nSeqs + 1, 0); selected[i] = 1; seqVector = iterateAlign.cutSelectedSequencesFromAlignment(&selected); iterateAlign.pasteSequencesIntoPosition(&seqVector, 0); // Remove any gap only columns iterateAlign.removeGapOnlyColsFromSelectedSeqs(&profile1); iterateAlign.removeGapOnlyColsFromSelectedSeqs(&profile2); // Calculate a simple distance matrix. if(nSeqs - 1 >= 2) { for (int i = 1; i <= nSeqs; i++) { for (int j = i + 1; j <= nSeqs; j++) { dscore = iterateAlign.countid(i, j); distMat(i, j) = (100.0 - dscore)/100.0; } } /* temporary tree file * * can't use the safer mkstemp function here, because * we just pass down the filename :( */ char buffer[L_tmpnam]; tmpnam (buffer); p2TreeName = buffer + string(".dnd"); // should test here if file is writable } bool success = false; prof1Weight.clear(); prof1Weight.resize(prof1NumSeqs); prof2Weight.clear(); prof2Weight.resize(nSeqs); tree.getWeightsForProfileAlign(&iterateAlign, &distMat, &p1TreeName, &prof1Weight, &p2TreeName, &prof2Weight, nSeqs, prof1NumSeqs, false, false, &success); remove(p2TreeName.c_str()); if(!success) { /* returning false only means alignment hasn't * changed, but here getWeightsForProfileAlign failed, * most likely because p2TreeName couldn't be read. an * error will be printed to console. clustalw should * then exit, FIXME: clustalx users have to sit * through all error messages until someone * implements a way to return an exit code and react * appropriately */ // does anyone know how to use // (userParameters->getMenuFlag() || // !userParameters->getInteractive() instead? char buf[1024]; utilityObject->myname(buf); if (strcasecmp(buf, "clustalw")==0) { exit(EXIT_FAILURE); } else { // the next two lines were here before the exit // was added. keeping it for clustalx although it // doesnt seem to make any sens userParameters->setDoRemoveFirstIteration(iterate); return false; } } MSA* msaObj = new MSA(); iterateAlign.resetProfile1(); iterateAlign.resetProfile2(); // Do the profile alignment. count = msaObj->doProfileAlign(&iterateAlign, &distMat, &prof1Weight, &prof2Weight); delete msaObj; // Check if its better score = scoreObj.getScore(&iterateAlign); iterateAlign.setProfile1NumSeqs(0); if(score < bestScore) // Might be a problem with this. { //cout << "**********************************************\n"; //cout << "***** Better score found using iteration *****\n"; //cout << "**********************************************\n"; bestScore = score; bestAlignSoFar = iterateAlign; scoreImproved = true; scoreImprovedAnyIteration = true; } distMat.clearArray(); distMat.ResizeRect(nSeqs + 1); } if(scoreImproved == false) { cout << "Score was not improved in last iteration. Exiting...\n"; break; } } // // NOTE if we have improved it, then we need to update the sequences in alnPtr // 1) get the unique id of seq i // 2) get the sequence from new object using id // 3) update the sequence in alnPtr // if(scoreImprovedAnyIteration) // If we need to update the alnPtr object. { cout << "Iteration improved Align score: " << bestScore << "\n"; int seqId; const vector* improvedSeq; for(int i = 1; i <= nSeqs; i++) // For each seq in alnPtr { seqId = alnPtr->getUniqueId(i); improvedSeq = bestAlignSoFar.getSequenceFromUniqueId(seqId); alnPtr->updateSequence(i, improvedSeq); } } cout << "FINAL score: " << bestScore << "\n"; userParameters->setDoRemoveFirstIteration(iterate); return true; // It was successful. } } clustalw-2.1/src/multipleAlign/MSA.h0000644000175000017500000000204711442167171014330 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef MSA_H #define MSA_H #include #include "ProfileBase.h" #include "../alignment/Alignment.h" //#include "../calcAlignSteps/Tree.h" #include "../tree/AlignmentSteps.h" #include "ProfileAlignAlgorithm.h" namespace clustalw { //using tree::AlignmentSteps; class MSA { public: /* Functions */ int multiSeqAlign(Alignment* alnPtr, DistMatrix* distMat, vector* seqWeight, AlignmentSteps* progSteps, int iStart); int seqsAlignToProfile(Alignment* alnPtr, DistMatrix* distMat, vector* seqWeight, int iStart, string phylipName); int calcPairwiseForProfileAlign(Alignment* alnPtr, DistMatrix* distMat); int doProfileAlign(Alignment* alnPtr, DistMatrix* distMat, vector* prof1Weight, vector* prof2Weight); /* Attributes */ private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/multipleAlign/MyersMillerProfileAlign.cpp0000644000175000017500000007363011442167171021011 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. * Changes: Mark 20-6-07, I added a call to calculateMaxlengths */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "MyersMillerProfileAlign.h" #include "Iteration.h" #include namespace clustalw { /** * * @return */ MyersMillerProfileAlign::MyersMillerProfileAlign() : _gapPos1(userParameters->getGapPos1()), _gapPos2(userParameters->getGapPos2()) { } /** * * @param alnPtr * @param distMat * @param group * @param aligned * @return */ int MyersMillerProfileAlign::profileAlign(Alignment* alnPtr, DistMatrix* distMat, vector* group, int* aligned) { bool negative = false; int i = 0, j = 0, count = 0; int numSeq = 0; int seqNum = 0; int len = 0, len1 = 0, len2 = 0, is = 0, minLen = 0; int se1 = 0, se2 = 0, sb1 = 0, sb2 = 0; int maxRes = 0; int c = 0; int score = 0; double logmin = 0.0, logdiff = 0.0; double pcid = 0.0; int matrix[NUMRES][NUMRES]; int numSeqsProf1 = 0, numSeqsProf2 = 0; // Initialise the matrix. To get rid of a valgrind error. for(int i = 0; i < NUMRES; i++) { for(int j = 0; j < NUMRES; j++) { matrix[i][j] = 0; } } numSeq = alnPtr->getNumSeqs(); seqArray.resize(numSeq); alnWeight.resize(numSeq); for (i = 0; i < numSeq; i++) { if (aligned[i + 1] == 0) { (*group)[i + 1] = 0; } } nseqs1 = nseqs2 = 0; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 1) { nseqs1++; } else if ((*group)[i + 1] == 2) { nseqs2++; } } if ((nseqs1 == 0) || (nseqs2 == 0)) { return (0); } numSeqsProf1 = nseqs1; numSeqsProf2 = nseqs2; if (nseqs2 > nseqs1) { switchProfiles = true; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 1) { (*group)[i + 1] = 2; } else if ((*group)[i + 1] == 2) { (*group)[i + 1] = 1; } } } else { switchProfiles = false; } // calculate the mean of the sequence pc identities between the two groups count = 0; pcid = 0.0; negative = userParameters->getUseNegMatrix(); for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 1) { for (j = 0; j < numSeq; j++) { if ((*group)[j + 1] == 2) { count++; pcid += (*distMat)(i + 1, j + 1); } } } } pcid = pcid / (float)count; // Make the first profile. prfLength1 = 0; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 1) { if (alnPtr->getSeqLength(i + 1) > prfLength1) { prfLength1 = alnPtr->getSeqLength(i + 1); } } } nseqs1 = 0; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 1) { len = alnPtr->getSeqLength(i + 1); // initialise with the other vector! seqArray[nseqs1] = vector(alnPtr->getSequence(i + 1)->begin() + 1, alnPtr->getSequence(i + 1)->end()); seqArray[nseqs1].resize(prfLength1 + extraEndElemNum); for (j = len; j < prfLength1; j++) { seqArray[nseqs1][j] = userParameters->getGapPos1(); } alnWeight[nseqs1] = alnPtr->getSeqWeight(i); nseqs1++; } } // Make the second profile. prfLength2 = 0; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 2) { if (alnPtr->getSeqLength(i + 1) > prfLength2) { prfLength2 = alnPtr->getSeqLength(i + 1); } } } nseqs2 = 0; for (i = 0; i < numSeq; i++) { if ((*group)[i + 1] == 2) { len = alnPtr->getSeqLength(i + 1); seqArray[nseqs1 + nseqs2] = vector(alnPtr->getSequence(i + 1)->begin() + 1, alnPtr->getSequence(i + 1)->end()); seqArray[nseqs1 + nseqs2].resize(prfLength2 + extraEndElemNum); for (j = len; j < prfLength2; j++) { seqArray[nseqs1 + nseqs2][j] = userParameters->getGapPos1(); } seqArray[nseqs1 + nseqs2][j] = ENDALN; alnWeight[nseqs1 + nseqs2] = alnPtr->getSeqWeight(i); //cout << "weight " << nseqs1 + nseqs2 << alnWeight[nseqs1 + nseqs2] << "\n"; nseqs2++; } } // Change the Max alignment length in the Alignment Object! alnPtr->setMaxAlnLength(prfLength1 + prfLength2 + 2); // calculate real length of profiles - removing gaps! len1 = 0; for (i = 0; i < nseqs1; i++) { is = 0; for (j = 0; j < utilityObject->MIN(static_cast(seqArray[i].size()), prfLength1); j++) { c = seqArray[i][j]; if ((c != _gapPos1) && (c != _gapPos2)) { is++; } } len1 += is; } len1 = static_cast(len1 / (float)nseqs1); len2 = 0; for (i = nseqs1; i < nseqs2 + nseqs1; i++) { is = 0; for (j = 0; j < utilityObject->MIN(static_cast(seqArray[i].size()), prfLength2); j++) { c = seqArray[i][j]; if ((c != _gapPos1) && (c != _gapPos2)) { is++; } } len2 += is; } len2 = static_cast(len2 / (float)nseqs2); PrfScaleValues scaleVals; scaleVals.scale = 1.0; scaleVals.intScale = 100.0; int matAvgScore = 0; minLen = utilityObject->MIN(len1, len2); maxRes = 0; // Get the substitution matrix that will be stored in 'matrix' maxRes = subMatrix->getProfileAlignMatrix(matrix, pcid, minLen, scaleVals, matAvgScore); if (maxRes == 0 || maxRes == -1) { return -1; } if (userParameters->getDNAFlag()) { gapcoef1 = gapcoef2 = static_cast(100.0 * userParameters->getGapOpen() * scaleVals.scale); lencoef1 = lencoef2 = static_cast(100.0 * userParameters->getGapExtend() * scaleVals.scale); } else { if (len1 == 0 || len2 == 0) { logmin = 1.0; logdiff = 1.0; } else { logmin = 1.0 / log10((double)minLen); if (len2 < len1) { logdiff = 1.0 + 0.5 * log10((double)((float)len2 / (float)len1)); } else if (len1 < len2) { logdiff = 1.0 + 0.5 * log10((double)((float)len1 / (float)len2)); } else { logdiff = 1.0; } if (logdiff < 0.9) { logdiff = 0.9; } } if (negative) { gapcoef1 = gapcoef2 = static_cast(100.0 *(float)(userParameters->getGapOpen())); lencoef1 = lencoef2 = static_cast(100.0 * userParameters->getGapExtend()); } else { if (matAvgScore <= 0) { gapcoef1 = gapcoef2 = static_cast(100.0 *(float)(userParameters->getGapOpen() + logmin)); } else { gapcoef1 = gapcoef2 = static_cast(scaleVals.scale * matAvgScore * (float)(userParameters->getGapOpen() / (logdiff * logmin))); } lencoef1 = lencoef2 = static_cast(100.0 * userParameters->getGapExtend()); } } // We need one profile with substitution matrix information and one without! // But this will change when we have the LE scoring function. profileWithSub = new ProfileWithSub(prfLength1, 0, nseqs1); profileStandard = new ProfileStandard(prfLength2, nseqs1, nseqs1 + nseqs2); // Calculate the profile array with Substitution matrix info // calculate the Gap Coefficients. gaps.resize(alnPtr->getMaxAlnLength() + 1); bool profile1Pen; if (switchProfiles == false) { profile1Pen = userParameters->getStructPenalties1() && userParameters->getUseSS1(); profileWithSub->calcGapCoeff(&seqArray, &gaps, profile1Pen, alnPtr->getGapPenaltyMask1(), gapcoef1, lencoef1); } else { profile1Pen = userParameters->getStructPenalties2() && userParameters->getUseSS2(); profileWithSub->calcGapCoeff(&seqArray, &gaps, profile1Pen, alnPtr->getGapPenaltyMask2(), gapcoef1, lencoef1); } // calculate the profile matrix. profileWithSub->calcProfileWithSub(&seqArray, &gaps, matrix, &alnWeight); profile1 = profileWithSub->getProfilePtr(); if (userParameters->getDebug() > 4) { string aminoAcidCodes = userParameters->getAminoAcidCodes(); for (j = 0; j <= userParameters->getMaxAA(); j++) { cout << aminoAcidCodes[j] << " "; } cout << "\n"; for (i = 0; i < prfLength1; i++) { for (j = 0; j <= userParameters->getMaxAA(); j++) { cout << (*profile1)[i + 1][j] << " "; } cout << (*profile1)[i + 1][_gapPos1]<< " "; cout << (*profile1)[i + 1][_gapPos2]<< " "; cout << (*profile1)[i + 1][GAPCOL] << " " << (*profile1)[i + 1][LENCOL] << "\n"; } } // Calculate the standard profile array // calculate the Gap Coefficients. bool profile2Pen; if (switchProfiles == false) { profile2Pen = userParameters->getStructPenalties2() && userParameters->getUseSS2(); profileStandard->calcGapCoeff(&seqArray, &gaps, profile2Pen, alnPtr->getGapPenaltyMask2(), gapcoef2, lencoef2); } else { profile2Pen = userParameters->getStructPenalties1() && userParameters->getUseSS1(); profileStandard->calcGapCoeff(&seqArray, &gaps, profile2Pen, alnPtr->getGapPenaltyMask1(), gapcoef2, lencoef2); } // calculate the profile matrix. profileStandard->calcStandardProfile(&seqArray, &alnWeight); profile2 = profileStandard->getProfilePtr(); if (userParameters->getDebug() > 4) { string aminoAcidCodes = userParameters->getAminoAcidCodes(); for (j = 0; j <= userParameters->getMaxAA(); j++) { cout << aminoAcidCodes[j] << " "; } cout << "\n"; for (i = 0; i < prfLength2; i++) { for (j = 0; j <= userParameters->getMaxAA(); j++) { cout << (*profile2)[i + 1][j] << " "; } cout << (*profile2)[i + 1][_gapPos1]<< " "; cout << (*profile2)[i + 1][_gapPos2]<< " "; cout << (*profile2)[i + 1][GAPCOL] << " " << (*profile2)[i + 1][LENCOL] << "\n"; } } alnWeight.clear(); int _maxAlnLength = alnPtr->getMaxAlnLength(); alnPath1.resize(_maxAlnLength + 1); alnPath2.resize(_maxAlnLength + 1); //align the profiles // use Myers and Miller to align two sequences lastPrint = 0; printPtr = 1; sb1 = sb2 = 0; se1 = prfLength1; se2 = prfLength2; HH.resize(_maxAlnLength + 1); DD.resize(_maxAlnLength + 1); RR.resize(_maxAlnLength + 1); SS.resize(_maxAlnLength + 1); gS.resize(_maxAlnLength + 1); displ.resize(_maxAlnLength + 1); score = progDiff(sb1, sb2, se1 - sb1, se2 - sb2, (*profile1)[0][GAPCOL], (*profile1)[prfLength1][GAPCOL]); // May not need if we recreate the Profile every time! HH.clear(); DD.clear(); RR.clear(); SS.clear(); gS.clear(); alignmentLength = progTracepath(); displ.clear(); addGGaps(alnPtr, &seqArray); profileStandard->resetProfile(); profileWithSub->resetProfile(); prfLength1 = alignmentLength; alnPath1.clear(); alnPath2.clear(); if(userParameters->getDoRemoveFirstIteration() == TREE) { Iteration iterateObj; iterateObj.iterationOnTreeNode(numSeqsProf1, numSeqsProf2, prfLength1, prfLength2, &seqArray); } // Now we resize the SeqArray that holds the sequences in the alignment class // and also update it with the new aligned sequences SeqArray* newSequences = alnPtr->getSeqArrayForRealloc(); seqNum = 0; for (j = 0; j < numSeq; j++) { if ((*group)[j + 1] == 1) { (*newSequences)[j + 1].clear(); (*newSequences)[j + 1].resize(prfLength1 + 1); for (i = 0; i < prfLength1; i++) { (*newSequences)[j + 1][i + 1] = seqArray[seqNum][i]; } seqNum++; } } for (j = 0; j < numSeq; j++) { if ((*group)[j + 1] == 2) { (*newSequences)[j + 1].clear(); (*newSequences)[j + 1].resize(prfLength1 + 1); for (i = 0; i < prfLength1; i++) { (*newSequences)[j + 1][i + 1] = seqArray[seqNum][i]; } seqNum++; } } alnPtr->calculateMaxLengths(); // Mark change 20-6-07 gaps.clear(); seqArray.clear(); delete profileWithSub; delete profileStandard; int retScore = (score / 100); return retScore; } /** **************************************************************************************** * Private functions * *******************************************************************************************/ /** * * @param A * @param B * @param M * @param N * @param go1 * @param go2 * @return */ int MyersMillerProfileAlign::progDiff(int A, int B, int M, int N, int go1, int go2) { int midi, midj, type; int midh; static int t, tl, g, h; { static int i, j; static int hh, f, e, s; /* Boundary cases: M <= 1 or N == 0 */ if (userParameters->getDebug() > 2) { cout << "A " << A << " B " << B << " M " << M << " N " << N << " midi " << M / 2 << " go1 " << go1 << " go2 " << go2<< "\n"; } /* if sequence B is empty.... */ if (N <= 0) { /* if sequence A is not empty.... */ if (M > 0) { /* delete residues A[1] to A[M] */ progDel(M); } return ( - gapPenalty1(A, B, M)); } /* if sequence A is empty.... */ if (M <= 1) { if (M <= 0) { /* insert residues B[1] to B[N] */ progAdd(N); return ( - gapPenalty2(A, B, N)); } /* if sequence A has just one residue.... */ if (go1 == 0) { midh = - gapPenalty1(A + 1, B + 1, N); } else { midh = - gapPenalty2(A + 1, B, 1) - gapPenalty1(A + 1, B + 1, N); } midj = 0; for (j = 1; j <= N; j++) { hh = - gapPenalty1(A, B + 1, j - 1) + prfScore(A + 1, B + j) - gapPenalty1(A + 1, B + j + 1, N - j); if (hh > midh) { midh = hh; midj = j; } } if (midj == 0) { progAdd(N); progDel(1); } else { if (midj > 1) { progAdd(midj - 1); } progAlign(); if (midj < N) { progAdd(N - midj); } } return midh; } /* Divide sequence A in half: midi */ midi = M / 2; /* In a forward phase, calculate all HH[j] and HH[j] */ HH[0] = 0; t = - openPenalty1(A, B + 1); tl = - extPenalty1(A, B + 1); for (j = 1; j <= N; j++) { HH[j] = t = t + tl; DD[j] = t - openPenalty2(A + 1, B + j); } if (go1 == 0) { t = 0; } else { t = - openPenalty2(A + 1, B); } tl = - extPenalty2(A + 1, B); for (i = 1; i <= midi; i++) { s = HH[0]; HH[0] = hh = t = t + tl; f = t - openPenalty1(A + i, B + 1); for (j = 1; j <= N; j++) { g = openPenalty1(A + i, B + j); h = extPenalty1(A + i, B + j); if ((hh = hh - g - h) > (f = f - h)) { f = hh; } g = openPenalty2(A + i, B + j); h = extPenalty2(A + i, B + j); if ((hh = HH[j] - g - h) > (e = DD[j] - h)) { e = hh; } hh = s + prfScore(A + i, B + j); if (f > hh) { hh = f; } if (e > hh) { hh = e; } s = HH[j]; HH[j] = hh; DD[j] = e; } } DD[0] = HH[0]; /* In a reverse phase, calculate all RR[j] and SS[j] */ RR[N] = 0; tl = 0; for (j = N - 1; j >= 0; j--) { g = - openPenalty1(A + M, B + j + 1); tl -= extPenalty1(A + M, B + j + 1); RR[j] = g + tl; SS[j] = RR[j] - openPenalty2(A + M, B + j); gS[j] = openPenalty2(A + M, B + j); } tl = 0; for (i = M - 1; i >= midi; i--) { s = RR[N]; if (go2 == 0) { g = 0; } else { g = - openPenalty2(A + i + 1, B + N); } tl -= extPenalty2(A + i + 1, B + N); RR[N] = hh = g + tl; t = openPenalty1(A + i, B + N); f = RR[N] - t; for (j = N - 1; j >= 0; j--) { g = openPenalty1(A + i, B + j + 1); h = extPenalty1(A + i, B + j + 1); if ((hh = hh - g - h) > (f = f - h - g + t)) { f = hh; } t = g; g = openPenalty2(A + i + 1, B + j); h = extPenalty2(A + i + 1, B + j); hh = RR[j] - g - h; if (i == (M - 1)) { e = SS[j] - h; } else { e = SS[j] - h - g + openPenalty2(A + i + 2, B + j); gS[j] = g; } if (hh > e) { e = hh; } hh = s + prfScore(A + i + 1, B + j + 1); if (f > hh) { hh = f; } if (e > hh) { hh = e; } s = RR[j]; RR[j] = hh; SS[j] = e; } } SS[N] = RR[N]; gS[N] = openPenalty2(A + midi + 1, B + N); /* find midj, such that HH[j]+RR[j] or DD[j]+SS[j]+gap is the maximum */ midh = HH[0] + RR[0]; midj = 0; type = 1; for (j = 0; j <= N; j++) { hh = HH[j] + RR[j]; if (hh >= midh) if (hh > midh || (HH[j] != DD[j] && RR[j] == SS[j])) { midh = hh; midj = j; } } for (j = N; j >= 0; j--) { hh = DD[j] + SS[j] + gS[j]; if (hh > midh) { midh = hh; midj = j; type = 2; } } } /* Conquer recursively around midpoint */ if (type == 1) { /* Type 1 gaps */ if (userParameters->getDebug() > 2) { cout << "Type 1,1: midj " << midj << "\n"; } progDiff(A, B, midi, midj, go1, 1); if (userParameters->getDebug() > 2) { cout << "Type 1,2: midj " << midj << "\n"; } progDiff(A + midi, B + midj, M - midi, N - midj, 1, go2); } else { if (userParameters->getDebug() > 2) { cout << "Type 2,1: midj " << midj << "\n"; } progDiff(A, B, midi - 1, midj, go1, 0); progDel(2); if (userParameters->getDebug() > 2) { cout << "Type 2,2: midj " << midj << "\n"; } progDiff(A + midi + 1, B + midj, M - midi - 1, N - midj, 0, go2); } return midh; /* Return the score of the best alignment */ } /** * * @param alnPtr * @param seqArray */ void MyersMillerProfileAlign::addGGaps(Alignment* alnPtr, SeqArray* seqArray) { int j; int i, ix; int len; vector ta; ta.resize(alignmentLength + 1); for (j = 0; j < nseqs1; j++) { ix = 0; for (i = 0; i < alignmentLength; i++) { if (alnPath1[i] == 2) { if (ix < ((int)(*seqArray)[j].size() - extraEndElemNum)) { ta[i] = (*seqArray)[j][ix]; } else { ta[i] = ENDALN; } ix++; } else if (alnPath1[i] == 1) { /* insertion in first alignment... */ ta[i] = _gapPos1; } else { cerr << "Error in aln_path\n"; } } ta[i] = ENDALN; len = alignmentLength; (*seqArray)[j].resize(len + 2); for (i = 0; i < len; i++) { (*seqArray)[j][i] = ta[i]; } (*seqArray)[j][len] = ENDALN; } for (j = nseqs1; j < nseqs1 + nseqs2; j++) { ix = 0; for (i = 0; i < alignmentLength; i++) { if (alnPath2[i] == 2) { if (ix < ((int)(*seqArray)[j].size() - extraEndElemNum)) { ta[i] = (*seqArray)[j][ix]; } else { ta[i] = ENDALN; } ix++; } else if (alnPath2[i] == 1) { /* insertion in second alignment... */ ta[i] = _gapPos1; } else { cerr << "Error in alnPath\n"; } } ta[i] = ENDALN; len = alignmentLength; (*seqArray)[j].resize(len + 2); for (i = 0; i < len; i++) { (*seqArray)[j][i] = ta[i]; } (*seqArray)[j][len] = ENDALN; } if (userParameters->getStructPenalties1() != NONE) { addGGapsMask(alnPtr->getGapPenaltyMask1(), alignmentLength, &alnPath1, &alnPath2); } if (userParameters->getStructPenalties1() == SECST) { addGGapsMask(alnPtr->getSecStructMask1(), alignmentLength, &alnPath1, &alnPath2); } if (userParameters->getStructPenalties2() != NONE) { addGGapsMask(alnPtr->getGapPenaltyMask2(), alignmentLength, &alnPath2, &alnPath1); } if (userParameters->getStructPenalties2() == SECST) { addGGapsMask(alnPtr->getSecStructMask2(), alignmentLength, &alnPath2, &alnPath1); } } /** * * @param mask * @param len * @param path1 * @param path2 */ void MyersMillerProfileAlign::addGGapsMask(vector* mask, int len, vector* path1, vector* path2) { int i, ix; char *ta; ta = new char[len + 1]; ix = 0; if (switchProfiles == false) { for (i = 0; i < len; i++) { if ((*path1)[i] == 2) { ta[i] = (*mask)[ix]; ix++; } else if ((*path1)[i] == 1) { ta[i] = _gapPos1; } } } else { for (i = 0; i < len; i++) { if ((*path2)[i] == 2) { ta[i] = (*mask)[ix]; ix++; } else if ((*path2)[i] == 1) { ta[i] = _gapPos1; } } } mask->resize(len + 2); for (i = 0; i < len; i++) { (*mask)[i] = ta[i]; } delete [] ta; ta = NULL; } /** * * @param n * @param m * @return */ inline int MyersMillerProfileAlign::prfScore(int n, int m) { int ix; int score; score = 0; int _maxAA = userParameters->getMaxAA(); // NOTE Change here! for (ix = 0; ix <= _maxAA; ix++) { score += ((*profile1)[n][ix] * (*profile2)[m][ix]); } score += ((*profile1)[n][_gapPos1] * (*profile2)[m][_gapPos1]); score += ((*profile1)[n][_gapPos2] * (*profile2)[m][_gapPos2]); return (score / 10); } /** * * @return */ int MyersMillerProfileAlign::progTracepath() { int i, j, k, pos, toDo; int alignLen; pos = 0; toDo = printPtr - 1; for (i = 1; i <= toDo; ++i) { if (userParameters->getDebug() > 1) { cout << displ[i] << " "; } if (displ[i] == 0) { alnPath1[pos] = 2; alnPath2[pos] = 2; ++pos; } else { if ((k = displ[i]) > 0) { for (j = 0; j <= k - 1; ++j) { alnPath2[pos + j] = 2; alnPath1[pos + j] = 1; } pos += k; } else { k = (displ[i] < 0) ? displ[i] * - 1: displ[i]; for (j = 0; j <= k - 1; ++j) { alnPath1[pos + j] = 2; alnPath2[pos + j] = 1; } pos += k; } } } if (userParameters->getDebug() > 1) { cout << "\n"; } alignLen = pos; return alignLen; } /** * * @param k */ void MyersMillerProfileAlign::progDel(int k) { if (lastPrint < 0) { lastPrint = displ[printPtr - 1] -= k; } else { lastPrint = displ[printPtr++] = - (k); } } /** * * @param k */ void MyersMillerProfileAlign::progAdd(int k) { if (lastPrint < 0) { displ[printPtr - 1] = k; displ[printPtr++] = lastPrint; } else { lastPrint = displ[printPtr++] = k; } } /** * */ void MyersMillerProfileAlign::progAlign() { displ[printPtr++] = lastPrint = 0; } /** * * @param i * @param j * @return */ inline int MyersMillerProfileAlign::openPenalty1(int i, int j) // NOTE Change here! { int g; if (!userParameters->getEndGapPenalties() && (i == 0 || i == prfLength1)) { return (0); } g = (*profile2)[j][GAPCOL] + (*profile1)[i][GAPCOL]; return (g); } /** * * @param i * @param j * @return */ inline int MyersMillerProfileAlign::extPenalty1(int i, int j) // NOTE Change here! { int h; if (!userParameters->getEndGapPenalties() && (i == 0 || i == prfLength1)) { return (0); } h = (*profile2)[j][LENCOL]; return (h); } /** * * @param i * @param j * @param k * @return */ int MyersMillerProfileAlign::gapPenalty1(int i, int j, int k) { int ix; int gp; int g, h = 0; if (k <= 0) { return (0); } if (!userParameters->getEndGapPenalties() && (i == 0 || i == prfLength1)) { return (0); } g = (*profile2)[j][GAPCOL] + (*profile1)[i][GAPCOL]; for (ix = 0; ix < k && ix + j < prfLength2; ix++) { h += (*profile2)[ix + j][LENCOL]; } gp = g + h; return (gp); } /** * * @param i * @param j * @return */ inline int MyersMillerProfileAlign::openPenalty2(int i, int j) // NOTE Change here! { int g; if (!userParameters->getEndGapPenalties() && (j == 0 || j == prfLength2)) { return (0); } g = (*profile1)[i][GAPCOL] + (*profile2)[j][GAPCOL]; return (g); } /** * * @param i * @param j * @return */ inline int MyersMillerProfileAlign::extPenalty2(int i, int j) // NOTE Change here! { int h; if (!userParameters->getEndGapPenalties() && (j == 0 || j == prfLength2)) { return (0); } h = (*profile1)[i][LENCOL]; return (h); } /** * * @param i * @param j * @param k * @return */ int MyersMillerProfileAlign::gapPenalty2(int i, int j, int k) { int ix; int gp; int g, h = 0; if (k <= 0) { return (0); } if (!userParameters->getEndGapPenalties() && (j == 0 || j == prfLength2)) { return (0); } g = (*profile1)[i][GAPCOL] + (*profile2)[j][GAPCOL]; for (ix = 0; ix < k && ix + i < prfLength1; ix++) { h += (*profile1)[ix + i][LENCOL]; } gp = g + h; return (gp); } } clustalw-2.1/src/multipleAlign/ProfileStandard.cpp0000644000175000017500000000510311442167171017320 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ProfileStandard.h" namespace clustalw { /** * * @param prfLen * @param firstS * @param lastS * @return */ ProfileStandard::ProfileStandard(int prfLen, int firstS, int lastS) : ProfileBase(prfLen, firstS, lastS) { } /** * */ void ProfileStandard::resetPrf2() { profile.clear(); } /** * * @param seqArray * @param seqWeight */ void ProfileStandard::calcStandardProfile(SeqArray* seqArray, vector* seqWeight) { /** DONT FORGET TO CHECK THE SIZES ARE CORRECT */ int sum1, sum2; int i, d; int r; int _maxAA = userParameters->getMaxAA(); profile.resize(prfLength + 2, vector(LENCOL + 2)); int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); for (r = 0; r < prfLength; r++) { /* * calculate sum2 = number of residues found in this column */ sum2 = 0; for (i = firstSeq; i < lastSeq; i++) { sum2 += (*seqWeight)[i]; } /* * only include matrix comparison scores for those residue types found in this * column */ if (sum2 == 0) { for (d = 0; d <= _maxAA; d++) { profile[r + 1][d] = 0; } profile[r + 1][_gapPos1] = 0; profile[r + 1][_gapPos2] = 0; } else { for (d = 0; d <= _maxAA; d++) { sum1 = 0; for (i = firstSeq; i < lastSeq; i++) { if (d == (*seqArray)[i][r]) { sum1 += (*seqWeight)[i]; } } profile[r + 1][d] = (int)(10 *(float)sum1 / (float)sum2); } sum1 = 0; for (i = firstSeq; i < lastSeq; i++) { if (_gapPos1 == (*seqArray)[i][r]) { sum1 += (*seqWeight)[i]; } } profile[r + 1][_gapPos1] = (int)(10 *(float)sum1 / (float)sum2); sum1 = 0; for (i = firstSeq; i < lastSeq; i++) { if (_gapPos2 == (*seqArray)[i][r]) { sum1 += (*seqWeight)[i]; } } profile[r + 1][_gapPos2] = (int)(10 *(float)sum1 / (float)sum2); } } } } clustalw-2.1/src/multipleAlign/MSA.cpp0000644000175000017500000004474511442167171014676 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * @author Mark Larkin, Conway Institute, UCD. mark.larkin@ucd.ie * Changes: * * Mark: 23-01-2007: There was a problem with running an alignment with only * one sequence in it. I needed to make a change to the multiSeqAlign function. ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "MSA.h" #include "MyersMillerProfileAlign.h" //#include "../phylogeneticTree/ClusterTree.h" #include "../general/debuglogObject.h" namespace clustalw { /** * * @param alnPtr * @param distMat * @param iStart * @param phylipName * @return */ int MSA::multiSeqAlign(Alignment* alnPtr, DistMatrix* distMat, vector* seqWeight, AlignmentSteps* progSteps, int iStart) { if(!progSteps) { return 0; } int* aligned; vector group; int ix; int* maxid; int max = 0, sum = 0; vector treeWeight; int i = 0, j = 0, set = 0, iseq = 0; int entries = 0; int score = 0; int _numSteps = 0; utilityObject->info("Start of Multiple Alignment\n"); int _numSeqs = alnPtr->getNumSeqs(); vector newOutputIndex(_numSeqs); alnPtr->addSeqWeight(seqWeight); ProfileAlignAlgorithm* alignAlgorithm = new MyersMillerProfileAlign; _numSteps = progSteps->getNumSteps(); // for each sequence, find the most closely related sequence maxid = new int[_numSeqs + 1]; for (i = 1; i <= _numSeqs; i++) { maxid[i] = -1; for (j = 1; j <= _numSeqs; j++) if (j != i && maxid[i] < (*distMat)(i, j)) { maxid[i] = static_cast((*distMat)(i, j)); } } // group the sequences according to their relative divergence if (iStart == 0) { // start the multiple alignments......... utilityObject->info("Aligning..."); // first pass, align closely related sequences first.... ix = 0; aligned = new int[_numSeqs + 1]; for (i = 0; i <= _numSeqs; i++) { aligned[i] = 0; } const vector >* ptrToSets = progSteps->getSteps(); for (set = 1; set <= _numSteps; ++set) { entries = 0; for (i = 1; i <= _numSeqs; i++) { if (((*ptrToSets)[set][i] != 0) && (maxid[i] > userParameters->getDivergenceCutoff())) { entries++; if (aligned[i] == 0) { if (userParameters->getOutputOrder() == INPUT) { ++ix; newOutputIndex[i - 1] = i; } else { if(ix >= (int)newOutputIndex.size()) { cerr << "ERROR: size = " << newOutputIndex.size() << "ix = " << ix << "\n"; exit(1); } else { newOutputIndex[ix] = i; ++ix; } } aligned[i] = 1; } } } if (entries > 0) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Doing profile align"); } #endif score = alignAlgorithm->profileAlign(alnPtr, distMat, progSteps->getStep(set), aligned); } else { score = 0; } // negative score means fatal error... exit now! if (score < 0) { return (-1); } if(userParameters->getDisplayInfo()) { if ((entries > 0) && (score > 0)) { utilityObject->info("Group %d: Sequences:%4d Score:%d", set, entries, score); } else { utilityObject->info("Group %d: Delayed", set); } } } } else { aligned = new int[_numSeqs + 1]; ix = 0; for (i = 1; i <= iStart + 1; i++) { aligned[i] = 1; ++ix; newOutputIndex[i - 1] = i; } for (i = iStart + 2; i <= _numSeqs; i++) { aligned[i] = 0; } } // second pass - align remaining, more divergent sequences..... // if not all sequences were aligned, for each unaligned sequence, // find it's closest pair amongst the aligned sequences. group.resize(_numSeqs + 1); treeWeight.resize(_numSeqs); for (i = 0; i < _numSeqs; i++) { treeWeight[i] = (*seqWeight)[i]; } // if we haven't aligned any sequences, in the first pass - align the // two most closely related sequences now if (ix == 0) { max = -1; iseq = 0; for (i = 1; i <= _numSeqs; i++) { for (j = i + 1; j <= _numSeqs; j++) { if (max < (*distMat)(i, j)) { max = static_cast((*distMat)(i, j)); // Mark change 17-5-07 iseq = i; } } } aligned[iseq] = 1; if (userParameters->getOutputOrder() == INPUT) { ++ix; newOutputIndex[iseq - 1] = iseq; } else { newOutputIndex[ix] = iseq; ++ix; } } while (ix < _numSeqs) { for (i = 1; i <= _numSeqs; i++) { if (aligned[i] == 0) { maxid[i] = - 1; for (j = 1; j <= _numSeqs; j++) if ((maxid[i] < (*distMat)(i, j)) && (aligned[j] != 0)) { maxid[i] = static_cast((*distMat)(i, j));// Mark change 17-5-07 } } } // find the most closely related sequence to those already aligned max = - 1; iseq = 0; for (i = 1; i <= _numSeqs; i++) { if ((aligned[i] == 0) && (maxid[i] > max)) { max = maxid[i]; iseq = i; } } // align this sequence to the existing alignment // weight sequences with percent identity with profile // OR...., multiply sequence weights from tree by percent identity with new sequence if (userParameters->getNoWeights() == false) { for (j = 0; j < _numSeqs; j++) if (aligned[j + 1] != 0) { (*seqWeight)[j] = static_cast(treeWeight[j] * (*distMat)(j + 1, iseq)); } // Normalise the weights, such that the sum of the weights = INT_SCALE_FACTOR sum = 0; for (j = 0; j < _numSeqs; j++) { if (aligned[j + 1] != 0) { sum += (*seqWeight)[j]; } } if (sum == 0) { for (j = 0; j < _numSeqs; j++) { (*seqWeight)[j] = 1; } sum = j; } for (j = 0; j < _numSeqs; j++) { if (aligned[j + 1] != 0) { (*seqWeight)[j] = ((*seqWeight)[j] * INT_SCALE_FACTOR) / sum; if ((*seqWeight)[j] < 1) { (*seqWeight)[j] = 1; } } } } entries = 0; for (j = 1; j <= _numSeqs; j++) { if (aligned[j] != 0) { group[j] = 1; entries++; } else if (iseq == j) { group[j] = 2; entries++; } } alnPtr->addSeqWeight(seqWeight); aligned[iseq] = 1; score = alignAlgorithm->profileAlign(alnPtr, distMat, &group, aligned); if (userParameters->getOutputOrder() == INPUT) { ++ix; newOutputIndex[iseq - 1] = iseq; } else { newOutputIndex[ix] = iseq; ++ix; } } alnPtr->addOutputIndex(&newOutputIndex); if(userParameters->getDisplayInfo()) { int alignmentScore = alnPtr->alignScore(); // ?? check, FS, 2009-05-18 } delete alignAlgorithm; delete [] aligned; delete [] maxid; return (_numSeqs); } /** * * @param alnPtr * @param distMat * @param iStart * @param phylipName * @return */ int MSA::seqsAlignToProfile(Alignment* alnPtr, DistMatrix* distMat, vector* seqWeight, int iStart, string phylipName) { int *aligned; vector treeWeight; vector group; int ix; int *maxid; int max = 0; int i = 0, j = 0, iseq = 0; int sum = 0, entries = 0; int score = 0; int _numSeqs = alnPtr->getNumSeqs(); utilityObject->info("Start of Multiple Alignment\n"); ProfileAlignAlgorithm* alignAlgorithm = new MyersMillerProfileAlign; // calculate sequence weights according to branch lengths of the tree - // weights in global variable seq_weight normalised to sum to 100 vector newOutputIndex(_numSeqs); //groupTree.calcSeqWeights(0, _numSeqs, &seqWeight); treeWeight.resize(_numSeqs); for (i = 0; i < _numSeqs; i++) { treeWeight[i] = (*seqWeight)[i]; } // for each sequence, find the most closely related sequence maxid = new int[_numSeqs + 1]; for (i = 1; i <= _numSeqs; i++) { maxid[i] = - 1; for (j = 1; j <= _numSeqs; j++) { if (maxid[i] < (*distMat)(i, j)) { maxid[i] = static_cast((*distMat)(i, j)); // Mark change 17-5-07 } } } aligned = new int[_numSeqs + 1]; ix = 0; for (i = 1; i <= iStart + 1; i++) { aligned[i] = 1; ++ix; newOutputIndex[i - 1] = i; } for (i = iStart + 2; i <= _numSeqs; i++) { aligned[i] = 0; } // for each unaligned sequence, find it's closest pair amongst the // aligned sequences. group.resize(_numSeqs + 1); while (ix < _numSeqs) { if (ix > 0) { for (i = 1; i <= _numSeqs; i++) { if (aligned[i] == 0) { maxid[i] = - 1; for (j = 1; j <= _numSeqs; j++) { if ((maxid[i] < (*distMat)(i, j)) && (aligned[j] != 0)) { maxid[i] = static_cast((*distMat)(i, j)); } } } } } // find the most closely related sequence to those already aligned max = -1; for (i = 1; i <= _numSeqs; i++) { if ((aligned[i] == 0) && (maxid[i] > max)) { max = maxid[i]; iseq = i; } } // align this sequence to the existing alignment entries = 0; for (j = 1; j <= _numSeqs; j++) { if (aligned[j] != 0) { group[j] = 1; entries++; } else if (iseq == j) { group[j] = 2; entries++; } } aligned[iseq] = 1; // multiply sequence weights from tree by percent // identity with new sequence for (j = 0; j < _numSeqs; j++) { (*seqWeight)[j] = static_cast(treeWeight[j] * (*distMat)(j + 1, iseq)); } // // Normalise the weights, such that the sum of the weights = INT_SCALE_FACTOR // sum = 0; for (j = 0; j < _numSeqs; j++) { if (group[j + 1] == 1) { sum += (*seqWeight)[j]; } } if (sum == 0) { for (j = 0; j < _numSeqs; j++) { (*seqWeight)[j] = 1; } sum = j; } for (j = 0; j < _numSeqs; j++) { (*seqWeight)[j] = ((*seqWeight)[j] * INT_SCALE_FACTOR) / sum; if ((*seqWeight)[j] < 1) { (*seqWeight)[j] = 1; } } // Add the seqWeights to the Alignment object!!!! alnPtr->addSeqWeight(seqWeight); score = alignAlgorithm->profileAlign(alnPtr, distMat, &group, aligned); utilityObject->info("Sequence:%d Score:%d", iseq, score); if (userParameters->getOutputOrder() == INPUT) { ++ix; newOutputIndex[iseq - 1] = iseq; } else { newOutputIndex[ix] = iseq; ++ix; } } delete [] aligned; delete [] maxid; delete alignAlgorithm; alnPtr->addOutputIndex(&newOutputIndex); if(userParameters->getDisplayInfo()) { alnPtr->alignScore(); } return (_numSeqs); } /** * * @param alnPtr * @param distMat * @return */ int MSA::calcPairwiseForProfileAlign(Alignment* alnPtr, DistMatrix* distMat) { //Tree groupTree; int i, j, temp; int entries; int* aligned; vector group; vector seqWeight; float dscore; int score; int _numSeqs = alnPtr->getNumSeqs(); seqWeight.resize(_numSeqs); ProfileAlignAlgorithm* alignAlg = new MyersMillerProfileAlign; utilityObject->info("Start of Initial Alignment"); /* calculate sequence weights according to branch lengths of the tree - * weights in global variable seq_weight normalised to sum to INT_SCALE_FACTOR */ temp = INT_SCALE_FACTOR / _numSeqs; for (i = 0; i < _numSeqs; i++) { seqWeight[i] = temp; } userParameters->setDistanceTree(false); /* do the initial alignment......... */ group.resize(_numSeqs + 1); for (i = 1; i <= alnPtr->getProfile1NumSeqs(); ++i) { group[i] = 1; } for (i = alnPtr->getProfile1NumSeqs() + 1; i <= _numSeqs; ++i) { group[i] = 2; } entries = _numSeqs; aligned = new int[_numSeqs + 1]; for (i = 1; i <= _numSeqs; i++) { aligned[i] = 1; } alnPtr->addSeqWeight(&seqWeight); score = alignAlg->profileAlign(alnPtr, distMat, &group, aligned); utilityObject->info("Sequences:%d Score:%d", entries, score); delete [] aligned; for (i = 1; i <= _numSeqs; i++) { for (j = i + 1; j <= _numSeqs; j++) { dscore = alnPtr->countid(i, j); (*distMat)(i, j) = ((double)100.0 - (double)dscore) / (double)100.0; (*distMat)(j, i) = (*distMat)(i, j); } } delete alignAlg; return (_numSeqs); } /** * * @param alnPtr * @param distMat * @param p1TreeName * @param p2TreeName * @return */ int MSA::doProfileAlign(Alignment* alnPtr, DistMatrix* distMat, vector* prof1Weight, vector* prof2Weight) { //Tree groupTree1, groupTree2; int i, j, sum, entries; int score; int *aligned; vector group; int *maxid; //vector prof1Weight, prof2Weight; int _profile1NumSeqs = alnPtr->getProfile1NumSeqs(); int _numSeqs = alnPtr->getNumSeqs(); vector _seqWeight, _outputIndex; utilityObject->info("Start of Multiple Alignment\n"); _seqWeight.resize(_numSeqs + 1); _outputIndex.resize(_numSeqs); ProfileAlignAlgorithm* alignAlgorithm = new MyersMillerProfileAlign; // weight sequences with max percent identity with other profile maxid = new int[_numSeqs + 1]; for (i = 0; i < _profile1NumSeqs; i++) { maxid[i] = 0; for (j = _profile1NumSeqs + 1; j <= _numSeqs; j++) { if (maxid[i] < (*distMat)(i + 1, j)) { maxid[i] = static_cast((*distMat)(i + 1, j)); // Mark change 17-5-07 } } _seqWeight[i] = maxid[i] * (*prof1Weight)[i]; } for (i = _profile1NumSeqs; i < _numSeqs; i++) { maxid[i] = - 1; for (j = 1; j <= _profile1NumSeqs; j++) { if (maxid[i] < (*distMat)(i + 1, j)) { maxid[i] = static_cast((*distMat)(i + 1, j));// Mark change 17-5-07 } } _seqWeight[i] = maxid[i] * (*prof2Weight)[i]; } // // Normalise the weights, such that the sum of the weights = INT_SCALE_FACTOR // sum = 0; for (j = 0; j < _numSeqs; j++) { sum += _seqWeight[j]; } if (sum == 0) { for (j = 0; j < _numSeqs; j++) { _seqWeight[j] = 1; } sum = j; } for (j = 0; j < _numSeqs; j++) { _seqWeight[j] = (_seqWeight[j] * INT_SCALE_FACTOR) / sum; if (_seqWeight[j] < 1) { _seqWeight[j] = 1; } } // do the alignment......... / utilityObject->info("Aligning..."); group.resize(_numSeqs + 1); for (i = 1; i <= _profile1NumSeqs; ++i) { group[i] = 1; } for (i = _profile1NumSeqs + 1; i <= _numSeqs; ++i) { group[i] = 2; } entries = _numSeqs; aligned = new int[_numSeqs + 1]; for (i = 1; i <= _numSeqs; i++) { aligned[i] = 1; } alnPtr->addSeqWeight(&_seqWeight); score = alignAlgorithm->profileAlign(alnPtr, distMat, &group, aligned); utilityObject->info("Sequences:%d Score:%d", entries, score); for (i = 1; i <= _numSeqs; i++) { _outputIndex[i - 1] = i; } alnPtr->addOutputIndex(&_outputIndex); delete alignAlgorithm; delete [] aligned; delete [] maxid; return (_numSeqs); return 1; } } clustalw-2.1/src/Makefile.am0000644000175000017500000001020511442167172012761 00000000000000# Andreas Wilm (UCD): 2007-12-10 # Generated using the following sites # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html # we do not use GNU-style files: NEWS README AUTHORS ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = #EXTRA_DIST = # got the following with automake 1.10 (AW 2009-05-19): # src/Makefile.am:13: `INCLUDES' is the old name for `AM_CPPFLAGS' (or `*_CPPFLAGS') # deleted next line therefore # INCLUDES = -I@top_srcdir@/ # LDADD = foofiles/libfoo.a bin_PROGRAMS = clustalw2 clustalw2_SOURCES = ./pairwise/PairwiseAlignBase.h \ ./pairwise/FastPairwiseAlign.h \ ./pairwise/FullPairwiseAlign.cpp \ ./pairwise/FullPairwiseAlign.h \ ./pairwise/FastPairwiseAlign.cpp \ ./fileInput/FileParser.h \ ./fileInput/EMBLFileParser.h \ ./fileInput/MSFFileParser.cpp \ ./fileInput/FileReader.cpp \ ./fileInput/PIRFileParser.cpp \ ./fileInput/MSFFileParser.h \ ./fileInput/FileReader.h \ ./fileInput/RSFFileParser.cpp \ ./fileInput/PIRFileParser.h \ ./fileInput/GDEFileParser.cpp \ ./fileInput/RSFFileParser.h \ ./fileInput/GDEFileParser.h \ ./fileInput/InFileStream.cpp \ ./fileInput/ClustalFileParser.cpp \ ./fileInput/PearsonFileParser.cpp \ ./fileInput/InFileStream.h \ ./fileInput/ClustalFileParser.h \ ./fileInput/PearsonFileParser.h \ ./fileInput/FileParser.cpp \ ./fileInput/EMBLFileParser.cpp \ ./tree/UPGMA/RootedClusterTree.cpp \ ./tree/UPGMA/RootedGuideTree.h \ ./tree/UPGMA/UPGMAAlgorithm.cpp \ ./tree/UPGMA/RootedTreeOutput.h \ ./tree/UPGMA/RootedClusterTree.h \ ./tree/UPGMA/Node.cpp \ ./tree/UPGMA/UPGMAAlgorithm.h \ ./tree/UPGMA/upgmadata.h \ ./tree/UPGMA/Node.h \ ./tree/UPGMA/RootedGuideTree.cpp \ ./tree/UPGMA/RootedTreeOutput.cpp \ ./tree/Tree.cpp \ ./tree/ClusterTree.cpp \ ./tree/AlignmentSteps.h \ ./tree/Tree.h \ ./tree/ClusterTree.h \ ./tree/ClusterTreeAlgorithm.h \ ./tree/TreeInterface.cpp \ ./tree/UnRootedClusterTree.cpp \ ./tree/ClusterTreeOutput.cpp \ ./tree/TreeInterface.h \ ./tree/dayhoff.h \ ./tree/UnRootedClusterTree.h \ ./tree/RandomGenerator.cpp \ ./tree/NJTree.cpp \ ./tree/ClusterTreeOutput.h \ ./tree/RandomGenerator.h \ ./tree/NJTree.h \ ./tree/AlignmentSteps.cpp \ ./interface/InteractiveMenu.cpp \ ./interface/CommandLineParser.cpp \ ./interface/InteractiveMenu.h \ ./interface/CommandLineParser.h \ ./substitutionMatrix/SubMatrix.cpp \ ./substitutionMatrix/SubMatrix.h \ ./substitutionMatrix/globalmatrix.h \ ./substitutionMatrix/matrices.h \ ./multipleAlign/Iteration.cpp \ ./multipleAlign/MSA.cpp \ ./multipleAlign/MyersMillerProfileAlign.cpp \ ./multipleAlign/ProfileBase.h \ ./multipleAlign/ProfileStandard.cpp \ ./multipleAlign/LowScoreSegProfile.h \ ./multipleAlign/Iteration.h \ ./multipleAlign/MSA.h \ ./multipleAlign/MyersMillerProfileAlign.h \ ./multipleAlign/ProfileStandard.h \ ./multipleAlign/ProfileWithSub.cpp \ ./multipleAlign/ProfileAlignAlgorithm.h \ ./multipleAlign/ProfileBase.cpp \ ./multipleAlign/ProfileWithSub.h \ ./multipleAlign/LowScoreSegProfile.cpp \ ./general/ClustalWResources.h \ ./general/OutputFile.cpp \ ./general/VectorOutOfRange.h \ ./general/UserParameters.cpp \ ./general/SymMatrix.h \ ./general/Utility.cpp \ ./general/clustalw.h \ ./general/OutputFile.h \ ./general/param.h \ ./general/utils.h \ ./general/UserParameters.h \ ./general/SquareMat.h \ ./general/Utility.h \ ./general/SequenceNotFoundException.h \ ./general/InvalidCombination.cpp \ ./general/Array2D.h \ ./general/RandomAccessLList.h \ ./general/general.h \ ./general/debuglogObject.h \ ./general/statsObject.h \ ./general/userparams.h \ ./general/DebugLog.cpp \ ./general/ClustalWResources.cpp \ ./general/VectorUtility.h \ ./general/VectorOutOfRange.cpp \ ./general/SymMatrix.cpp \ ./general/DebugLog.h \ ./general/Stats.cpp \ ./general/Stats.h \ ./Help.cpp \ ./Help.h \ ./alignment/Alignment.cpp \ ./alignment/AlignmentOutput.cpp \ ./alignment/Alignment.h \ ./alignment/AlignmentOutput.h \ ./alignment/ObjectiveScore.cpp \ ./alignment/Sequence.cpp \ ./alignment/ObjectiveScore.h \ ./alignment/Sequence.h \ ./Clustal.cpp \ ./Clustal.h \ ./clustalw_version.h \ ./main.cpp clustalw-2.1/src/clustalw_version.h0000644000175000017500000000020111467270022014470 00000000000000#ifndef CLUSTALW_VERSION_H #define CLUSTALW_VERSION_H #define CLUSTALW_NAME "ClustalW" #define CLUSTALW_VERSION "2.1" #endif clustalw-2.1/src/Makefile.in0000644000175000017500000036733611457310200013002 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Andreas Wilm (UCD): 2007-12-10 # Generated using the following sites # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = clustalw2$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/clustalw_version.h.in $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = clustalw_version.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_clustalw2_OBJECTS = FullPairwiseAlign.$(OBJEXT) \ FastPairwiseAlign.$(OBJEXT) MSFFileParser.$(OBJEXT) \ FileReader.$(OBJEXT) PIRFileParser.$(OBJEXT) \ RSFFileParser.$(OBJEXT) GDEFileParser.$(OBJEXT) \ InFileStream.$(OBJEXT) ClustalFileParser.$(OBJEXT) \ PearsonFileParser.$(OBJEXT) FileParser.$(OBJEXT) \ EMBLFileParser.$(OBJEXT) RootedClusterTree.$(OBJEXT) \ UPGMAAlgorithm.$(OBJEXT) Node.$(OBJEXT) \ RootedGuideTree.$(OBJEXT) RootedTreeOutput.$(OBJEXT) \ Tree.$(OBJEXT) ClusterTree.$(OBJEXT) TreeInterface.$(OBJEXT) \ UnRootedClusterTree.$(OBJEXT) ClusterTreeOutput.$(OBJEXT) \ RandomGenerator.$(OBJEXT) NJTree.$(OBJEXT) \ AlignmentSteps.$(OBJEXT) InteractiveMenu.$(OBJEXT) \ CommandLineParser.$(OBJEXT) SubMatrix.$(OBJEXT) \ Iteration.$(OBJEXT) MSA.$(OBJEXT) \ MyersMillerProfileAlign.$(OBJEXT) ProfileStandard.$(OBJEXT) \ ProfileWithSub.$(OBJEXT) ProfileBase.$(OBJEXT) \ LowScoreSegProfile.$(OBJEXT) OutputFile.$(OBJEXT) \ UserParameters.$(OBJEXT) Utility.$(OBJEXT) \ InvalidCombination.$(OBJEXT) DebugLog.$(OBJEXT) \ ClustalWResources.$(OBJEXT) VectorOutOfRange.$(OBJEXT) \ SymMatrix.$(OBJEXT) Stats.$(OBJEXT) Help.$(OBJEXT) \ Alignment.$(OBJEXT) AlignmentOutput.$(OBJEXT) \ ObjectiveScore.$(OBJEXT) Sequence.$(OBJEXT) Clustal.$(OBJEXT) \ main.$(OBJEXT) clustalw2_OBJECTS = $(am_clustalw2_OBJECTS) clustalw2_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(clustalw2_SOURCES) DIST_SOURCES = $(clustalw2_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLUSTALW_NAME = @CLUSTALW_NAME@ CLUSTALW_VERSION = @CLUSTALW_VERSION@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # we do not use GNU-style files: NEWS README AUTHORS ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = clustalw2_SOURCES = ./pairwise/PairwiseAlignBase.h \ ./pairwise/FastPairwiseAlign.h \ ./pairwise/FullPairwiseAlign.cpp \ ./pairwise/FullPairwiseAlign.h \ ./pairwise/FastPairwiseAlign.cpp \ ./fileInput/FileParser.h \ ./fileInput/EMBLFileParser.h \ ./fileInput/MSFFileParser.cpp \ ./fileInput/FileReader.cpp \ ./fileInput/PIRFileParser.cpp \ ./fileInput/MSFFileParser.h \ ./fileInput/FileReader.h \ ./fileInput/RSFFileParser.cpp \ ./fileInput/PIRFileParser.h \ ./fileInput/GDEFileParser.cpp \ ./fileInput/RSFFileParser.h \ ./fileInput/GDEFileParser.h \ ./fileInput/InFileStream.cpp \ ./fileInput/ClustalFileParser.cpp \ ./fileInput/PearsonFileParser.cpp \ ./fileInput/InFileStream.h \ ./fileInput/ClustalFileParser.h \ ./fileInput/PearsonFileParser.h \ ./fileInput/FileParser.cpp \ ./fileInput/EMBLFileParser.cpp \ ./tree/UPGMA/RootedClusterTree.cpp \ ./tree/UPGMA/RootedGuideTree.h \ ./tree/UPGMA/UPGMAAlgorithm.cpp \ ./tree/UPGMA/RootedTreeOutput.h \ ./tree/UPGMA/RootedClusterTree.h \ ./tree/UPGMA/Node.cpp \ ./tree/UPGMA/UPGMAAlgorithm.h \ ./tree/UPGMA/upgmadata.h \ ./tree/UPGMA/Node.h \ ./tree/UPGMA/RootedGuideTree.cpp \ ./tree/UPGMA/RootedTreeOutput.cpp \ ./tree/Tree.cpp \ ./tree/ClusterTree.cpp \ ./tree/AlignmentSteps.h \ ./tree/Tree.h \ ./tree/ClusterTree.h \ ./tree/ClusterTreeAlgorithm.h \ ./tree/TreeInterface.cpp \ ./tree/UnRootedClusterTree.cpp \ ./tree/ClusterTreeOutput.cpp \ ./tree/TreeInterface.h \ ./tree/dayhoff.h \ ./tree/UnRootedClusterTree.h \ ./tree/RandomGenerator.cpp \ ./tree/NJTree.cpp \ ./tree/ClusterTreeOutput.h \ ./tree/RandomGenerator.h \ ./tree/NJTree.h \ ./tree/AlignmentSteps.cpp \ ./interface/InteractiveMenu.cpp \ ./interface/CommandLineParser.cpp \ ./interface/InteractiveMenu.h \ ./interface/CommandLineParser.h \ ./substitutionMatrix/SubMatrix.cpp \ ./substitutionMatrix/SubMatrix.h \ ./substitutionMatrix/globalmatrix.h \ ./substitutionMatrix/matrices.h \ ./multipleAlign/Iteration.cpp \ ./multipleAlign/MSA.cpp \ ./multipleAlign/MyersMillerProfileAlign.cpp \ ./multipleAlign/ProfileBase.h \ ./multipleAlign/ProfileStandard.cpp \ ./multipleAlign/LowScoreSegProfile.h \ ./multipleAlign/Iteration.h \ ./multipleAlign/MSA.h \ ./multipleAlign/MyersMillerProfileAlign.h \ ./multipleAlign/ProfileStandard.h \ ./multipleAlign/ProfileWithSub.cpp \ ./multipleAlign/ProfileAlignAlgorithm.h \ ./multipleAlign/ProfileBase.cpp \ ./multipleAlign/ProfileWithSub.h \ ./multipleAlign/LowScoreSegProfile.cpp \ ./general/ClustalWResources.h \ ./general/OutputFile.cpp \ ./general/VectorOutOfRange.h \ ./general/UserParameters.cpp \ ./general/SymMatrix.h \ ./general/Utility.cpp \ ./general/clustalw.h \ ./general/OutputFile.h \ ./general/param.h \ ./general/utils.h \ ./general/UserParameters.h \ ./general/SquareMat.h \ ./general/Utility.h \ ./general/SequenceNotFoundException.h \ ./general/InvalidCombination.cpp \ ./general/Array2D.h \ ./general/RandomAccessLList.h \ ./general/general.h \ ./general/debuglogObject.h \ ./general/statsObject.h \ ./general/userparams.h \ ./general/DebugLog.cpp \ ./general/ClustalWResources.cpp \ ./general/VectorUtility.h \ ./general/VectorOutOfRange.cpp \ ./general/SymMatrix.cpp \ ./general/DebugLog.h \ ./general/Stats.cpp \ ./general/Stats.h \ ./Help.cpp \ ./Help.h \ ./alignment/Alignment.cpp \ ./alignment/AlignmentOutput.cpp \ ./alignment/Alignment.h \ ./alignment/AlignmentOutput.h \ ./alignment/ObjectiveScore.cpp \ ./alignment/Sequence.cpp \ ./alignment/ObjectiveScore.h \ ./alignment/Sequence.h \ ./Clustal.cpp \ ./Clustal.h \ ./clustalw_version.h \ ./main.cpp all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 clustalw_version.h: $(top_builddir)/config.status $(srcdir)/clustalw_version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clustalw2$(EXEEXT): $(clustalw2_OBJECTS) $(clustalw2_DEPENDENCIES) @rm -f clustalw2$(EXEEXT) $(CXXLINK) $(clustalw2_OBJECTS) $(clustalw2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Alignment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AlignmentOutput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AlignmentSteps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Clustal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClustalFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClustalWResources.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClusterTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClusterTreeOutput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CommandLineParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DebugLog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EMBLFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FastPairwiseAlign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileReader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FullPairwiseAlign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GDEFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InFileStream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InteractiveMenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InvalidCombination.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Iteration.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LowScoreSegProfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSA.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MyersMillerProfileAlign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NJTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObjectiveScore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OutputFile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PIRFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PearsonFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProfileBase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProfileStandard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProfileWithSub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RSFFileParser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RandomGenerator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RootedClusterTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RootedGuideTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RootedTreeOutput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sequence.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SubMatrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SymMatrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TreeInterface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UPGMAAlgorithm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UnRootedClusterTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UserParameters.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Utility.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VectorOutOfRange.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` FullPairwiseAlign.o: ./pairwise/FullPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FullPairwiseAlign.o -MD -MP -MF $(DEPDIR)/FullPairwiseAlign.Tpo -c -o FullPairwiseAlign.o `test -f './pairwise/FullPairwiseAlign.cpp' || echo '$(srcdir)/'`./pairwise/FullPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FullPairwiseAlign.Tpo $(DEPDIR)/FullPairwiseAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./pairwise/FullPairwiseAlign.cpp' object='FullPairwiseAlign.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FullPairwiseAlign.o `test -f './pairwise/FullPairwiseAlign.cpp' || echo '$(srcdir)/'`./pairwise/FullPairwiseAlign.cpp FullPairwiseAlign.obj: ./pairwise/FullPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FullPairwiseAlign.obj -MD -MP -MF $(DEPDIR)/FullPairwiseAlign.Tpo -c -o FullPairwiseAlign.obj `if test -f './pairwise/FullPairwiseAlign.cpp'; then $(CYGPATH_W) './pairwise/FullPairwiseAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./pairwise/FullPairwiseAlign.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FullPairwiseAlign.Tpo $(DEPDIR)/FullPairwiseAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./pairwise/FullPairwiseAlign.cpp' object='FullPairwiseAlign.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FullPairwiseAlign.obj `if test -f './pairwise/FullPairwiseAlign.cpp'; then $(CYGPATH_W) './pairwise/FullPairwiseAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./pairwise/FullPairwiseAlign.cpp'; fi` FastPairwiseAlign.o: ./pairwise/FastPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FastPairwiseAlign.o -MD -MP -MF $(DEPDIR)/FastPairwiseAlign.Tpo -c -o FastPairwiseAlign.o `test -f './pairwise/FastPairwiseAlign.cpp' || echo '$(srcdir)/'`./pairwise/FastPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FastPairwiseAlign.Tpo $(DEPDIR)/FastPairwiseAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./pairwise/FastPairwiseAlign.cpp' object='FastPairwiseAlign.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FastPairwiseAlign.o `test -f './pairwise/FastPairwiseAlign.cpp' || echo '$(srcdir)/'`./pairwise/FastPairwiseAlign.cpp FastPairwiseAlign.obj: ./pairwise/FastPairwiseAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FastPairwiseAlign.obj -MD -MP -MF $(DEPDIR)/FastPairwiseAlign.Tpo -c -o FastPairwiseAlign.obj `if test -f './pairwise/FastPairwiseAlign.cpp'; then $(CYGPATH_W) './pairwise/FastPairwiseAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./pairwise/FastPairwiseAlign.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FastPairwiseAlign.Tpo $(DEPDIR)/FastPairwiseAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./pairwise/FastPairwiseAlign.cpp' object='FastPairwiseAlign.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FastPairwiseAlign.obj `if test -f './pairwise/FastPairwiseAlign.cpp'; then $(CYGPATH_W) './pairwise/FastPairwiseAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./pairwise/FastPairwiseAlign.cpp'; fi` MSFFileParser.o: ./fileInput/MSFFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MSFFileParser.o -MD -MP -MF $(DEPDIR)/MSFFileParser.Tpo -c -o MSFFileParser.o `test -f './fileInput/MSFFileParser.cpp' || echo '$(srcdir)/'`./fileInput/MSFFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MSFFileParser.Tpo $(DEPDIR)/MSFFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/MSFFileParser.cpp' object='MSFFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MSFFileParser.o `test -f './fileInput/MSFFileParser.cpp' || echo '$(srcdir)/'`./fileInput/MSFFileParser.cpp MSFFileParser.obj: ./fileInput/MSFFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MSFFileParser.obj -MD -MP -MF $(DEPDIR)/MSFFileParser.Tpo -c -o MSFFileParser.obj `if test -f './fileInput/MSFFileParser.cpp'; then $(CYGPATH_W) './fileInput/MSFFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/MSFFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MSFFileParser.Tpo $(DEPDIR)/MSFFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/MSFFileParser.cpp' object='MSFFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MSFFileParser.obj `if test -f './fileInput/MSFFileParser.cpp'; then $(CYGPATH_W) './fileInput/MSFFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/MSFFileParser.cpp'; fi` FileReader.o: ./fileInput/FileReader.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileReader.o -MD -MP -MF $(DEPDIR)/FileReader.Tpo -c -o FileReader.o `test -f './fileInput/FileReader.cpp' || echo '$(srcdir)/'`./fileInput/FileReader.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FileReader.Tpo $(DEPDIR)/FileReader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/FileReader.cpp' object='FileReader.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileReader.o `test -f './fileInput/FileReader.cpp' || echo '$(srcdir)/'`./fileInput/FileReader.cpp FileReader.obj: ./fileInput/FileReader.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileReader.obj -MD -MP -MF $(DEPDIR)/FileReader.Tpo -c -o FileReader.obj `if test -f './fileInput/FileReader.cpp'; then $(CYGPATH_W) './fileInput/FileReader.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/FileReader.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FileReader.Tpo $(DEPDIR)/FileReader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/FileReader.cpp' object='FileReader.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileReader.obj `if test -f './fileInput/FileReader.cpp'; then $(CYGPATH_W) './fileInput/FileReader.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/FileReader.cpp'; fi` PIRFileParser.o: ./fileInput/PIRFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PIRFileParser.o -MD -MP -MF $(DEPDIR)/PIRFileParser.Tpo -c -o PIRFileParser.o `test -f './fileInput/PIRFileParser.cpp' || echo '$(srcdir)/'`./fileInput/PIRFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/PIRFileParser.Tpo $(DEPDIR)/PIRFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/PIRFileParser.cpp' object='PIRFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PIRFileParser.o `test -f './fileInput/PIRFileParser.cpp' || echo '$(srcdir)/'`./fileInput/PIRFileParser.cpp PIRFileParser.obj: ./fileInput/PIRFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PIRFileParser.obj -MD -MP -MF $(DEPDIR)/PIRFileParser.Tpo -c -o PIRFileParser.obj `if test -f './fileInput/PIRFileParser.cpp'; then $(CYGPATH_W) './fileInput/PIRFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/PIRFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/PIRFileParser.Tpo $(DEPDIR)/PIRFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/PIRFileParser.cpp' object='PIRFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PIRFileParser.obj `if test -f './fileInput/PIRFileParser.cpp'; then $(CYGPATH_W) './fileInput/PIRFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/PIRFileParser.cpp'; fi` RSFFileParser.o: ./fileInput/RSFFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RSFFileParser.o -MD -MP -MF $(DEPDIR)/RSFFileParser.Tpo -c -o RSFFileParser.o `test -f './fileInput/RSFFileParser.cpp' || echo '$(srcdir)/'`./fileInput/RSFFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RSFFileParser.Tpo $(DEPDIR)/RSFFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/RSFFileParser.cpp' object='RSFFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RSFFileParser.o `test -f './fileInput/RSFFileParser.cpp' || echo '$(srcdir)/'`./fileInput/RSFFileParser.cpp RSFFileParser.obj: ./fileInput/RSFFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RSFFileParser.obj -MD -MP -MF $(DEPDIR)/RSFFileParser.Tpo -c -o RSFFileParser.obj `if test -f './fileInput/RSFFileParser.cpp'; then $(CYGPATH_W) './fileInput/RSFFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/RSFFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RSFFileParser.Tpo $(DEPDIR)/RSFFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/RSFFileParser.cpp' object='RSFFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RSFFileParser.obj `if test -f './fileInput/RSFFileParser.cpp'; then $(CYGPATH_W) './fileInput/RSFFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/RSFFileParser.cpp'; fi` GDEFileParser.o: ./fileInput/GDEFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GDEFileParser.o -MD -MP -MF $(DEPDIR)/GDEFileParser.Tpo -c -o GDEFileParser.o `test -f './fileInput/GDEFileParser.cpp' || echo '$(srcdir)/'`./fileInput/GDEFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/GDEFileParser.Tpo $(DEPDIR)/GDEFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/GDEFileParser.cpp' object='GDEFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GDEFileParser.o `test -f './fileInput/GDEFileParser.cpp' || echo '$(srcdir)/'`./fileInput/GDEFileParser.cpp GDEFileParser.obj: ./fileInput/GDEFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GDEFileParser.obj -MD -MP -MF $(DEPDIR)/GDEFileParser.Tpo -c -o GDEFileParser.obj `if test -f './fileInput/GDEFileParser.cpp'; then $(CYGPATH_W) './fileInput/GDEFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/GDEFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/GDEFileParser.Tpo $(DEPDIR)/GDEFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/GDEFileParser.cpp' object='GDEFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GDEFileParser.obj `if test -f './fileInput/GDEFileParser.cpp'; then $(CYGPATH_W) './fileInput/GDEFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/GDEFileParser.cpp'; fi` InFileStream.o: ./fileInput/InFileStream.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InFileStream.o -MD -MP -MF $(DEPDIR)/InFileStream.Tpo -c -o InFileStream.o `test -f './fileInput/InFileStream.cpp' || echo '$(srcdir)/'`./fileInput/InFileStream.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InFileStream.Tpo $(DEPDIR)/InFileStream.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/InFileStream.cpp' object='InFileStream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InFileStream.o `test -f './fileInput/InFileStream.cpp' || echo '$(srcdir)/'`./fileInput/InFileStream.cpp InFileStream.obj: ./fileInput/InFileStream.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InFileStream.obj -MD -MP -MF $(DEPDIR)/InFileStream.Tpo -c -o InFileStream.obj `if test -f './fileInput/InFileStream.cpp'; then $(CYGPATH_W) './fileInput/InFileStream.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/InFileStream.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InFileStream.Tpo $(DEPDIR)/InFileStream.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/InFileStream.cpp' object='InFileStream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InFileStream.obj `if test -f './fileInput/InFileStream.cpp'; then $(CYGPATH_W) './fileInput/InFileStream.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/InFileStream.cpp'; fi` ClustalFileParser.o: ./fileInput/ClustalFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClustalFileParser.o -MD -MP -MF $(DEPDIR)/ClustalFileParser.Tpo -c -o ClustalFileParser.o `test -f './fileInput/ClustalFileParser.cpp' || echo '$(srcdir)/'`./fileInput/ClustalFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClustalFileParser.Tpo $(DEPDIR)/ClustalFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/ClustalFileParser.cpp' object='ClustalFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClustalFileParser.o `test -f './fileInput/ClustalFileParser.cpp' || echo '$(srcdir)/'`./fileInput/ClustalFileParser.cpp ClustalFileParser.obj: ./fileInput/ClustalFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClustalFileParser.obj -MD -MP -MF $(DEPDIR)/ClustalFileParser.Tpo -c -o ClustalFileParser.obj `if test -f './fileInput/ClustalFileParser.cpp'; then $(CYGPATH_W) './fileInput/ClustalFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/ClustalFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClustalFileParser.Tpo $(DEPDIR)/ClustalFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/ClustalFileParser.cpp' object='ClustalFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClustalFileParser.obj `if test -f './fileInput/ClustalFileParser.cpp'; then $(CYGPATH_W) './fileInput/ClustalFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/ClustalFileParser.cpp'; fi` PearsonFileParser.o: ./fileInput/PearsonFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PearsonFileParser.o -MD -MP -MF $(DEPDIR)/PearsonFileParser.Tpo -c -o PearsonFileParser.o `test -f './fileInput/PearsonFileParser.cpp' || echo '$(srcdir)/'`./fileInput/PearsonFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/PearsonFileParser.Tpo $(DEPDIR)/PearsonFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/PearsonFileParser.cpp' object='PearsonFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PearsonFileParser.o `test -f './fileInput/PearsonFileParser.cpp' || echo '$(srcdir)/'`./fileInput/PearsonFileParser.cpp PearsonFileParser.obj: ./fileInput/PearsonFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PearsonFileParser.obj -MD -MP -MF $(DEPDIR)/PearsonFileParser.Tpo -c -o PearsonFileParser.obj `if test -f './fileInput/PearsonFileParser.cpp'; then $(CYGPATH_W) './fileInput/PearsonFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/PearsonFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/PearsonFileParser.Tpo $(DEPDIR)/PearsonFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/PearsonFileParser.cpp' object='PearsonFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PearsonFileParser.obj `if test -f './fileInput/PearsonFileParser.cpp'; then $(CYGPATH_W) './fileInput/PearsonFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/PearsonFileParser.cpp'; fi` FileParser.o: ./fileInput/FileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileParser.o -MD -MP -MF $(DEPDIR)/FileParser.Tpo -c -o FileParser.o `test -f './fileInput/FileParser.cpp' || echo '$(srcdir)/'`./fileInput/FileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FileParser.Tpo $(DEPDIR)/FileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/FileParser.cpp' object='FileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileParser.o `test -f './fileInput/FileParser.cpp' || echo '$(srcdir)/'`./fileInput/FileParser.cpp FileParser.obj: ./fileInput/FileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileParser.obj -MD -MP -MF $(DEPDIR)/FileParser.Tpo -c -o FileParser.obj `if test -f './fileInput/FileParser.cpp'; then $(CYGPATH_W) './fileInput/FileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/FileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/FileParser.Tpo $(DEPDIR)/FileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/FileParser.cpp' object='FileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileParser.obj `if test -f './fileInput/FileParser.cpp'; then $(CYGPATH_W) './fileInput/FileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/FileParser.cpp'; fi` EMBLFileParser.o: ./fileInput/EMBLFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EMBLFileParser.o -MD -MP -MF $(DEPDIR)/EMBLFileParser.Tpo -c -o EMBLFileParser.o `test -f './fileInput/EMBLFileParser.cpp' || echo '$(srcdir)/'`./fileInput/EMBLFileParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/EMBLFileParser.Tpo $(DEPDIR)/EMBLFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/EMBLFileParser.cpp' object='EMBLFileParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EMBLFileParser.o `test -f './fileInput/EMBLFileParser.cpp' || echo '$(srcdir)/'`./fileInput/EMBLFileParser.cpp EMBLFileParser.obj: ./fileInput/EMBLFileParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EMBLFileParser.obj -MD -MP -MF $(DEPDIR)/EMBLFileParser.Tpo -c -o EMBLFileParser.obj `if test -f './fileInput/EMBLFileParser.cpp'; then $(CYGPATH_W) './fileInput/EMBLFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/EMBLFileParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/EMBLFileParser.Tpo $(DEPDIR)/EMBLFileParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./fileInput/EMBLFileParser.cpp' object='EMBLFileParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EMBLFileParser.obj `if test -f './fileInput/EMBLFileParser.cpp'; then $(CYGPATH_W) './fileInput/EMBLFileParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./fileInput/EMBLFileParser.cpp'; fi` RootedClusterTree.o: ./tree/UPGMA/RootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedClusterTree.o -MD -MP -MF $(DEPDIR)/RootedClusterTree.Tpo -c -o RootedClusterTree.o `test -f './tree/UPGMA/RootedClusterTree.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedClusterTree.Tpo $(DEPDIR)/RootedClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedClusterTree.cpp' object='RootedClusterTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedClusterTree.o `test -f './tree/UPGMA/RootedClusterTree.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedClusterTree.cpp RootedClusterTree.obj: ./tree/UPGMA/RootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedClusterTree.obj -MD -MP -MF $(DEPDIR)/RootedClusterTree.Tpo -c -o RootedClusterTree.obj `if test -f './tree/UPGMA/RootedClusterTree.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedClusterTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedClusterTree.Tpo $(DEPDIR)/RootedClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedClusterTree.cpp' object='RootedClusterTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedClusterTree.obj `if test -f './tree/UPGMA/RootedClusterTree.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedClusterTree.cpp'; fi` UPGMAAlgorithm.o: ./tree/UPGMA/UPGMAAlgorithm.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UPGMAAlgorithm.o -MD -MP -MF $(DEPDIR)/UPGMAAlgorithm.Tpo -c -o UPGMAAlgorithm.o `test -f './tree/UPGMA/UPGMAAlgorithm.cpp' || echo '$(srcdir)/'`./tree/UPGMA/UPGMAAlgorithm.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UPGMAAlgorithm.Tpo $(DEPDIR)/UPGMAAlgorithm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/UPGMAAlgorithm.cpp' object='UPGMAAlgorithm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UPGMAAlgorithm.o `test -f './tree/UPGMA/UPGMAAlgorithm.cpp' || echo '$(srcdir)/'`./tree/UPGMA/UPGMAAlgorithm.cpp UPGMAAlgorithm.obj: ./tree/UPGMA/UPGMAAlgorithm.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UPGMAAlgorithm.obj -MD -MP -MF $(DEPDIR)/UPGMAAlgorithm.Tpo -c -o UPGMAAlgorithm.obj `if test -f './tree/UPGMA/UPGMAAlgorithm.cpp'; then $(CYGPATH_W) './tree/UPGMA/UPGMAAlgorithm.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/UPGMAAlgorithm.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UPGMAAlgorithm.Tpo $(DEPDIR)/UPGMAAlgorithm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/UPGMAAlgorithm.cpp' object='UPGMAAlgorithm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UPGMAAlgorithm.obj `if test -f './tree/UPGMA/UPGMAAlgorithm.cpp'; then $(CYGPATH_W) './tree/UPGMA/UPGMAAlgorithm.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/UPGMAAlgorithm.cpp'; fi` Node.o: ./tree/UPGMA/Node.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Node.o -MD -MP -MF $(DEPDIR)/Node.Tpo -c -o Node.o `test -f './tree/UPGMA/Node.cpp' || echo '$(srcdir)/'`./tree/UPGMA/Node.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Node.Tpo $(DEPDIR)/Node.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/Node.cpp' object='Node.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Node.o `test -f './tree/UPGMA/Node.cpp' || echo '$(srcdir)/'`./tree/UPGMA/Node.cpp Node.obj: ./tree/UPGMA/Node.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Node.obj -MD -MP -MF $(DEPDIR)/Node.Tpo -c -o Node.obj `if test -f './tree/UPGMA/Node.cpp'; then $(CYGPATH_W) './tree/UPGMA/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/Node.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Node.Tpo $(DEPDIR)/Node.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/Node.cpp' object='Node.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Node.obj `if test -f './tree/UPGMA/Node.cpp'; then $(CYGPATH_W) './tree/UPGMA/Node.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/Node.cpp'; fi` RootedGuideTree.o: ./tree/UPGMA/RootedGuideTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedGuideTree.o -MD -MP -MF $(DEPDIR)/RootedGuideTree.Tpo -c -o RootedGuideTree.o `test -f './tree/UPGMA/RootedGuideTree.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedGuideTree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedGuideTree.Tpo $(DEPDIR)/RootedGuideTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedGuideTree.cpp' object='RootedGuideTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedGuideTree.o `test -f './tree/UPGMA/RootedGuideTree.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedGuideTree.cpp RootedGuideTree.obj: ./tree/UPGMA/RootedGuideTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedGuideTree.obj -MD -MP -MF $(DEPDIR)/RootedGuideTree.Tpo -c -o RootedGuideTree.obj `if test -f './tree/UPGMA/RootedGuideTree.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedGuideTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedGuideTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedGuideTree.Tpo $(DEPDIR)/RootedGuideTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedGuideTree.cpp' object='RootedGuideTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedGuideTree.obj `if test -f './tree/UPGMA/RootedGuideTree.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedGuideTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedGuideTree.cpp'; fi` RootedTreeOutput.o: ./tree/UPGMA/RootedTreeOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedTreeOutput.o -MD -MP -MF $(DEPDIR)/RootedTreeOutput.Tpo -c -o RootedTreeOutput.o `test -f './tree/UPGMA/RootedTreeOutput.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedTreeOutput.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedTreeOutput.Tpo $(DEPDIR)/RootedTreeOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedTreeOutput.cpp' object='RootedTreeOutput.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedTreeOutput.o `test -f './tree/UPGMA/RootedTreeOutput.cpp' || echo '$(srcdir)/'`./tree/UPGMA/RootedTreeOutput.cpp RootedTreeOutput.obj: ./tree/UPGMA/RootedTreeOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RootedTreeOutput.obj -MD -MP -MF $(DEPDIR)/RootedTreeOutput.Tpo -c -o RootedTreeOutput.obj `if test -f './tree/UPGMA/RootedTreeOutput.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedTreeOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedTreeOutput.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RootedTreeOutput.Tpo $(DEPDIR)/RootedTreeOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UPGMA/RootedTreeOutput.cpp' object='RootedTreeOutput.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RootedTreeOutput.obj `if test -f './tree/UPGMA/RootedTreeOutput.cpp'; then $(CYGPATH_W) './tree/UPGMA/RootedTreeOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UPGMA/RootedTreeOutput.cpp'; fi` Tree.o: ./tree/Tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Tree.o -MD -MP -MF $(DEPDIR)/Tree.Tpo -c -o Tree.o `test -f './tree/Tree.cpp' || echo '$(srcdir)/'`./tree/Tree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Tree.Tpo $(DEPDIR)/Tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/Tree.cpp' object='Tree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Tree.o `test -f './tree/Tree.cpp' || echo '$(srcdir)/'`./tree/Tree.cpp Tree.obj: ./tree/Tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Tree.obj -MD -MP -MF $(DEPDIR)/Tree.Tpo -c -o Tree.obj `if test -f './tree/Tree.cpp'; then $(CYGPATH_W) './tree/Tree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/Tree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Tree.Tpo $(DEPDIR)/Tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/Tree.cpp' object='Tree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Tree.obj `if test -f './tree/Tree.cpp'; then $(CYGPATH_W) './tree/Tree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/Tree.cpp'; fi` ClusterTree.o: ./tree/ClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClusterTree.o -MD -MP -MF $(DEPDIR)/ClusterTree.Tpo -c -o ClusterTree.o `test -f './tree/ClusterTree.cpp' || echo '$(srcdir)/'`./tree/ClusterTree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClusterTree.Tpo $(DEPDIR)/ClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/ClusterTree.cpp' object='ClusterTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClusterTree.o `test -f './tree/ClusterTree.cpp' || echo '$(srcdir)/'`./tree/ClusterTree.cpp ClusterTree.obj: ./tree/ClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClusterTree.obj -MD -MP -MF $(DEPDIR)/ClusterTree.Tpo -c -o ClusterTree.obj `if test -f './tree/ClusterTree.cpp'; then $(CYGPATH_W) './tree/ClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/ClusterTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClusterTree.Tpo $(DEPDIR)/ClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/ClusterTree.cpp' object='ClusterTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClusterTree.obj `if test -f './tree/ClusterTree.cpp'; then $(CYGPATH_W) './tree/ClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/ClusterTree.cpp'; fi` TreeInterface.o: ./tree/TreeInterface.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TreeInterface.o -MD -MP -MF $(DEPDIR)/TreeInterface.Tpo -c -o TreeInterface.o `test -f './tree/TreeInterface.cpp' || echo '$(srcdir)/'`./tree/TreeInterface.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/TreeInterface.Tpo $(DEPDIR)/TreeInterface.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/TreeInterface.cpp' object='TreeInterface.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TreeInterface.o `test -f './tree/TreeInterface.cpp' || echo '$(srcdir)/'`./tree/TreeInterface.cpp TreeInterface.obj: ./tree/TreeInterface.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TreeInterface.obj -MD -MP -MF $(DEPDIR)/TreeInterface.Tpo -c -o TreeInterface.obj `if test -f './tree/TreeInterface.cpp'; then $(CYGPATH_W) './tree/TreeInterface.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/TreeInterface.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/TreeInterface.Tpo $(DEPDIR)/TreeInterface.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/TreeInterface.cpp' object='TreeInterface.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TreeInterface.obj `if test -f './tree/TreeInterface.cpp'; then $(CYGPATH_W) './tree/TreeInterface.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/TreeInterface.cpp'; fi` UnRootedClusterTree.o: ./tree/UnRootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UnRootedClusterTree.o -MD -MP -MF $(DEPDIR)/UnRootedClusterTree.Tpo -c -o UnRootedClusterTree.o `test -f './tree/UnRootedClusterTree.cpp' || echo '$(srcdir)/'`./tree/UnRootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UnRootedClusterTree.Tpo $(DEPDIR)/UnRootedClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UnRootedClusterTree.cpp' object='UnRootedClusterTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UnRootedClusterTree.o `test -f './tree/UnRootedClusterTree.cpp' || echo '$(srcdir)/'`./tree/UnRootedClusterTree.cpp UnRootedClusterTree.obj: ./tree/UnRootedClusterTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UnRootedClusterTree.obj -MD -MP -MF $(DEPDIR)/UnRootedClusterTree.Tpo -c -o UnRootedClusterTree.obj `if test -f './tree/UnRootedClusterTree.cpp'; then $(CYGPATH_W) './tree/UnRootedClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UnRootedClusterTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UnRootedClusterTree.Tpo $(DEPDIR)/UnRootedClusterTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/UnRootedClusterTree.cpp' object='UnRootedClusterTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UnRootedClusterTree.obj `if test -f './tree/UnRootedClusterTree.cpp'; then $(CYGPATH_W) './tree/UnRootedClusterTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/UnRootedClusterTree.cpp'; fi` ClusterTreeOutput.o: ./tree/ClusterTreeOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClusterTreeOutput.o -MD -MP -MF $(DEPDIR)/ClusterTreeOutput.Tpo -c -o ClusterTreeOutput.o `test -f './tree/ClusterTreeOutput.cpp' || echo '$(srcdir)/'`./tree/ClusterTreeOutput.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClusterTreeOutput.Tpo $(DEPDIR)/ClusterTreeOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/ClusterTreeOutput.cpp' object='ClusterTreeOutput.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClusterTreeOutput.o `test -f './tree/ClusterTreeOutput.cpp' || echo '$(srcdir)/'`./tree/ClusterTreeOutput.cpp ClusterTreeOutput.obj: ./tree/ClusterTreeOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClusterTreeOutput.obj -MD -MP -MF $(DEPDIR)/ClusterTreeOutput.Tpo -c -o ClusterTreeOutput.obj `if test -f './tree/ClusterTreeOutput.cpp'; then $(CYGPATH_W) './tree/ClusterTreeOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/ClusterTreeOutput.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClusterTreeOutput.Tpo $(DEPDIR)/ClusterTreeOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/ClusterTreeOutput.cpp' object='ClusterTreeOutput.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClusterTreeOutput.obj `if test -f './tree/ClusterTreeOutput.cpp'; then $(CYGPATH_W) './tree/ClusterTreeOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/ClusterTreeOutput.cpp'; fi` RandomGenerator.o: ./tree/RandomGenerator.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RandomGenerator.o -MD -MP -MF $(DEPDIR)/RandomGenerator.Tpo -c -o RandomGenerator.o `test -f './tree/RandomGenerator.cpp' || echo '$(srcdir)/'`./tree/RandomGenerator.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RandomGenerator.Tpo $(DEPDIR)/RandomGenerator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/RandomGenerator.cpp' object='RandomGenerator.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RandomGenerator.o `test -f './tree/RandomGenerator.cpp' || echo '$(srcdir)/'`./tree/RandomGenerator.cpp RandomGenerator.obj: ./tree/RandomGenerator.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RandomGenerator.obj -MD -MP -MF $(DEPDIR)/RandomGenerator.Tpo -c -o RandomGenerator.obj `if test -f './tree/RandomGenerator.cpp'; then $(CYGPATH_W) './tree/RandomGenerator.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/RandomGenerator.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/RandomGenerator.Tpo $(DEPDIR)/RandomGenerator.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/RandomGenerator.cpp' object='RandomGenerator.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RandomGenerator.obj `if test -f './tree/RandomGenerator.cpp'; then $(CYGPATH_W) './tree/RandomGenerator.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/RandomGenerator.cpp'; fi` NJTree.o: ./tree/NJTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NJTree.o -MD -MP -MF $(DEPDIR)/NJTree.Tpo -c -o NJTree.o `test -f './tree/NJTree.cpp' || echo '$(srcdir)/'`./tree/NJTree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/NJTree.Tpo $(DEPDIR)/NJTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/NJTree.cpp' object='NJTree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NJTree.o `test -f './tree/NJTree.cpp' || echo '$(srcdir)/'`./tree/NJTree.cpp NJTree.obj: ./tree/NJTree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NJTree.obj -MD -MP -MF $(DEPDIR)/NJTree.Tpo -c -o NJTree.obj `if test -f './tree/NJTree.cpp'; then $(CYGPATH_W) './tree/NJTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/NJTree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/NJTree.Tpo $(DEPDIR)/NJTree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/NJTree.cpp' object='NJTree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NJTree.obj `if test -f './tree/NJTree.cpp'; then $(CYGPATH_W) './tree/NJTree.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/NJTree.cpp'; fi` AlignmentSteps.o: ./tree/AlignmentSteps.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AlignmentSteps.o -MD -MP -MF $(DEPDIR)/AlignmentSteps.Tpo -c -o AlignmentSteps.o `test -f './tree/AlignmentSteps.cpp' || echo '$(srcdir)/'`./tree/AlignmentSteps.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/AlignmentSteps.Tpo $(DEPDIR)/AlignmentSteps.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/AlignmentSteps.cpp' object='AlignmentSteps.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AlignmentSteps.o `test -f './tree/AlignmentSteps.cpp' || echo '$(srcdir)/'`./tree/AlignmentSteps.cpp AlignmentSteps.obj: ./tree/AlignmentSteps.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AlignmentSteps.obj -MD -MP -MF $(DEPDIR)/AlignmentSteps.Tpo -c -o AlignmentSteps.obj `if test -f './tree/AlignmentSteps.cpp'; then $(CYGPATH_W) './tree/AlignmentSteps.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/AlignmentSteps.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/AlignmentSteps.Tpo $(DEPDIR)/AlignmentSteps.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./tree/AlignmentSteps.cpp' object='AlignmentSteps.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AlignmentSteps.obj `if test -f './tree/AlignmentSteps.cpp'; then $(CYGPATH_W) './tree/AlignmentSteps.cpp'; else $(CYGPATH_W) '$(srcdir)/./tree/AlignmentSteps.cpp'; fi` InteractiveMenu.o: ./interface/InteractiveMenu.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InteractiveMenu.o -MD -MP -MF $(DEPDIR)/InteractiveMenu.Tpo -c -o InteractiveMenu.o `test -f './interface/InteractiveMenu.cpp' || echo '$(srcdir)/'`./interface/InteractiveMenu.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InteractiveMenu.Tpo $(DEPDIR)/InteractiveMenu.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./interface/InteractiveMenu.cpp' object='InteractiveMenu.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InteractiveMenu.o `test -f './interface/InteractiveMenu.cpp' || echo '$(srcdir)/'`./interface/InteractiveMenu.cpp InteractiveMenu.obj: ./interface/InteractiveMenu.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InteractiveMenu.obj -MD -MP -MF $(DEPDIR)/InteractiveMenu.Tpo -c -o InteractiveMenu.obj `if test -f './interface/InteractiveMenu.cpp'; then $(CYGPATH_W) './interface/InteractiveMenu.cpp'; else $(CYGPATH_W) '$(srcdir)/./interface/InteractiveMenu.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InteractiveMenu.Tpo $(DEPDIR)/InteractiveMenu.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./interface/InteractiveMenu.cpp' object='InteractiveMenu.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InteractiveMenu.obj `if test -f './interface/InteractiveMenu.cpp'; then $(CYGPATH_W) './interface/InteractiveMenu.cpp'; else $(CYGPATH_W) '$(srcdir)/./interface/InteractiveMenu.cpp'; fi` CommandLineParser.o: ./interface/CommandLineParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CommandLineParser.o -MD -MP -MF $(DEPDIR)/CommandLineParser.Tpo -c -o CommandLineParser.o `test -f './interface/CommandLineParser.cpp' || echo '$(srcdir)/'`./interface/CommandLineParser.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CommandLineParser.Tpo $(DEPDIR)/CommandLineParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./interface/CommandLineParser.cpp' object='CommandLineParser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CommandLineParser.o `test -f './interface/CommandLineParser.cpp' || echo '$(srcdir)/'`./interface/CommandLineParser.cpp CommandLineParser.obj: ./interface/CommandLineParser.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CommandLineParser.obj -MD -MP -MF $(DEPDIR)/CommandLineParser.Tpo -c -o CommandLineParser.obj `if test -f './interface/CommandLineParser.cpp'; then $(CYGPATH_W) './interface/CommandLineParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./interface/CommandLineParser.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CommandLineParser.Tpo $(DEPDIR)/CommandLineParser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./interface/CommandLineParser.cpp' object='CommandLineParser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CommandLineParser.obj `if test -f './interface/CommandLineParser.cpp'; then $(CYGPATH_W) './interface/CommandLineParser.cpp'; else $(CYGPATH_W) '$(srcdir)/./interface/CommandLineParser.cpp'; fi` SubMatrix.o: ./substitutionMatrix/SubMatrix.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SubMatrix.o -MD -MP -MF $(DEPDIR)/SubMatrix.Tpo -c -o SubMatrix.o `test -f './substitutionMatrix/SubMatrix.cpp' || echo '$(srcdir)/'`./substitutionMatrix/SubMatrix.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/SubMatrix.Tpo $(DEPDIR)/SubMatrix.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./substitutionMatrix/SubMatrix.cpp' object='SubMatrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SubMatrix.o `test -f './substitutionMatrix/SubMatrix.cpp' || echo '$(srcdir)/'`./substitutionMatrix/SubMatrix.cpp SubMatrix.obj: ./substitutionMatrix/SubMatrix.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SubMatrix.obj -MD -MP -MF $(DEPDIR)/SubMatrix.Tpo -c -o SubMatrix.obj `if test -f './substitutionMatrix/SubMatrix.cpp'; then $(CYGPATH_W) './substitutionMatrix/SubMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./substitutionMatrix/SubMatrix.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/SubMatrix.Tpo $(DEPDIR)/SubMatrix.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./substitutionMatrix/SubMatrix.cpp' object='SubMatrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SubMatrix.obj `if test -f './substitutionMatrix/SubMatrix.cpp'; then $(CYGPATH_W) './substitutionMatrix/SubMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./substitutionMatrix/SubMatrix.cpp'; fi` Iteration.o: ./multipleAlign/Iteration.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Iteration.o -MD -MP -MF $(DEPDIR)/Iteration.Tpo -c -o Iteration.o `test -f './multipleAlign/Iteration.cpp' || echo '$(srcdir)/'`./multipleAlign/Iteration.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Iteration.Tpo $(DEPDIR)/Iteration.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/Iteration.cpp' object='Iteration.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Iteration.o `test -f './multipleAlign/Iteration.cpp' || echo '$(srcdir)/'`./multipleAlign/Iteration.cpp Iteration.obj: ./multipleAlign/Iteration.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Iteration.obj -MD -MP -MF $(DEPDIR)/Iteration.Tpo -c -o Iteration.obj `if test -f './multipleAlign/Iteration.cpp'; then $(CYGPATH_W) './multipleAlign/Iteration.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/Iteration.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Iteration.Tpo $(DEPDIR)/Iteration.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/Iteration.cpp' object='Iteration.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Iteration.obj `if test -f './multipleAlign/Iteration.cpp'; then $(CYGPATH_W) './multipleAlign/Iteration.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/Iteration.cpp'; fi` MSA.o: ./multipleAlign/MSA.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MSA.o -MD -MP -MF $(DEPDIR)/MSA.Tpo -c -o MSA.o `test -f './multipleAlign/MSA.cpp' || echo '$(srcdir)/'`./multipleAlign/MSA.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MSA.Tpo $(DEPDIR)/MSA.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/MSA.cpp' object='MSA.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MSA.o `test -f './multipleAlign/MSA.cpp' || echo '$(srcdir)/'`./multipleAlign/MSA.cpp MSA.obj: ./multipleAlign/MSA.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MSA.obj -MD -MP -MF $(DEPDIR)/MSA.Tpo -c -o MSA.obj `if test -f './multipleAlign/MSA.cpp'; then $(CYGPATH_W) './multipleAlign/MSA.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/MSA.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MSA.Tpo $(DEPDIR)/MSA.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/MSA.cpp' object='MSA.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MSA.obj `if test -f './multipleAlign/MSA.cpp'; then $(CYGPATH_W) './multipleAlign/MSA.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/MSA.cpp'; fi` MyersMillerProfileAlign.o: ./multipleAlign/MyersMillerProfileAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MyersMillerProfileAlign.o -MD -MP -MF $(DEPDIR)/MyersMillerProfileAlign.Tpo -c -o MyersMillerProfileAlign.o `test -f './multipleAlign/MyersMillerProfileAlign.cpp' || echo '$(srcdir)/'`./multipleAlign/MyersMillerProfileAlign.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MyersMillerProfileAlign.Tpo $(DEPDIR)/MyersMillerProfileAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/MyersMillerProfileAlign.cpp' object='MyersMillerProfileAlign.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MyersMillerProfileAlign.o `test -f './multipleAlign/MyersMillerProfileAlign.cpp' || echo '$(srcdir)/'`./multipleAlign/MyersMillerProfileAlign.cpp MyersMillerProfileAlign.obj: ./multipleAlign/MyersMillerProfileAlign.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MyersMillerProfileAlign.obj -MD -MP -MF $(DEPDIR)/MyersMillerProfileAlign.Tpo -c -o MyersMillerProfileAlign.obj `if test -f './multipleAlign/MyersMillerProfileAlign.cpp'; then $(CYGPATH_W) './multipleAlign/MyersMillerProfileAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/MyersMillerProfileAlign.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/MyersMillerProfileAlign.Tpo $(DEPDIR)/MyersMillerProfileAlign.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/MyersMillerProfileAlign.cpp' object='MyersMillerProfileAlign.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MyersMillerProfileAlign.obj `if test -f './multipleAlign/MyersMillerProfileAlign.cpp'; then $(CYGPATH_W) './multipleAlign/MyersMillerProfileAlign.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/MyersMillerProfileAlign.cpp'; fi` ProfileStandard.o: ./multipleAlign/ProfileStandard.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileStandard.o -MD -MP -MF $(DEPDIR)/ProfileStandard.Tpo -c -o ProfileStandard.o `test -f './multipleAlign/ProfileStandard.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileStandard.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileStandard.Tpo $(DEPDIR)/ProfileStandard.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileStandard.cpp' object='ProfileStandard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileStandard.o `test -f './multipleAlign/ProfileStandard.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileStandard.cpp ProfileStandard.obj: ./multipleAlign/ProfileStandard.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileStandard.obj -MD -MP -MF $(DEPDIR)/ProfileStandard.Tpo -c -o ProfileStandard.obj `if test -f './multipleAlign/ProfileStandard.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileStandard.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileStandard.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileStandard.Tpo $(DEPDIR)/ProfileStandard.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileStandard.cpp' object='ProfileStandard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileStandard.obj `if test -f './multipleAlign/ProfileStandard.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileStandard.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileStandard.cpp'; fi` ProfileWithSub.o: ./multipleAlign/ProfileWithSub.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileWithSub.o -MD -MP -MF $(DEPDIR)/ProfileWithSub.Tpo -c -o ProfileWithSub.o `test -f './multipleAlign/ProfileWithSub.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileWithSub.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileWithSub.Tpo $(DEPDIR)/ProfileWithSub.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileWithSub.cpp' object='ProfileWithSub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileWithSub.o `test -f './multipleAlign/ProfileWithSub.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileWithSub.cpp ProfileWithSub.obj: ./multipleAlign/ProfileWithSub.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileWithSub.obj -MD -MP -MF $(DEPDIR)/ProfileWithSub.Tpo -c -o ProfileWithSub.obj `if test -f './multipleAlign/ProfileWithSub.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileWithSub.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileWithSub.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileWithSub.Tpo $(DEPDIR)/ProfileWithSub.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileWithSub.cpp' object='ProfileWithSub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileWithSub.obj `if test -f './multipleAlign/ProfileWithSub.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileWithSub.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileWithSub.cpp'; fi` ProfileBase.o: ./multipleAlign/ProfileBase.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileBase.o -MD -MP -MF $(DEPDIR)/ProfileBase.Tpo -c -o ProfileBase.o `test -f './multipleAlign/ProfileBase.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileBase.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileBase.Tpo $(DEPDIR)/ProfileBase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileBase.cpp' object='ProfileBase.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileBase.o `test -f './multipleAlign/ProfileBase.cpp' || echo '$(srcdir)/'`./multipleAlign/ProfileBase.cpp ProfileBase.obj: ./multipleAlign/ProfileBase.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ProfileBase.obj -MD -MP -MF $(DEPDIR)/ProfileBase.Tpo -c -o ProfileBase.obj `if test -f './multipleAlign/ProfileBase.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileBase.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileBase.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ProfileBase.Tpo $(DEPDIR)/ProfileBase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/ProfileBase.cpp' object='ProfileBase.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ProfileBase.obj `if test -f './multipleAlign/ProfileBase.cpp'; then $(CYGPATH_W) './multipleAlign/ProfileBase.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/ProfileBase.cpp'; fi` LowScoreSegProfile.o: ./multipleAlign/LowScoreSegProfile.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LowScoreSegProfile.o -MD -MP -MF $(DEPDIR)/LowScoreSegProfile.Tpo -c -o LowScoreSegProfile.o `test -f './multipleAlign/LowScoreSegProfile.cpp' || echo '$(srcdir)/'`./multipleAlign/LowScoreSegProfile.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/LowScoreSegProfile.Tpo $(DEPDIR)/LowScoreSegProfile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/LowScoreSegProfile.cpp' object='LowScoreSegProfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LowScoreSegProfile.o `test -f './multipleAlign/LowScoreSegProfile.cpp' || echo '$(srcdir)/'`./multipleAlign/LowScoreSegProfile.cpp LowScoreSegProfile.obj: ./multipleAlign/LowScoreSegProfile.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LowScoreSegProfile.obj -MD -MP -MF $(DEPDIR)/LowScoreSegProfile.Tpo -c -o LowScoreSegProfile.obj `if test -f './multipleAlign/LowScoreSegProfile.cpp'; then $(CYGPATH_W) './multipleAlign/LowScoreSegProfile.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/LowScoreSegProfile.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/LowScoreSegProfile.Tpo $(DEPDIR)/LowScoreSegProfile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./multipleAlign/LowScoreSegProfile.cpp' object='LowScoreSegProfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LowScoreSegProfile.obj `if test -f './multipleAlign/LowScoreSegProfile.cpp'; then $(CYGPATH_W) './multipleAlign/LowScoreSegProfile.cpp'; else $(CYGPATH_W) '$(srcdir)/./multipleAlign/LowScoreSegProfile.cpp'; fi` OutputFile.o: ./general/OutputFile.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OutputFile.o -MD -MP -MF $(DEPDIR)/OutputFile.Tpo -c -o OutputFile.o `test -f './general/OutputFile.cpp' || echo '$(srcdir)/'`./general/OutputFile.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/OutputFile.Tpo $(DEPDIR)/OutputFile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/OutputFile.cpp' object='OutputFile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OutputFile.o `test -f './general/OutputFile.cpp' || echo '$(srcdir)/'`./general/OutputFile.cpp OutputFile.obj: ./general/OutputFile.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OutputFile.obj -MD -MP -MF $(DEPDIR)/OutputFile.Tpo -c -o OutputFile.obj `if test -f './general/OutputFile.cpp'; then $(CYGPATH_W) './general/OutputFile.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/OutputFile.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/OutputFile.Tpo $(DEPDIR)/OutputFile.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/OutputFile.cpp' object='OutputFile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OutputFile.obj `if test -f './general/OutputFile.cpp'; then $(CYGPATH_W) './general/OutputFile.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/OutputFile.cpp'; fi` UserParameters.o: ./general/UserParameters.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UserParameters.o -MD -MP -MF $(DEPDIR)/UserParameters.Tpo -c -o UserParameters.o `test -f './general/UserParameters.cpp' || echo '$(srcdir)/'`./general/UserParameters.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UserParameters.Tpo $(DEPDIR)/UserParameters.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/UserParameters.cpp' object='UserParameters.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UserParameters.o `test -f './general/UserParameters.cpp' || echo '$(srcdir)/'`./general/UserParameters.cpp UserParameters.obj: ./general/UserParameters.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT UserParameters.obj -MD -MP -MF $(DEPDIR)/UserParameters.Tpo -c -o UserParameters.obj `if test -f './general/UserParameters.cpp'; then $(CYGPATH_W) './general/UserParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/UserParameters.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/UserParameters.Tpo $(DEPDIR)/UserParameters.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/UserParameters.cpp' object='UserParameters.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o UserParameters.obj `if test -f './general/UserParameters.cpp'; then $(CYGPATH_W) './general/UserParameters.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/UserParameters.cpp'; fi` Utility.o: ./general/Utility.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Utility.o -MD -MP -MF $(DEPDIR)/Utility.Tpo -c -o Utility.o `test -f './general/Utility.cpp' || echo '$(srcdir)/'`./general/Utility.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Utility.Tpo $(DEPDIR)/Utility.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/Utility.cpp' object='Utility.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Utility.o `test -f './general/Utility.cpp' || echo '$(srcdir)/'`./general/Utility.cpp Utility.obj: ./general/Utility.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Utility.obj -MD -MP -MF $(DEPDIR)/Utility.Tpo -c -o Utility.obj `if test -f './general/Utility.cpp'; then $(CYGPATH_W) './general/Utility.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/Utility.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Utility.Tpo $(DEPDIR)/Utility.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/Utility.cpp' object='Utility.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Utility.obj `if test -f './general/Utility.cpp'; then $(CYGPATH_W) './general/Utility.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/Utility.cpp'; fi` InvalidCombination.o: ./general/InvalidCombination.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InvalidCombination.o -MD -MP -MF $(DEPDIR)/InvalidCombination.Tpo -c -o InvalidCombination.o `test -f './general/InvalidCombination.cpp' || echo '$(srcdir)/'`./general/InvalidCombination.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InvalidCombination.Tpo $(DEPDIR)/InvalidCombination.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/InvalidCombination.cpp' object='InvalidCombination.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InvalidCombination.o `test -f './general/InvalidCombination.cpp' || echo '$(srcdir)/'`./general/InvalidCombination.cpp InvalidCombination.obj: ./general/InvalidCombination.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InvalidCombination.obj -MD -MP -MF $(DEPDIR)/InvalidCombination.Tpo -c -o InvalidCombination.obj `if test -f './general/InvalidCombination.cpp'; then $(CYGPATH_W) './general/InvalidCombination.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/InvalidCombination.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/InvalidCombination.Tpo $(DEPDIR)/InvalidCombination.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/InvalidCombination.cpp' object='InvalidCombination.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InvalidCombination.obj `if test -f './general/InvalidCombination.cpp'; then $(CYGPATH_W) './general/InvalidCombination.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/InvalidCombination.cpp'; fi` DebugLog.o: ./general/DebugLog.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DebugLog.o -MD -MP -MF $(DEPDIR)/DebugLog.Tpo -c -o DebugLog.o `test -f './general/DebugLog.cpp' || echo '$(srcdir)/'`./general/DebugLog.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/DebugLog.Tpo $(DEPDIR)/DebugLog.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/DebugLog.cpp' object='DebugLog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DebugLog.o `test -f './general/DebugLog.cpp' || echo '$(srcdir)/'`./general/DebugLog.cpp DebugLog.obj: ./general/DebugLog.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DebugLog.obj -MD -MP -MF $(DEPDIR)/DebugLog.Tpo -c -o DebugLog.obj `if test -f './general/DebugLog.cpp'; then $(CYGPATH_W) './general/DebugLog.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/DebugLog.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/DebugLog.Tpo $(DEPDIR)/DebugLog.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/DebugLog.cpp' object='DebugLog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DebugLog.obj `if test -f './general/DebugLog.cpp'; then $(CYGPATH_W) './general/DebugLog.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/DebugLog.cpp'; fi` ClustalWResources.o: ./general/ClustalWResources.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClustalWResources.o -MD -MP -MF $(DEPDIR)/ClustalWResources.Tpo -c -o ClustalWResources.o `test -f './general/ClustalWResources.cpp' || echo '$(srcdir)/'`./general/ClustalWResources.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClustalWResources.Tpo $(DEPDIR)/ClustalWResources.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/ClustalWResources.cpp' object='ClustalWResources.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClustalWResources.o `test -f './general/ClustalWResources.cpp' || echo '$(srcdir)/'`./general/ClustalWResources.cpp ClustalWResources.obj: ./general/ClustalWResources.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ClustalWResources.obj -MD -MP -MF $(DEPDIR)/ClustalWResources.Tpo -c -o ClustalWResources.obj `if test -f './general/ClustalWResources.cpp'; then $(CYGPATH_W) './general/ClustalWResources.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/ClustalWResources.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ClustalWResources.Tpo $(DEPDIR)/ClustalWResources.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/ClustalWResources.cpp' object='ClustalWResources.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ClustalWResources.obj `if test -f './general/ClustalWResources.cpp'; then $(CYGPATH_W) './general/ClustalWResources.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/ClustalWResources.cpp'; fi` VectorOutOfRange.o: ./general/VectorOutOfRange.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT VectorOutOfRange.o -MD -MP -MF $(DEPDIR)/VectorOutOfRange.Tpo -c -o VectorOutOfRange.o `test -f './general/VectorOutOfRange.cpp' || echo '$(srcdir)/'`./general/VectorOutOfRange.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/VectorOutOfRange.Tpo $(DEPDIR)/VectorOutOfRange.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/VectorOutOfRange.cpp' object='VectorOutOfRange.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o VectorOutOfRange.o `test -f './general/VectorOutOfRange.cpp' || echo '$(srcdir)/'`./general/VectorOutOfRange.cpp VectorOutOfRange.obj: ./general/VectorOutOfRange.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT VectorOutOfRange.obj -MD -MP -MF $(DEPDIR)/VectorOutOfRange.Tpo -c -o VectorOutOfRange.obj `if test -f './general/VectorOutOfRange.cpp'; then $(CYGPATH_W) './general/VectorOutOfRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/VectorOutOfRange.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/VectorOutOfRange.Tpo $(DEPDIR)/VectorOutOfRange.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/VectorOutOfRange.cpp' object='VectorOutOfRange.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o VectorOutOfRange.obj `if test -f './general/VectorOutOfRange.cpp'; then $(CYGPATH_W) './general/VectorOutOfRange.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/VectorOutOfRange.cpp'; fi` SymMatrix.o: ./general/SymMatrix.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SymMatrix.o -MD -MP -MF $(DEPDIR)/SymMatrix.Tpo -c -o SymMatrix.o `test -f './general/SymMatrix.cpp' || echo '$(srcdir)/'`./general/SymMatrix.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/SymMatrix.Tpo $(DEPDIR)/SymMatrix.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/SymMatrix.cpp' object='SymMatrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SymMatrix.o `test -f './general/SymMatrix.cpp' || echo '$(srcdir)/'`./general/SymMatrix.cpp SymMatrix.obj: ./general/SymMatrix.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SymMatrix.obj -MD -MP -MF $(DEPDIR)/SymMatrix.Tpo -c -o SymMatrix.obj `if test -f './general/SymMatrix.cpp'; then $(CYGPATH_W) './general/SymMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/SymMatrix.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/SymMatrix.Tpo $(DEPDIR)/SymMatrix.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/SymMatrix.cpp' object='SymMatrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SymMatrix.obj `if test -f './general/SymMatrix.cpp'; then $(CYGPATH_W) './general/SymMatrix.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/SymMatrix.cpp'; fi` Stats.o: ./general/Stats.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Stats.o -MD -MP -MF $(DEPDIR)/Stats.Tpo -c -o Stats.o `test -f './general/Stats.cpp' || echo '$(srcdir)/'`./general/Stats.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Stats.Tpo $(DEPDIR)/Stats.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/Stats.cpp' object='Stats.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Stats.o `test -f './general/Stats.cpp' || echo '$(srcdir)/'`./general/Stats.cpp Stats.obj: ./general/Stats.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Stats.obj -MD -MP -MF $(DEPDIR)/Stats.Tpo -c -o Stats.obj `if test -f './general/Stats.cpp'; then $(CYGPATH_W) './general/Stats.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/Stats.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Stats.Tpo $(DEPDIR)/Stats.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./general/Stats.cpp' object='Stats.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Stats.obj `if test -f './general/Stats.cpp'; then $(CYGPATH_W) './general/Stats.cpp'; else $(CYGPATH_W) '$(srcdir)/./general/Stats.cpp'; fi` Help.o: ./Help.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Help.o -MD -MP -MF $(DEPDIR)/Help.Tpo -c -o Help.o `test -f './Help.cpp' || echo '$(srcdir)/'`./Help.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Help.Tpo $(DEPDIR)/Help.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./Help.cpp' object='Help.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Help.o `test -f './Help.cpp' || echo '$(srcdir)/'`./Help.cpp Help.obj: ./Help.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Help.obj -MD -MP -MF $(DEPDIR)/Help.Tpo -c -o Help.obj `if test -f './Help.cpp'; then $(CYGPATH_W) './Help.cpp'; else $(CYGPATH_W) '$(srcdir)/./Help.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Help.Tpo $(DEPDIR)/Help.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./Help.cpp' object='Help.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Help.obj `if test -f './Help.cpp'; then $(CYGPATH_W) './Help.cpp'; else $(CYGPATH_W) '$(srcdir)/./Help.cpp'; fi` Alignment.o: ./alignment/Alignment.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Alignment.o -MD -MP -MF $(DEPDIR)/Alignment.Tpo -c -o Alignment.o `test -f './alignment/Alignment.cpp' || echo '$(srcdir)/'`./alignment/Alignment.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Alignment.Tpo $(DEPDIR)/Alignment.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/Alignment.cpp' object='Alignment.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Alignment.o `test -f './alignment/Alignment.cpp' || echo '$(srcdir)/'`./alignment/Alignment.cpp Alignment.obj: ./alignment/Alignment.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Alignment.obj -MD -MP -MF $(DEPDIR)/Alignment.Tpo -c -o Alignment.obj `if test -f './alignment/Alignment.cpp'; then $(CYGPATH_W) './alignment/Alignment.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/Alignment.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Alignment.Tpo $(DEPDIR)/Alignment.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/Alignment.cpp' object='Alignment.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Alignment.obj `if test -f './alignment/Alignment.cpp'; then $(CYGPATH_W) './alignment/Alignment.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/Alignment.cpp'; fi` AlignmentOutput.o: ./alignment/AlignmentOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AlignmentOutput.o -MD -MP -MF $(DEPDIR)/AlignmentOutput.Tpo -c -o AlignmentOutput.o `test -f './alignment/AlignmentOutput.cpp' || echo '$(srcdir)/'`./alignment/AlignmentOutput.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/AlignmentOutput.Tpo $(DEPDIR)/AlignmentOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/AlignmentOutput.cpp' object='AlignmentOutput.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AlignmentOutput.o `test -f './alignment/AlignmentOutput.cpp' || echo '$(srcdir)/'`./alignment/AlignmentOutput.cpp AlignmentOutput.obj: ./alignment/AlignmentOutput.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT AlignmentOutput.obj -MD -MP -MF $(DEPDIR)/AlignmentOutput.Tpo -c -o AlignmentOutput.obj `if test -f './alignment/AlignmentOutput.cpp'; then $(CYGPATH_W) './alignment/AlignmentOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/AlignmentOutput.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/AlignmentOutput.Tpo $(DEPDIR)/AlignmentOutput.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/AlignmentOutput.cpp' object='AlignmentOutput.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o AlignmentOutput.obj `if test -f './alignment/AlignmentOutput.cpp'; then $(CYGPATH_W) './alignment/AlignmentOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/AlignmentOutput.cpp'; fi` ObjectiveScore.o: ./alignment/ObjectiveScore.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ObjectiveScore.o -MD -MP -MF $(DEPDIR)/ObjectiveScore.Tpo -c -o ObjectiveScore.o `test -f './alignment/ObjectiveScore.cpp' || echo '$(srcdir)/'`./alignment/ObjectiveScore.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ObjectiveScore.Tpo $(DEPDIR)/ObjectiveScore.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/ObjectiveScore.cpp' object='ObjectiveScore.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ObjectiveScore.o `test -f './alignment/ObjectiveScore.cpp' || echo '$(srcdir)/'`./alignment/ObjectiveScore.cpp ObjectiveScore.obj: ./alignment/ObjectiveScore.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ObjectiveScore.obj -MD -MP -MF $(DEPDIR)/ObjectiveScore.Tpo -c -o ObjectiveScore.obj `if test -f './alignment/ObjectiveScore.cpp'; then $(CYGPATH_W) './alignment/ObjectiveScore.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/ObjectiveScore.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ObjectiveScore.Tpo $(DEPDIR)/ObjectiveScore.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/ObjectiveScore.cpp' object='ObjectiveScore.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ObjectiveScore.obj `if test -f './alignment/ObjectiveScore.cpp'; then $(CYGPATH_W) './alignment/ObjectiveScore.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/ObjectiveScore.cpp'; fi` Sequence.o: ./alignment/Sequence.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Sequence.o -MD -MP -MF $(DEPDIR)/Sequence.Tpo -c -o Sequence.o `test -f './alignment/Sequence.cpp' || echo '$(srcdir)/'`./alignment/Sequence.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Sequence.Tpo $(DEPDIR)/Sequence.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/Sequence.cpp' object='Sequence.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Sequence.o `test -f './alignment/Sequence.cpp' || echo '$(srcdir)/'`./alignment/Sequence.cpp Sequence.obj: ./alignment/Sequence.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Sequence.obj -MD -MP -MF $(DEPDIR)/Sequence.Tpo -c -o Sequence.obj `if test -f './alignment/Sequence.cpp'; then $(CYGPATH_W) './alignment/Sequence.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/Sequence.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Sequence.Tpo $(DEPDIR)/Sequence.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./alignment/Sequence.cpp' object='Sequence.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Sequence.obj `if test -f './alignment/Sequence.cpp'; then $(CYGPATH_W) './alignment/Sequence.cpp'; else $(CYGPATH_W) '$(srcdir)/./alignment/Sequence.cpp'; fi` Clustal.o: ./Clustal.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Clustal.o -MD -MP -MF $(DEPDIR)/Clustal.Tpo -c -o Clustal.o `test -f './Clustal.cpp' || echo '$(srcdir)/'`./Clustal.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Clustal.Tpo $(DEPDIR)/Clustal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./Clustal.cpp' object='Clustal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Clustal.o `test -f './Clustal.cpp' || echo '$(srcdir)/'`./Clustal.cpp Clustal.obj: ./Clustal.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Clustal.obj -MD -MP -MF $(DEPDIR)/Clustal.Tpo -c -o Clustal.obj `if test -f './Clustal.cpp'; then $(CYGPATH_W) './Clustal.cpp'; else $(CYGPATH_W) '$(srcdir)/./Clustal.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/Clustal.Tpo $(DEPDIR)/Clustal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./Clustal.cpp' object='Clustal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Clustal.obj `if test -f './Clustal.cpp'; then $(CYGPATH_W) './Clustal.cpp'; else $(CYGPATH_W) '$(srcdir)/./Clustal.cpp'; fi` main.o: ./main.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.o -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.o `test -f './main.cpp' || echo '$(srcdir)/'`./main.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./main.cpp' object='main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.o `test -f './main.cpp' || echo '$(srcdir)/'`./main.cpp main.obj: ./main.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.obj -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.obj `if test -f './main.cpp'; then $(CYGPATH_W) './main.cpp'; else $(CYGPATH_W) '$(srcdir)/./main.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='./main.cpp' object='main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.obj `if test -f './main.cpp'; then $(CYGPATH_W) './main.cpp'; else $(CYGPATH_W) '$(srcdir)/./main.cpp'; fi` # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clustalw-2.1/src/Help.h0000644000175000017500000000135311442167172011772 00000000000000/** * Author: Andreas Wilm * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This is the clustalw help class which replaces the old help file * */ #ifndef HELP_H #define HELP_H #include #include using namespace std; typedef struct { string marker; string title; string content; } section; class Help { public: /* Functions */ Help(); ~Help(); string GetSection(string marker); string GetSection(char marker); string GetSectionTitle(string marker); string GetSectionTitle(char marker); vector ListSectionMarkers(); /* Attributes */ private: /* Functions */ /* Attributes */ vector
sections; }; #endif clustalw-2.1/src/Clustal.h0000644000175000017500000000551211442167172012512 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * The class Clustal is the main class in the program. It is used by the interactive * menu, command line parser and clustal x to perform the algorithmic part of the * program. */ #ifndef CLUSTAL_H #define CLUSTAL_H #include #include "general/clustalw.h" #include "general/utils.h" #include "general/userparams.h" #include "fileInput/FileReader.h" #include "alignment/Alignment.h" #include "alignment/AlignmentOutput.h" using namespace std; namespace clustalw { class Clustal { public: /* Functions */ Clustal(); void align(string* phylipName, bool createOutput = true); void sequencesAlignToProfile(string* phylipName); void profileAlign(string* p1TreeName, string* p2TreeName); void doGuideTreeOnly(string* phylipName); void doAlignUseOldTree(string* phylipName); void getHelp(string helpPointer, bool printTitle = false); void getHelp(char helpPointer, bool printTitle = false); void getFullHelp(); int sequenceInput(bool append, string *offendingSeq); int profile1Input(string profile1Name = ""); int profile2Input(string profile2Name = ""); int commandLineReadSeq(int firstSeq); void outputNow(); void phylogeneticTree(string* phylip_name, string* clustal_name, string* dist_name, string* nexus_name, string pimName); void bootstrapTree(string* phylip_name, string* clustal_name, string* nexus_name); Alignment* getAlignmentPtr(){return &alignmentObj;} void QTcalcLowScoreSegments(LowScoreSegParams* params); void QTcalcWeightsForLowScoreSeg(LowScoreSegParams* params); void QTremoveShortSegments(LowScoreSegParams* params); void QTSetFileNamesForOutput(AlignmentFileNames fileNames); bool QTRealignSelectedRange(AlignmentFileNames fileNames, int beginPos, int endPos, bool realignEndGapPen); void test(); /* Attributes */ private: /* Functions */ void initInterface(); void calcGapPenaltyMask(int prfLength, vector* mask, vector* gapMask); bool useExistingGuideTree(int type, string* phylipName, const string& path); void promptForNewGuideTreeName(int type, string* treeName, const string& path); //bool removeFirstIterate(Alignment* alnPtr, DistMatrix* distMat); /* Attributes */ enum{Sequences, Profile1, Profile2}; string sequencesMsg, profile1Msg, profile2Msg; string newProfile1TreePrompt, newProfile2TreePrompt; Alignment alignmentObj; string helpFileName; int newSeq; bool checkTree; AlignmentFileNames QTFileNames; }; } #endif clustalw-2.1/src/fileInput/0000755000175000017500000000000011467270447012755 500000000000000clustalw-2.1/src/fileInput/ClustalFileParser.h0000644000175000017500000000172111446153305016421 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef CLUSTALFILEPARSER_H #define CLUSTALFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class ClustalFileParser : public FileParser { public: /* Functions */ ClustalFileParser(string filePath); ~ClustalFileParser(); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ bool clustalBlankline(char* line); // Only used in this class! string fileName; /* Attributes */ }; } #endif clustalw-2.1/src/fileInput/PearsonFileParser.h0000644000175000017500000000175511442167171016432 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This file is for parsing pearson format files. * CHANGE: */ #ifndef PEARSONFILEPARSER_H #define PEARSONFILEPARSER_H #include #include "FileParser.h" namespace clustalw { using namespace std; class PearsonFileParser : public FileParser { public: /* Functions */ PearsonFileParser(string filePath); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/MSFFileParser.h0000644000175000017500000000160211442167171015437 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef MSFFILEPARSER_H #define MSFFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class MSFFileParser : public FileParser { public: /* Functions */ MSFFileParser(string filePath); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/PIRFileParser.h0000644000175000017500000000160211442167171015444 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef PIRFILEPARSER_H #define PIRFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class PIRFileParser : public FileParser { public: /* Functions */ PIRFileParser(string filePath); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/RSFFileParser.cpp0000644000175000017500000002776211452730464016020 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RSFFileParser.h" namespace clustalw { /** * Constructor sets up the chartab array. * @param filePath */ RSFFileParser::RSFFileParser(string filePath) { fileName = filePath; fillCharTab(); } vector RSFFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // start at the beginning // Need to get the cursor to the begining of the correct sequence. // This will be the case when we get to the seqNum { while (_currentSeqNum != seqNum) { while(*_line != '{') { if(!_fileIn->getline(_line, MAXLINE + 1)) // If we cannot get anymore! { _fileIn->close(); return Sequence(blank, blank, blank); } } ++_currentSeqNum; if(_currentSeqNum == seqNum) // Found the sequence { break; } // Get next line so that we are past the '{' line _fileIn->getline(_line, MAXLINE + 1); } while (!keyword(_line, "name")) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return Sequence(blank, blank, blank); } } for (i = 5; i <= (int)strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(_sname, _line + i, MAXNAMES); // remember entryname for (i = 0; i <= (int)strlen(_sname); i++) { if (_sname[i] == ' ') { _sname[i] = EOS; break; } } _sname[MAXNAMES] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); // replace blanks with '_' name = string(_sname); while (!keyword(_line, "sequence")) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return Sequence(blank, blank, blank); } } while (_fileIn->getline(_line, MAXLINE + 1)) { for (i = 0; i <= MAXLINE; i++) { c = _line[i]; if (c == EOS || c == '}') { break; } // EOL if (c == '.') { characterSeq += '-'; } c = chartab[c]; if (c) { characterSeq += c; } } if (c == '}') { break; } } _fileIn->close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { _fileIn->close(); cerr << "There was an exception in the RSFFileParser::getSeq function.\n" << "Need to end program\n"; exit(1); } } /** * count the number of sequences in a GCG RSF alignment file * @return The number of sequences in the file. */ int RSFFileParser::countSeqs() { char _line[MAXLINE + 1]; int numSeqs; try { numSeqs = 0; _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // start at the beginning if(!_fileIn->is_open()) { return 0; // No sequences found! } // skip the comments while (_fileIn->getline(_line, MAXLINE + 1)) { // NOTE needed to change to -1 and -2 (it was -2 and -3) // This is because getline does not put the \n in! if (_line[strlen(_line) - 1] == '.' && _line[strlen(_line) - 2] == '.') { break; } } while (_fileIn->getline(_line, MAXLINE + 1)) { if (*_line == '{') { numSeqs++; } } _fileIn->close(); return numSeqs; } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function RSFFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * Get the secondary structure information from the file. * @param gapPenaltyMask * @param secStructMask * @param secStructName * @param structPenalties * @param length */ void RSFFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { bool guigetss = false; if(userParameters->getProfileNum() == 1 && userParameters->getStructPenalties1()) guigetss = true; if(userParameters->getProfileNum() == 2 && userParameters->getStructPenalties2()) guigetss = true; char _title[MAXLINE + 1]; char _line[MAXLINE + 1]; char _lin2[MAXLINE + 1]; char _sname[MAXNAMES + 1]; int i; _line[0] = EOS; try { secStructMask.clear(); secStructMask.assign(length, '.'); _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // Need to start at begining // skip the comments while (_fileIn->getline(_line, MAXLINE + 1)) { if (_line[strlen(_line) - 1] == '.' && _line[strlen(_line) - 2] == '.') { break; } } // find the start of the sequence entry for (;;) { while (_fileIn->getline(_line, MAXLINE + 1)) if (*_line == '{') { break; } while (!keyword(_line, "name")) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return; } } for (i = 5; i <= (int)strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(_sname, _line + i, MAXNAMES); // remember entryname for (i = 0; i <= (int)strlen(_sname); i++) { if (_sname[i] == ' ') { _sname[i] = EOS; break; } } _sname[MAXNAMES] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); // replace blanks with '_' // look for secondary structure feature table / gap penalty mask while (_fileIn->getline(_line, MAXLINE + 1)) { if (keyword(_line, "feature")) { if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(_title, "Found secondary structure in alignment file: "); strcat(_title, _sname); (*_lin2) = utilityObject->promptForYesNo(_title, "Use it to set local gap penalties "); } else { (*_lin2) = 'y'; } if (guigetss || ((*_lin2 != 'n') && (*_lin2 != 'N'))) { structPenalties = SECST; secStructMask.assign(length, '.'); do { if (keyword(_line, "feature")) { getRSFFeature(&_line[7], secStructMask, length); } _fileIn->getline(_line, MAXLINE + 1); } while (!keyword(_line, "sequence")); } else { do { _fileIn->getline(_line, MAXLINE + 1); } while (!keyword(_line, "sequence")); } secStructName = string(_sname); } else if (keyword(_line, "sequence")) { break; } if (structPenalties != NONE) { break; } } } _fileIn->close(); } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function RSFFileParser::getSecStructure()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * get a feature from the file. Called by getSecStructure * @param line * @param secStructMask * @param length */ void RSFFileParser::getRSFFeature(char* line, vector& secStructMask, int length) { char c, s; char str1[MAXLINE + 1], str2[MAXLINE + 1], feature[MAXLINE + 1]; int i, tmp, startPos, endPos; try { if (sscanf(line, "%d%d%d%s%s%s", &startPos, &endPos, &tmp, str1, str2, feature) != 6) { return; } if (strcmp(feature, "HELIX") == 0) { c = 'A'; s = '$'; } else if (strcmp(feature, "STRAND") == 0) { c = 'B'; s = '%'; } else { return ; } if (startPos >= length || endPos >= length) { return ; } secStructMask[startPos - 1] = s; for (i = startPos; i < endPos - 1; i++) { secStructMask[i] = c; } secStructMask[endPos - 1] = s; } catch(...) { cerr << "An exception has occured in the function RSFFileParser::getRSFFeature()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * keyword checks if code is on the line! * @param line * @param code * @return */ bool RSFFileParser::keyword(char *line, const char *code) { int i; char key[MAXLINE]; for (i = 0; !isspace(line[i]) && line[i] != EOS; i++) { key[i] = line[i]; } key[i] = EOS; return (strcmp(key, code) == 0); } } clustalw-2.1/src/fileInput/MSFFileParser.cpp0000644000175000017500000001501311452741266015777 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "MSFFileParser.h" namespace clustalw { /** * MSFFileParser contructor sets up the chartab array. * @param filePath * @return */ MSFFileParser::MSFFileParser(string filePath) { fileName = filePath; fillCharTab(); } vector MSFFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); for (i = 0;; i++) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return Sequence(blank, blank, blank); } // read the title if (utilityObject->lineType(_line, "//")) { break; } // lines...ignore } while (_fileIn->getline(_line, MAXLINE + 1)) { if (!utilityObject->blankLine(_line)) { for (i = 1; i < seqNum; i++) { _fileIn->getline(_line, MAXLINE + 1); } for (j = 0; j <= (int)strlen(_line); j++) { if (_line[j] != ' ') { break; } } for (k = j; k <= (int)strlen(_line); k++) { if (_line[k] == ' ') { break; } } // Get the name of the sequence strncpy(_sname, _line + j, utilityObject->MIN(MAXNAMES, k - j)); _sname[utilityObject->MIN(MAXNAMES, k - j)] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); name = string(_sname); for (i = k; i <= MAXLINE; i++) { c = _line[i]; if (c == '.' || c == '~') { c = '-'; } if (c == '*') { c = 'X'; } if (c == '\n' || c == EOS) { break; } // EOL c = chartab[c]; if (c) { characterSeq += c; } } for (i = 0;; i++) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return Sequence(characterSeq, name, title); } if (utilityObject->blankLine(_line)) { break; } } } } _fileIn->close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title);; } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function MSFFileParser::getSeq()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * The function countSeqs counts the number of sequences in the file. * @return The number of sequences in the file. */ int MSFFileParser::countSeqs() { char _line[MAXLINE + 1]; int _numSeqs; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige if(!_fileIn->is_open()) { return 0; // No sequences found! } while (_fileIn->getline(_line, MAXLINE + 1)) { if (utilityObject->lineType(_line, "//")) { break; } } while (_fileIn->getline(_line, MAXLINE + 1)) { if (!utilityObject->blankLine(_line)) { break; } // Look for next non- blank line } _numSeqs = 1; while (_fileIn->getline(_line, MAXLINE + 1)) { if (utilityObject->blankLineNumericLabel(_line)) { _fileIn->close(); return _numSeqs; } _numSeqs++; } return 0; // if you got to here-funny format/no seqs. } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function MSFFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * There is no secondary structure information in MSF files. Set structPenalties to NONE. * @param gapPenaltyMask * @param secStructMask * @param secStructName * @param structPenalties * @param length */ void MSFFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { structPenalties = NONE; } } clustalw-2.1/src/fileInput/PIRFileParser.cpp0000644000175000017500000001737011442167171016010 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "PIRFileParser.h" namespace clustalw { /** * PIRFileParser contructor sets up the chartab array. * @param filePath */ PIRFileParser::PIRFileParser(string filePath) { fileName = filePath; fillCharTab(); } /* * get range of sequences */ vector PIRFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // Read in lines until we get to the begining of sequence seqNum. while (_currentSeqNum != seqNum) { while(*_line != '>') { if(!_fileIn->getline(_line, MAXLINE + 1)) // If we cannot get anymore! { _fileIn->close(); return Sequence(blank, blank, blank); } } ++_currentSeqNum; if(_currentSeqNum == seqNum) // Found the sequence { break; } // Get next line so that we are past the '>' line _fileIn->getline(_line, MAXLINE + 1); } // line contains the name of the sequence for (i = 4; i <= (int)strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(_sname, _line + i, MAXNAMES); // remember entryname _sname[MAXNAMES] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); // replace blanks with '_' name = string(_sname); _fileIn->getline(_line, MAXLINE + 1); strncpy(_title, _line, MAXTITLES); _title[MAXTITLES] = EOS; i = strlen(_title); if (_title[i - 1] == '\n') { _title[i - 1] = EOS; } title = string(_title); while (_fileIn->getline(_line, MAXLINE + 1)) { for (i = 0; i <= MAXLINE; i++) { c = _line[i]; if (c == '\n' || c == EOS || c == '*') { break; } c = chartab[c]; if (c) { characterSeq += c; } } if (c == '*') { break; } } _fileIn->close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { _fileIn->close(); cerr << "There was an exception in the PIRFileParser::getSeq function.\n" << "Need to end program\n"; exit(1); } } /** * The function countSeqs finds the number of sequences in the file and returns it. * @return The number of sequences in the file. */ int PIRFileParser::countSeqs() { char line[MAXLINE + 1], c; line[0] = EOS; int numSeqs, i; bool seqOk; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige if(!_fileIn->is_open()) { return 0; // No sequences found! } // Get to begining of sequences! while (_fileIn->getline(line, MAXLINE + 1)) { if (!utilityObject->blankLine(line)) { break; } } // Now check the 1st sequence to make sure it ends with * seqOk = false; while (_fileIn->getline(line, MAXLINE + 1)) { // Look for end of first seq if (*line == '>') { break; } for (i = 0; seqOk == false; i++) { c = line[i]; if (c == '*') { seqOk = true; // ok - end of sequence found break; } // EOL if (c == '\n' || c == EOS) { break; } // EOL } if (seqOk == true) { break; } } if (seqOk == false) { _fileIn->close(); utilityObject->error("PIR format sequence end marker '*'\nmissing for one or more sequences.\n"); return 0; // funny format } numSeqs = 1; while (_fileIn->getline(line, MAXLINE + 1)) { if (*line == '>') { // Look for start of next seq seqOk = false; while (_fileIn->getline(line, MAXLINE + 1)) { // Look for end of seq if (*line == '>') { _fileIn->close(); utilityObject->error("PIR format sequence end marker '*'\nmissing for one or more sequences.\n"); return 0; // funny format } for (i = 0; seqOk == false; i++) { c = line[i]; if (c == '*') { seqOk = true; // ok - sequence found break; } if (c == '\n' || c == EOS) { break; } } if (seqOk == true) { numSeqs++; break; } } } } _fileIn->close(); return numSeqs; } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function PIRFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * There is no secondary structure information in PIR files! * @param gapPenaltyMask * @param secStructMask * @param secStructName * @param structPenalties * @param length */ void PIRFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { structPenalties = NONE; } } clustalw-2.1/src/fileInput/RSFFileParser.h0000644000175000017500000000200611442167171015443 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef RSFFILEPARSER_H #define RSFFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class RSFFileParser : public FileParser { public: /* Functions */ RSFFileParser(string filePath); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ void getRSFFeature(char* line, vector& secStructMask, int length); bool keyword(char *line, const char *code); /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/GDEFileParser.cpp0000644000175000017500000003057711452730427015762 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "GDEFileParser.h" namespace clustalw { /* * Constructor sets up the chartab array. * */ GDEFileParser::GDEFileParser(string filePath) { fileName = filePath; fillCharTab(); } /* * Nothing to do in destruction of object. */ GDEFileParser::~GDEFileParser() { } vector GDEFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); bool dnaFlagSet = userParameters->getDNAFlag(); while (_currentSeqNum != seqNum) { while((*_line != '#' && dnaFlagSet) || (*_line != '%' && !dnaFlagSet)) { if(!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return Sequence(blank, blank, blank); } } ++_currentSeqNum; if(_currentSeqNum == seqNum) // Found the sequence { break; } // Get next line so that we are past the '#' or '%' line _fileIn->getline(_line, MAXLINE + 1); //nige } for (i = 1; i <= MAXNAMES; i++) { if (_line[i] == '(' || _line[i] == '\n' || _line[i] == '\r') { break; } _sname[i - 1] = _line[i]; } i--; _sname[i] = EOS; for (i--; i > 0; i--) { if (isspace(_sname[i])) { _sname[i] = EOS; } else { break; } } utilityObject->blankToUnderscore(_sname); name = string(_sname); title = ""; while (_fileIn->getline(_line, MAXLINE + 1)) { if (*_line == '%' || *_line == '#' || *_line == '"') { break; } for (i = 0; i <= MAXLINE; i++) { c = _line[i]; if (c == '\n' || c == EOS) { break; } c = chartab[c]; if (c) { characterSeq += c; } } } _fileIn->close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { _fileIn->close(); cerr << "There was an exception in the GDEnFileParser::getSeq function.\n" << "Need to end program\n"; exit(1); } } /* * The countSeqs function returns the number of sequences in the file. */ int GDEFileParser::countSeqs() { char line[MAXLINE + 1]; int _nseqs = 0; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige if(!_fileIn->is_open()) { return 0; // No sequences found! } while (_fileIn->getline(line, MAXLINE + 1)) { if ((*line == '%') && (userParameters->getDNAFlag() == false)) { _nseqs++; } else if ((*line == '#') && (userParameters->getDNAFlag() == true)) { _nseqs++; } } _fileIn->close(); return _nseqs; } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function GDEFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * getSecStructure gets the secondary structure from the file. */ void GDEFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { bool guigetss = false; if(userParameters->getProfileNum() == 1 && userParameters->getStructPenalties1()) guigetss = true; if(userParameters->getProfileNum() == 2 && userParameters->getStructPenalties2()) guigetss = true; char _title[MAXLINE + 1]; char _line[MAXLINE + 1]; char _lin2[MAXLINE + 1]; char _sname[MAXNAMES + 1]; int i, len, offset = 0; unsigned char c; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // NOTE I think I should empty the masks before pushing onto them! gapPenaltyMask.clear(); secStructMask.clear(); for (;;) { _line[0] = '\0'; // search for the next comment line while (*_line != '"') { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return; } } // is it a secondary structure entry? if (strncmp(&_line[1], "SS_", 3) == 0) { for (i = 1; i <= MAXNAMES - 3; i++) { if (_line[i + 3] == '(' || _line[i + 3] == '\n' || _line[i + 3] == '\r') { break; } _sname[i - 1] = _line[i + 3]; } i--; _sname[i] = EOS; // NOTE NOTE NOTE // Is it possible for this to be executed???????????????? // if _line contains ( then we break and dont put it into _sname // So how can sname have it??????? if (_sname[i - 1] == '(') { sscanf(&_line[i + 3], "%d", &offset); } else { offset = 0; } for (i--; i > 0; i--) { if (isspace(_sname[i])) { _sname[i] = EOS; } else { break; } } utilityObject->blankToUnderscore(_sname); secStructName = string(_sname); if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(_title, "Found secondary structure in alignment file: "); strcat(_title, _sname); (*_lin2) = utilityObject->promptForYesNo(_title, "Use it to set local gap penalties "); } else { (*_lin2) = 'y'; } if (guigetss || ((*_lin2 != 'n') && (*_lin2 != 'N'))) { structPenalties = SECST; for (i = 0; i < length; i++) { secStructMask.push_back('.'); } len = 0; while (_fileIn->getline(_line, MAXLINE + 1)) { if (*_line == '%' || *_line == '#' || *_line == '"') { break; } for (i = offset; i < length; i++) { c = _line[i]; if (c == '\n' || c == EOS) { break; } // EOL secStructMask[len++] = c; } if (len >= length) // NOTE i put in >= { break; } } } } // or is it a gap penalty mask entry? else if (strncmp(&_line[1], "GM_", 3) == 0) { for (i = 1; i <= MAXNAMES - 3; i++) { if (_line[i + 3] == '(' || _line[i + 3] == '\n') { break; } _sname[i - 1] = _line[i + 3]; } i--; _sname[i] = EOS; // NOTE NOTE // Again I dont think it is possible for _sname to have ( !!!! if (_sname[i - 1] == '(') { sscanf(&_line[i + 3], "%d", &offset); } else { offset = 0; } for (i--; i > 0; i--) { if (isspace(_sname[i])) { _sname[i] = EOS; } else { break; } } utilityObject->blankToUnderscore(_sname); secStructName = string(_sname); if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(_title, "Found gap penalty mask in alignment file: "); strcat(_title, _sname); (*_lin2) = utilityObject->promptForYesNo(_title, "Use it to set local gap penalties "); } else { (*_lin2) = 'y'; } if (guigetss || ((*_lin2 != 'n') && (*_lin2 != 'N'))) { structPenalties = GMASK; for (i = 0; i < length; i++) { gapPenaltyMask.push_back('1'); } len = 0; while (_fileIn->getline(_line, MAXLINE + 1)) { if (*_line == '%' || *_line == '#' || *_line == '"') { break; } for (i = offset; i < length; i++) { c = _line[i]; if (c == '\n' || c == EOS) { break; } // EOL gapPenaltyMask[len++] = c; } if (len >= length) // NOTE I put in >= { break; } } } } if (structPenalties != NONE) { break; } } _fileIn->close(); } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function GDEFileParser::getSecStructure()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } } clustalw-2.1/src/fileInput/ClustalFileParser.cpp0000644000175000017500000004332411453342057016763 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. * * 27-4-2007, Mark Larkin (UCD): Made 2 small changes to getSecStructure function. There * was a problem with the secondary structure info in windows. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ClustalFileParser.h" namespace clustalw { ClustalFileParser::ClustalFileParser(string filePath) { fileName = filePath; fillCharTab(); _fileIn = 0; } ClustalFileParser::~ClustalFileParser() { } vector ClustalFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // start at the beginning _fileIn->getline(line, MAXLINE + 1); // read the title line...ignore it while (_fileIn->getline(line, MAXLINE + 1)) //nige { if (!clustalBlankline(line)) { for (i = 1; i < seqNum; i++) { _fileIn->getline(line, MAXLINE + 1); //nige } for (j = 0; j <= (int)strlen(line); j++) if (line[j] != ' ') { break; } string _tempStr = string(line); sscanf(_tempStr.c_str(), "%s%s", sname, tseq); for (j = 0; j < MAXNAMES; j++) { if (sname[j] == ' ') { break; } } sname[j] = EOS; utilityObject->rTrim(sname); utilityObject->blankToUnderscore(sname); // replace blanks with '_' name = string(sname); for (i = 0; i <= MAXLINE; i++) { c = tseq[i]; if (isspace(c) || c == EOS) { break; } // EOL c = chartab[c]; if (c) { characterSeq += c; // Add the character to the sequence } } for (i = 0;; i++) { if (!_fileIn->getline(line, MAXLINE + 1)) // If we cant get another line! { freeFileResources(_fileIn); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } if (clustalBlankline(line)) { break; } } } } freeFileResources(_fileIn); // getSecStructure(vector& gapPenaltyMask, // vector& secStructMask, string& secStructName, int &structPenalties, int length) if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { freeFileResources(_fileIn); cerr << "An exception has occured in the function ClustalFileParser::getSeq()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * The function countSeqs tells us how many sequences are in a clustal format file. * Need to check if the file is open! */ int ClustalFileParser::countSeqs() { char line[MAXLINE + 1]; int _nseqs; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige if(!_fileIn->is_open()) { freeFileResources(_fileIn); return 0; // No sequences found! } while (_fileIn->getline(line, MAXLINE + 1)) { if (!utilityObject->blankLine(line)) { break; } } // This gets us to the begining of the sequence lines! while (_fileIn->getline(line, MAXLINE + 1)) { if (!clustalBlankline(line)) { break; } } _nseqs = 1; while (_fileIn->getline(line, MAXLINE + 1)) { if (clustalBlankline(line)) { freeFileResources(_fileIn); return _nseqs; } _nseqs++; } freeFileResources(_fileIn); return (int)0; // if you got to here-funny format/no seqs. } catch(...) { freeFileResources(_fileIn); cerr << "An exception has occured in the function ClustalFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * This function is to get the secondary structure for a Clustal format file. * I am aware that I am using some C and some C++ here, and this may seem like * bad style, but I think it is better to use the C functions for processing the * strings as they are already working. */ void ClustalFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { bool guigetss = false; if(userParameters->getProfileNum() == 1 && userParameters->getStructPenalties1()) guigetss = true; if(userParameters->getProfileNum() == 2 && userParameters->getStructPenalties2()) guigetss = true; char title[MAXLINE + 1]; title[0] = '\0'; char line[MAXLINE + 1]; line[0] = '\0'; char lin2[MAXLINE + 1]; lin2[0] = '\0'; char tseq[MAXLINE + 1]; tseq[0] = '\0'; char sname[MAXNAMES + 1]; sname[0] = '\0'; for(int i = 1; i < MAXNAMES + 1; i++) { title[i] = line[i] = lin2[i] = tseq[i] = sname[i] ='0'; } int i, j, len, ix, struct_index = 0; char c; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // NOTE clear out the masks gapPenaltyMask.clear(); secStructMask.clear(); len = 0; // initialise length to zero if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } // read the title line...ignore it if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } // read the next line... // skip any blank lines for (;;) { if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } if (!utilityObject->blankLine(line)) { break; } } // look for structure table lines ix = -1; for (;;) { if (line[0] != '!') { break; } if (strncmp(line, "!SS", 3) == 0) { ix++; sscanf(line + 4, "%s%s", sname, tseq); for (j = 0; j < MAXNAMES; j++) { if (sname[j] == ' ') { break; } } sname[j] = EOS; utilityObject->rTrim(sname); utilityObject->blankToUnderscore(sname); if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(title, "Found secondary structure in alignment file: "); strcat(title, sname); (*lin2) = utilityObject->promptForYesNo(title, "Use it to set local gap penalties "); } else { (*lin2) = 'y'; } if (guigetss || ((*lin2 != 'n') && (*lin2 != 'N'))) { structPenalties = SECST; struct_index = ix; for (i = 0; i < length; i++) { secStructMask.push_back('.'); gapPenaltyMask.push_back('.'); } secStructName = string(sname); for (i = 0; len < length; i++) { c = tseq[i]; if (c == '\n' || c == EOS) { break; } // EOL if (!isspace(c)) { if(len < (int)secStructMask.size()) { secStructMask[len++] = c; // NOTE array notation = BAD } } } } } else if (strncmp(line, "!GM", 3) == 0) { ix++; sscanf(line + 4, "%s%s", sname, tseq); for (j = 0; j < MAXNAMES; j++) { if (sname[j] == ' ') { break; } } sname[j] = EOS; utilityObject->rTrim(sname); utilityObject->blankToUnderscore(sname); if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(title, "Found gap penalty mask in alignment file: "); strcat(title, sname); (*lin2) = utilityObject->promptForYesNo(title, "Use it to set local gap penalties "); } else { (*lin2) = 'y'; } if (guigetss || ((*lin2 != 'n') && (*lin2 != 'N'))) { structPenalties = GMASK; struct_index = ix; for (i = 0; i < length; i++) { gapPenaltyMask.push_back('1'); } secStructName = string(sname); for (i = 0; len < length; i++) { c = tseq[i]; if (c == '\n' || c == EOS) { break; } // EOL if (!isspace(c)) { if(len < (int)gapPenaltyMask.size()) { gapPenaltyMask[len++] = c; } } } } } if (structPenalties != NONE) { break; } if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } if (structPenalties == NONE) { freeFileResources(_fileIn); return ; } // skip any more comment lines while (line[0] == '!') { if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } // skip the sequence lines and any comments after the alignment for (;;) { if (isspace(line[0]) || line[0] == '\0') // Mark change 27-4-2007 { break; } if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } // read the rest of the alignment for (;;) { // skip any blank lines for (;;) { if (!utilityObject->blankLine(line)) { break; } if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } // get structure table line for (ix = 0; ix < struct_index; ix++) { if (line[0] != '!') { if (structPenalties == SECST) { utilityObject->error("bad secondary structure format\n"); } else { utilityObject->error("bad gap penalty mask format\n"); } structPenalties = NONE; freeFileResources(_fileIn); return ; } if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } if (structPenalties == SECST) { if (strncmp(line, "!SS", 3) != 0) { utilityObject->error("bad secondary structure format\n"); structPenalties = NONE; freeFileResources(_fileIn); return ; } sscanf(line + 4, "%s%s", sname, tseq); for (i = 0; len < length; i++) { c = tseq[i]; if (c == '\n' || c == EOS) { break; } // EOL if (!isspace(c)) { secStructMask[len++] = c; } } } else if (structPenalties == GMASK) { if (strncmp(line, "!GM", 3) != 0) { utilityObject->error("bad gap penalty mask format\n"); structPenalties = NONE; freeFileResources(_fileIn); return ; } sscanf(line + 4, "%s%s", sname, tseq); for (i = 0; len < length; i++) { c = tseq[i]; if (c == '\n' || c == EOS) { break; } // EOL if (!isspace(c)) { gapPenaltyMask[len++] = c; } } } // skip any more comment lines while (line[0] == '!') { if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } // skip the sequence lines for (;;) { if (isspace(line[0]) || line[0] == '\0') // Mark change 27-4-2007 { break; } if (!_fileIn->getline(line, MAXLINE + 1)) { freeFileResources(_fileIn); return ; } } } freeFileResources(_fileIn); } catch(...) { freeFileResources(_fileIn); cerr << "An exception has occured in the function ClustalFileParser::getSecStructure()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } bool ClustalFileParser::clustalBlankline(char* line) { int i; if (line[0] == '!') { return true; } for (i = 0; line[i] != '\n' && line[i] != EOS; i++) { if (isdigit(line[i]) || isspace(line[i]) || (line[i] == '*') || (line[i] == ':') || (line[i] == '.')) ; else { return false; } } return true; } } clustalw-2.1/src/fileInput/InFileStream.h0000644000175000017500000000243711442167171015366 00000000000000/** * Author: Nigel Brown * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * InFileStream subclasses std::ifstream, adding a check for the end-of-line * character convention in the input file. This is then used by the getline() * member as the line delimiter, unless the caller supplies an explicit * delimiter. * * Created: 09-02-07,Nigel Brown(EMBL) ***************************************************************************/ #ifndef INFILESTREAM_H #define INFILESTREAM_H #include #include #include #include class InFileStream : public std::ifstream { public: InFileStream(); InFileStream(const char *filename); //- InFileStream(const InFileStream ©); void open(const char *filename); void close(); //int get(); //bool is_open(); std::istream& getline(char *s, std::streamsize n);/*{return ifstream::getline(s, n, delim);}*/ std::istream& getline(char *s, std::streamsize n, char delim); /*{ return ifstream::getline(s, n, delim); }*/ protected: char findDelimiter(); private: //disable copy-constructor InFileStream(const InFileStream ©); std::string filename; //auto_ptr inFile; char delim; }; #endif //INFILESTREAM_H clustalw-2.1/src/fileInput/FileReader.cpp0000644000175000017500000004116411452364137015403 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. * * 23-03-07,Nigel Brown(EMBL): added call to Alignment::testUniqueNames() to * test sequence names prior to appending; moved * Alignment::checkAllNamesDifferent() test into block handling loading of new * sequences. * * 02-04-07,Nigel Brown(EMBL): commented out the "No sequences in file..." * warnings in seqInput() and profileInput()and enabled the * higher-up-the-stack counterpart in MainWindow::errorHandler(), since the * former was causing a crash during the repaint after the user accepts the * message, because some state (what exactly?) is unstable at this depth after * a sequence load error, specifically when loading an empty file after * already loading some sequences. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "FileReader.h" namespace clustalw { FileReader::FileReader() { fileIn = new InFileStream; structPenalties = NONE; // I think this should be ok. } FileReader::~FileReader() { delete fileIn; } /* check if we've read sequences without any information, i.e. header * but no sequence at all */ bool FileReader::noEmptySequence(vector seqVector, string *offendingSeq) { vector::iterator si; for (si = seqVector.begin(); si != seqVector.end(); si++) { if (si->isEmpty()) { offendingSeq->assign(si->getName()); return false; } } return true; } /* * The function seqInput is called from the interactive menu only. This is because it * allows us to append seqs. But this would not happen on command line. * It is called twice in the interactive menu, both times with append as false. It calls * the readseqs function to do the work. */ int FileReader::seqInput(Alignment *alignPtr, bool append, string *offendingSeq) { int code; if(userParameters->getMenuFlag()) { cout << "\n\nSequences should all be in 1 file.\n"; cout << "\n7 formats accepted: \n"; cout << "NBRF/PIR, EMBL/SwissProt, Pearson (Fasta), GDE, Clustal, GCG/MSF, \ RSF.\n\n\n"; } if (append) { int numSeqsAlready = alignPtr->getNumSeqs(); code = readSeqs(alignPtr, numSeqsAlready + 1, offendingSeq); } else { code = readSeqs(alignPtr, 1, offendingSeq); // 1 is the first seq to be read } if(code == OK) { userParameters->setStructPenalties1(false); userParameters->setStructPenalties2(false); alignPtr->clearSecStruct1(); alignPtr->clearSecStruct2(); string typeOfAlign = userParameters->getDNAFlag() ? "DNA" : "PROTEIN"; cout << "Sequences assumed to be " << typeOfAlign << endl; if (userParameters->getMenuFlag()) { cout << "\n\n"; alignPtr->printSequencesAddedInfo(); } if(userParameters->getDNAFlag()) { userParameters->setDNAMultiGap(); } else { userParameters->setProtMultiGap(); } userParameters->setEmpty(false); } else if(code == NOSEQUENCESINFILE) // no sequences { /* 02-04-07,nige: this causes a fatal repaint: let * MainWindow::errorHandler deal with it. */ //utilityObject->error("No sequences in file! Bad format?\n"); return code; } else { return code; } return code; } /* * The function readSeqs will create the FileParser that is needed and * it will read in all of the sequences. Depending on the filetype, it * will also check for secondary structure information. * * If there is a problem with one of the sequences its name will be * assigned to offendingSeq */ int FileReader::readSeqs(Alignment *alignPtr, int firstSeq, string *offendingSeq) { string line; string fileName; string linuxFilePath = "file://"; // static char *seq1, sname1[MAXNAMES + 1], title[MAXTITLES + 1]; //int i, j; int noSeqs; //static int l1; static bool DNAFlag1; vector seqVector; vector seqRangeVector; auto_ptr fileParser; // Means we dont need to delete it! vector _outputIndex; // Local version of outputIndex. if (userParameters->getMenuFlag()) { utilityObject->getStr(string("Enter the name of the sequence file "), line); } else { line = userParameters->getSeqName(); } if (line.length() == 0) { // We have no fileName, so return -1 return -1; } // If we have file:// in the string, remove it!! string::size_type loc = line.find(linuxFilePath, 0); if(loc != string::npos) { fileName = line.substr(loc + linuxFilePath.length()); line = fileName; } // Now we have the file name, we must open the file. fileIn->open(line.c_str()); //nige if (fileIn->fail()) return CANNOTOPENFILE; sequenceFileName = line; // Check if the file exists! if (!fileIn->is_open()) { utilityObject->error("Cannot open input file (%s)\n", line.c_str()); return CANNOTOPENFILE; } userParameters->setSeqName(line); // NOTE I made a change here because the profile2Name was not stored! if(userParameters->getProfileNum() == 2 && userParameters->getProfile2Name().empty()) { userParameters->setProfile2Name(line); } else if(userParameters->getProfileNum() == 1 && userParameters->getProfile1Name().empty()) { userParameters->setProfile1Name(line); } noSeqs = 0; checkInfile(&noSeqs, fileParser); if (noSeqs == 0) { return NOSEQUENCESINFILE; } seqRangeVector = fileParser->getSeqRange(1, noSeqs, offendingSeq); if (seqRangeVector.size()==0) return fileParser->getParseExitCode(); // FIXME Andreas Wilm (UCD): noEmptySequence check should be done // internally by FileParser instances if (noEmptySequence(seqRangeVector, offendingSeq) == false) { return EMPTYSEQUENCE; // Error there are same names. } for (int i=0; i < (int)seqRangeVector.size(); i++) { // Andreas Wilm (UCD): fixed wrong default output order // which is important when no alignment (convert!) is done // _outputIndex.push_back(i); // default output order _outputIndex.push_back(i+1); // default output order Sequence tempSeq = seqRangeVector[i]; if (!userParameters->getExplicitDNAFlag()) { DNAFlag1 = tempSeq.checkDNAFlag(); // check DNA/Prot if (i == 1) { userParameters->setDNAFlag(DNAFlag1); } } // type decided by first seq else { DNAFlag1 = userParameters->getDNAFlag(); } seqVector.push_back(tempSeq); } if(firstSeq == 1) // New mulitple alignment, or else profile1 { int prfNum = userParameters->getProfileNum(); alignPtr->addSequences(&seqVector); //test names after saving if(alignPtr->checkAllNamesDifferent(offendingSeq) == false) { //nige moved return ALLNAMESNOTDIFFERENT; // Error there are same names. } userParameters->setProfileNum(prfNum); if(!alignPtr->addOutputIndex(&_outputIndex)) { return OTHERERROR; } } else // profile2 { //test names before appending if (! alignPtr->testUniqueNames(&seqVector, offendingSeq)) { //nige added return ALLNAMESNOTDIFFERENT; } alignPtr->appendSequences(&seqVector); if(!alignPtr->appendOutputIndex(&_outputIndex)) { return OTHERERROR; } } // Then need to pass the length to the parser to get the secondary structure info. int maxAlnLength; // Get values from the Alignment object. maxAlnLength = alignPtr->getMaxAlnLength(); // look for a feature table / gap penalty mask (only if this is a profile) if (userParameters->getProfileNum() > 0) { structPenalties = NONE; secStructMask.clear(); gapPenaltyMask.clear(); secStructName = ""; fileParser->getSecStructure(gapPenaltyMask, secStructMask, secStructName, structPenalties, maxAlnLength); // Andreas Wilm (UCD): bug 114 // after calling getSecStructure gapPenaltyMask needs to be // allocated (it's copied/linked to later) if (gapPenaltyMask.empty()) { gapPenaltyMask.resize(secStructMask.size()); } } if (fileIn->is_open()) { fileIn->close(); } return OK; // return the number of seqs. read in this call } /* * The function profileInput is used to read profiles into the Alignment. If the first * profile is already there it will read in the second profile. It returns the number * of seqs. If it returns -1, couldnt open file. */ int FileReader::profileInput(Alignment *alignPtr) { int code; //int i, totalNumOfSeqs = 0; string offendingSeq; if(userParameters->getProfileNum() == 2 && userParameters->getProfile1Empty()) { utilityObject->error("You must read in profile number 1 first\n"); return MUSTREADINPROFILE1FIRST; } if(userParameters->getProfileNum() == 1) // for the 1st profile { code = readSeqs(alignPtr, 1, &offendingSeq); if (code == OK) { // success; found some seqs. userParameters->setStructPenalties1(NONE); alignPtr->clearSecStruct1(); // Clear old info if (structPenalties != NONE) // feature table / mask in alignment { userParameters->setStructPenalties1(structPenalties); if (structPenalties == SECST) { alignPtr->addSecStructMask1(&secStructMask); } alignPtr->addGapPenaltyMask1(&gapPenaltyMask); alignPtr->addSecStructName1(secStructName); } alignPtr->setProfile1NumSeqs(alignPtr->getNumSeqs()); userParameters->setProfile1Empty(false); userParameters->setProfile2Empty(true); cout << "No. of seqs = " << alignPtr->getNumSeqs() << endl; } else { return code; // FIXME and offendingSeq? } } else { // first seq to be read = profile1_nseqs + 1 int profile1NumOfSeqs = alignPtr->getNumSeqs(); code = readSeqs(alignPtr, profile1NumOfSeqs + 1, &offendingSeq); if(code == OK) { userParameters->setStructPenalties2(NONE); alignPtr->clearSecStruct2(); // Clear old info if (structPenalties != NONE) // feature table / mask in alignment { userParameters->setStructPenalties2(structPenalties); if (structPenalties == SECST) { alignPtr->addSecStructMask2(&secStructMask); } alignPtr->addGapPenaltyMask2(&gapPenaltyMask); alignPtr->addSecStructName2(secStructName); } cout << "No. of seqs in profile=" << alignPtr->getNumSeqs() - profile1NumOfSeqs << endl; cout << "Total no. of seqs =" << alignPtr->getNumSeqs() << endl; userParameters->setProfile2Empty(false); userParameters->setEmpty(false); } else { return code; // FIXME and offendingSeq? } } // Clear out the masks used in this class. This is important!!!! secStructMask.clear(); gapPenaltyMask.clear(); secStructName = ""; string typeOfAlign = userParameters->getDNAFlag() ? "DNA" : "PROTEIN"; cout << "Sequences assumed to be " << typeOfAlign << endl; if (userParameters->getMenuFlag()) { cout<< "\n\n"; } alignPtr->printSequencesAddedInfo(); if(userParameters->getDNAFlag()) { userParameters->setDNAMultiGap(); } else { userParameters->setProtMultiGap(); } return OK; } /* * The function checkInfile is used to find out which format the file is in, and it * also calls the appropriate function to count the seqences. */ void FileReader::checkInfile(int *nseqs, auto_ptr& fileParser) { char _lineIn[MAXLINE + 1]; int i; int lengthLine = 0; *nseqs = 0; while (fileIn->getline(_lineIn, MAXLINE + 1)) { if (!utilityObject->blankLine(_lineIn)) { break; } } lengthLine = strlen(_lineIn) - 1; // Mark Change 20-6-07 for (i = lengthLine; i >= 0; i--) { if (isgraph(_lineIn[i])) { break; } } _lineIn[i + 1] = EOS; // Put first 7 characters into upper case! for (i = 0; i <= 6 && i <= lengthLine; i++) { _lineIn[i] = toupper(_lineIn[i]); } // Create the parser to read the file. if (utilityObject->lineType(_lineIn, "ID")) { // EMBL/Swiss-Prot format ? fileParser.reset(new EMBLFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is EMBL\n"; } else if (utilityObject->lineType(_lineIn, "CLUSTAL")) { fileParser.reset(new ClustalFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is CLUSTAL\n"; } else if (utilityObject->lineType(_lineIn, "PILEUP")) // MSF { fileParser.reset(new MSFFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is MSF\n"; } else if (utilityObject->lineType(_lineIn, "!!AA_MULTIPLE_ALIGNMENT")) // MSF { fileParser.reset(new MSFFileParser(sequenceFileName)); userParameters->setDNAFlag(false); if(userParameters->getDisplayInfo()) cout << "Sequence format is MSF\n"; } else if (utilityObject->lineType(_lineIn, "!!NA_MULTIPLE_ALIGNMENT")) // MSF { fileParser.reset(new MSFFileParser(sequenceFileName)); userParameters->setDNAFlag(true); if(userParameters->getDisplayInfo()) cout << "Sequence format is MSF\n"; } else if (strstr(_lineIn, "MSF") && _lineIn[strlen(_lineIn) - 1] == '.' && _lineIn[strlen(_lineIn) - 2] == '.') // MSF { fileParser.reset(new MSFFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is MSF\n"; } else if (utilityObject->lineType(_lineIn, "!!RICH_SEQUENCE")) // RSF { fileParser.reset(new RSFFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is RSF\n"; } else if (utilityObject->lineType(_lineIn, "#NEXUS")) { //utilityObject->error("Cannot read NEXUS format\n"); return; } else if (*_lineIn == '>') { if ((lengthLine>=3) && _lineIn[3] == ';') { //if(_lineIn[3] == ';') // distinguish PIR and Pearson { // PIR fileParser.reset(new PIRFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is PIR\n"; } } else { // PEARSON fileParser.reset(new PearsonFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is Pearson\n"; } } else if ((*_lineIn == '"') || (*_lineIn == '%') || (*_lineIn == '#')) { // GDE format fileParser.reset(new GDEFileParser(sequenceFileName)); if(userParameters->getDisplayInfo()) cout << "Sequence format is GDE\n"; if (*_lineIn == '%') { userParameters->setDNAFlag(false); } else if (*_lineIn == '#') { userParameters->setDNAFlag(true); } } else { return ; } try { // Get the number of sequences. This is passed back as a pointer! *nseqs = fileParser->countSeqs(); // no output in 1.83: cout << "number of seqs is: " << *nseqs << "\n"; } catch(exception ex) { *nseqs = 0; } } } clustalw-2.1/src/fileInput/EMBLFileParser.h0000644000175000017500000000202711446153311015526 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef EMBLFILEPARSER_H #define EMBLFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class EMBLFileParser : public FileParser { public: /* Functions */ EMBLFileParser(string filePath); ~EMBLFileParser(); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ void getSwissFeature(char* line, vector& secStructMask, int length); void getSwissMask(char* line, vector& gapPenaltyMask, int length); /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/InFileStream.cpp0000644000175000017500000000715111442167171015717 00000000000000/** * Author: Nigel Brown * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * InFileStream subclasses std::ifstream, adding a check for the end-of-line * character convention in the input file. This is then used by the getline() * member as the line delimiter, unless the caller supplies an explicit * delimiter. * * Note: This is an ugly workaround; at present various operations repeatedly * construct/destruct an instance and open/close a sequence file up to 12 * times! A cleaner class will probably derive this class from something like * 'istream' aggregating a 'filebuf' under control of istream::seekg(). * * Created: 09-02-07,Nigel Brown(EMBL) * * Changes: * Mark Larkin 13-2-07: I removed the dynamic cast from the getline functions. ***************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "InFileStream.h" using namespace std; const char LF = 0x0a; //linefeed const char CR = 0x0d; //carriage return InFileStream::InFileStream() : ifstream() { delim = '\n'; // default //cout << "InFileStream() constructor 1" << endl; } InFileStream::InFileStream(const char *filename) : ifstream(filename, ios::in), filename(filename) { //cout << "InFileStream(f) constructor 2" << endl; delim = findDelimiter(); } //- copy-constructor: can't copy superclass private members //- InFileStream::InFileStream(const InFileStream ©) : //- ifstream(static_cast(copy)) //- { //- cout << "InFileStream() constructor 3" << endl; //- delim = copy.delim; //- } void InFileStream::open(const char *filename) { this->filename = filename; ifstream::open(filename, ios::in); if (ifstream::fail()) return; delim = findDelimiter(); } //not necessary, but for symmetry to open() void InFileStream::close() { ifstream::close(); } //getline with stored delimiter std::istream& InFileStream::getline(char *s, streamsize n) { return ifstream::getline(s, n, delim); } //getline with caller supplied delimiter std::istream& InFileStream::getline(char *s, streamsize n, char delim) { return ifstream::getline(s, n, delim); } /** * Mark 24-1-2007. I added the function findDelimiter to determine if '\r' or * '\n' will be used as the line delimiter when parsing the file. * * 25-01-07,Nigel Brown(EMBL): changed body of loop to check successive chars * in case of DOS/Windows * * 09-02-07,Nigel Brown(EMBL): moved member into new InFileStream subclassed * from std::ifstream, so this is called automatically for any file reader * that uses InFileStream in place of std::ifstream. Replaced if/then/else * with switch. */ char InFileStream::findDelimiter() { ifstream in; int type = 0; in.open(filename.c_str(), ios::in); if (in.fail()) return delim; in.seekg(0, ios::beg); //look for CR or LF or CRLF (or LFCR) if (in.is_open()) { char c; while (in.get(c)) { if (c == CR) type |= 1; else if (c == LF) type |= 2; else if (type) break; } } in.close(); switch (type) { case 1: //cout << "file is Mac System 9" << endl; delim = '\r'; break; case 2: //cout << "file is UNIX" << endl; delim = '\n'; break; case 3: //cout << "file is DOS" << endl; delim = '\n'; break; default: //short or empty file //cout << "file is UNIX (default)" << endl; delim = '\n'; } return delim; } clustalw-2.1/src/fileInput/PearsonFileParser.cpp0000644000175000017500000003236711442167171016770 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * Mark 24-1-2007. I am now using the char "delimiter" for the delimiter when using * getline. This is to get around the problem of some files having '\r'. * * 10-02-07,Nigel Brown(EMBL): Changed ifstream to InFileStream to handle * cross-platform end-of-lines and removed delimiter member. * * 28-12-07,Paul McGettigan : replaced array processing with string processing this fixes bug #72 * * 9-2-2008, Paul McGettigan : fixed problem where space after '>' but before sequence name was causing * alignment to fail due to no sequence name being read in * 15-2-2008, Paul McGettigan : fixed bug 91 where Pseudo -FASTA format files were not being processed as * previously in v1.83 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "PearsonFileParser.h" namespace clustalw { /** * Constructor for the Pearson file parser. * @param filePath * @return */ PearsonFileParser::PearsonFileParser(string filePath) { fileName = filePath; fillCharTab(); } /** * reads fasta/pearson file in one go instead of calling getSeq for * each single sequence. * * FIXME AW: only PearsonFileParser::getSeqRange is special, rest is the * same. should be defined in FileParser and then overloaded in special * cases like here */ vector PearsonFileParser::getSeqRange(int firstSeq, int nSeqsToRead, string *offendingSeq) { string characterSeq = ""; string name = ""; string title = ""; string blank = ""; string greater = ">"; //_line[0] = EOS; vector seqRangeVector; string line; //int i, j; int nSeqsRead = 0; unsigned char c; char delim; int _currentSeqNum = 0; // Not at any sequence yet! try { delim=FileParser::getDelimiter(fileName); //cout << "delim = " << delim << endl; ifstream _fileIn; _fileIn.open(fileName.c_str(),ios::in); // Read in lines until we get to the begining of sequence firstSeq. string line=""; do { std::getline(_fileIn,line,delim); if(line.substr(0,1) == greater){ _currentSeqNum++; } } while(_currentSeqNum ' and read up to first ' ' or MAXNAMES // remove the first char i.e. '>' name=line.substr(1,MAXNAMES); //if(name.find(">") != string::npos){ // andreas wilm: exit if angle bracket within header? //} while(name.substr(0,1)==" "){ name=name.substr(1,MAXNAMES); } //int i; //i = name.find(" "); if(name.find(" ") != string::npos){ name=name.substr(0,name.find(" ")); } utilityObject->rTrim(&name); // also replaces linef name=utilityObject->blankToUnderscore(name); // replace blanks with '_' // Read in lines until we get to the begining of next sequence. title = ""; // No title information while(std::getline(_fileIn,line,delim) ){ string::const_iterator iterator1 = line.begin(); while(iterator1 != line.end()){ // Andreas Wilm (UCD): exit if angle brackets within sequence if(*iterator1=='>' && iterator1!=line.begin()) { /* error output handled in Clustal.cpp cerr << "\nMultiple angle brackets inside sequence found:" << " invalid format.\n" << "Maybe you forgot a linebreak between sequences?\n"; */ parseExitCode=BADFORMAT; _fileIn.close(); seqRangeVector.clear(); return seqRangeVector; } if(*iterator1 =='\n' || *iterator1 =='\r' || *iterator1 == EOS || *iterator1 =='>'){ break; } c = *iterator1; c = chartab[c]; if(c){ characterSeq.append(1,c); } iterator1++; } if(*iterator1 == '>'){ break; } } // check sequence if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { /* error output handled in Clustal.cpp */ parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); _fileIn.close(); seqRangeVector.clear(); return seqRangeVector; } else if (characterSeq.length() == 0) { parseExitCode=EMPTYSEQUENCE; if (offendingSeq!=NULL) offendingSeq->assign(name); _fileIn.close(); seqRangeVector.clear(); return seqRangeVector; } seqRangeVector.push_back(Sequence(characterSeq, name, title)); characterSeq = ""; nSeqsRead++; } // while (nSeqsRead < nSeqsToRead) _fileIn.close(); return seqRangeVector; } catch(...) { cerr << "There was an exception in the PearsonFileParser::getSeqRange function.\n" << "Need to end program\n"; exit(1); } } /** * The function getSeq is used to get the sequence 'seqNum' in the file. It returns a * sequence object containing the sequence. * Deprecated: where possible use faster getSeqRange which reads * sequences in one go * @param seqNum The number of the sequence to get. * @return */ Sequence PearsonFileParser::getSeq(int seqNum, string *offendingSeq) { //char _line[MAXLINE + 1]; //char tseq[MAXLINE + 1]; //char sname[MAXNAMES + 1]; //sname [MAXNAMES] = '\0'; string characterSeq = ""; string name = ""; string title = ""; string blank = ""; string greater = ">"; //_line[0] = EOS; string line; cerr << "Use of PearsonFileParser::getSeq is deprecated!\n"; //int i, j; unsigned char c; char delim; int _currentSeqNum = 0; // Not at any sequence yet! try { /* _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // start at the beginning */ delim=FileParser::getDelimiter(fileName); //cout << "delim = " << delim << endl; ifstream _fileIn; _fileIn.open(fileName.c_str(),ios::in); ////////////////////////////////////////////////// //PMcG replace char array with string processing ////////////////////////////////////////////////// // Read in lines until we get to the begining of sequence seqNum. string line=""; do { std::getline(_fileIn,line,delim); if(line.substr(0,1) == greater){ _currentSeqNum++; } } while(_currentSeqNum ' and read up to first ' ' or MAXNAMES // remove the first char i.e. '>' name=line.substr(1,MAXNAMES); ////////////////////////////////////// // PMcG 9-2-2008 need to handle spaces at start of sequence name to conform to 1.83 handling ////////////////////////////////////// while(name.substr(0,1)==" "){ name=name.substr(1,MAXNAMES); } //int i; //i = name.find(" "); if(name.find(" ") != string::npos){ name=name.substr(0,name.find(" ")); } name=utilityObject->blankToUnderscore(name); // replace blanks with '_' // Read in lines until we get to the begining of sequence seqNum. /* PMcG replace char array with string processing while (_currentSeqNum != seqNum) { while(*_line != '>') { if(!_fileIn->getline(_line, MAXLINE + 1)) { freeFileResources(_fileIn); return Sequence(blank, blank, blank); } } ++_currentSeqNum; if(_currentSeqNum == seqNum) // Found the sequence { break; } // Get next line so that we are past the '>' line _fileIn->getline(_line, MAXLINE + 1); } // line contains the name of the sequence for (i = 1; i <= strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(sname, _line + i, MAXNAMES); // remember entryname for (i = 1; i <= strlen(sname); i++) { if (sname[i] == ' ') { break; } } sname[i] = EOS; utilityObject->rTrim(sname); utilityObject->blankToUnderscore(sname); // replace blanks with '_' name = string(sname); */ title = ""; // No title information string seqLine = ""; while(std::getline(_fileIn,seqLine,delim) ){ string::const_iterator iterator1 = seqLine.begin(); while(iterator1 != seqLine.end()){ if(*iterator1 =='\n' || *iterator1 =='\r' || *iterator1 == EOS || *iterator1 =='>'){ break; } c = *iterator1; c = chartab[c]; // PMcG 15-02-2008 bug 91 // strip out spaces and numbers from pseudo_fasta files // but need to maintain gaps if present in sequence input // to replicate behaviour of v1.83 //if(*iterator1 != ' ' && !isdigit(*iterator1)){ if(c){ characterSeq.append(1,c); } iterator1++; } if(*iterator1 == '>'){ break; } } /* while (_fileIn->getline(_line, MAXLINE + 1)) { for (i = 0; i <= MAXLINE; i++) { c = _line[i]; if (c == '\n' || c == EOS || c == '>') { break; } c = chartab[c]; if (c) { characterSeq += c; } } if (c == '>') { break; } } */ _fileIn.close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; // return empty seq return Sequence(blank, blank, blank); } else if (characterSeq.length() == 0) { parseExitCode=EMPTYSEQUENCE; // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { cerr << "There was an exception in the PearsonFileParser::getSeq function.\n" << "Need to end program\n"; exit(1); } } /** * The function countSeqs, counts the number of sequences in a file. * @return The number of sequences in the file. */ int PearsonFileParser::countSeqs() { //char line[1000 + 1]; int _nseqs = 0; string line2; char delim; try { //_fileIn = new InFileStream; //nige //_fileIn->open(fileName.c_str()); //nige delim=FileParser::getDelimiter(fileName); ifstream _fileIn; _fileIn.open(fileName.c_str(),ios::in); if(!_fileIn.is_open()) { return 0; // No sequences found! } /* while ((*_fileIn) >> line2/@_fileIn->getline(line, 1000 + 1)@/) { /@if(_nseqs == 50) { cout << "\n\n" << line << "\n\n"; exit(1); }@/ */ while (std::getline(_fileIn,line2,delim)) { if (line2[0] == '>') { _nseqs++; } } _fileIn.close(); return _nseqs; } catch(...) { freeFileResources(_fileIn); cerr << "An exception has occured in the function PearsonFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /** * There is no secondary structure information in the Pearson file. This is here to * set the structPenalties to NONE. * @param gapPenaltyMask * @param secStructMask * @param secStructName * @param structPenalties * @param length */ void PearsonFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { structPenalties = NONE; } } clustalw-2.1/src/fileInput/GDEFileParser.h0000644000175000017500000000155711442167171015422 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef GDEFILEPARSER_H #define GDEFILEPARSER_H #include #include "FileParser.h" namespace clustalw { class GDEFileParser : public FileParser { public: /* Functions */ GDEFileParser(string filePath); ~GDEFileParser(); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq=NULL); virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL); virtual int countSeqs(); virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length); /* Attributes */ private: /* Functions */ /* Attributes */ string fileName; }; } #endif clustalw-2.1/src/fileInput/FileReader.h0000644000175000017500000000264311442167171015045 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef FILEREADER_H #define FILEREADER_H #include #include #include #include "../alignment/Alignment.h" #include "../alignment/Sequence.h" #include "../general/userparams.h" #include "../general/utils.h" #include "FileParser.h" #include "ClustalFileParser.h" #include "PearsonFileParser.h" #include "PIRFileParser.h" #include "GDEFileParser.h" #include "MSFFileParser.h" #include "RSFFileParser.h" #include "EMBLFileParser.h" namespace clustalw { class FileReader { public: /* Functions */ FileReader(); ~FileReader(); int seqInput(Alignment* alignPtr, bool append, string *offendingSeq); int readSeqs(Alignment* alignPtr, int firstSeq, string *offendingSeq); int profileInput(Alignment* alignPtr); /* Attributes */ private: /* Functions */ void checkInfile(int* nseqs, auto_ptr& fileParser); /* Attributes */ string sequenceFileName; bool noEmptySequence(vector seqRangeVector, string *offendingSeq); InFileStream* fileIn; int structPenalties; string secStructName; vector secStructMask; // Will need to be cleared out before every reading! vector gapPenaltyMask; vector formatNames; }; } #endif clustalw-2.1/src/fileInput/FileParser.h0000644000175000017500000000354711442167171015103 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** The aim of this class is to return one sequence at a time. * Note that the file must be open when it is passed to the FileParser. * The parser does not know the name of the file to open. Only the filereader knows. * * Changes: * * Mark 24-1-2007. I added the function findDelimiter to determine if '\r' or '\n' * will be used as the line delimiter when parsing the file. * * 10-02-07,Nigel Brown(EMBL): Removed delimiter and findDelimiter() * members, as functionality now handled by the stream class. */ #ifndef FILEPARSER_H #define FILEPARSER_H #include #include "../alignment/Sequence.h" #include "../general/userparams.h" #include #include "InFileStream.h" namespace clustalw { class FileParser { public: /* Functions */ FileParser(); virtual ~FileParser(); virtual vector getSeqRange(int firstSeq, int num, string *offendingSeq) = 0; virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL) = 0; virtual int countSeqs() = 0; // VIRTUAL virtual void getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) = 0; void fillCharTab(void); char getDelimiter(string filename); /* Attributes */ char chartab[128]; int getParseExitCode() { return parseExitCode; }; protected: void freeFileResources(InFileStream* filePtr); InFileStream* _fileIn; int parseExitCode; // reason for returning empty sequence // vector; same as used in FileReader private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/fileInput/FileParser.cpp0000644000175000017500000000367511442167171015440 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * 10-02-07,Nigel Brown(EMBL): Removed delimiter and findDelimiter() * members, as functionality now handled by the stream class. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "FileParser.h" const char LF = 0x0a; //linefeed const char CR = 0x0d; //carriage return namespace clustalw { FileParser::FileParser() { parseExitCode = OK; } FileParser::~FileParser() { // Dont do anything!!!! } void FileParser::fillCharTab(void) { register int i; register char c; for (i = 0; i < 128; chartab[i++] = 0) ; for (i = 0; i <= userParameters->getMaxAA() + 1; i++) { c = userParameters->getAminoAcidCode(i); chartab[(int)c] = chartab[tolower(c)] = c; } } void FileParser::freeFileResources(InFileStream* filePtr) { if(filePtr != 0) { filePtr->close(); delete filePtr; filePtr = 0; } } char FileParser::getDelimiter(string filename) { ifstream in; int type = 0; char delim; in.open(filename.c_str(), ios::in); in.seekg(0, ios::beg); //look for CR or LF or CRLF (or LFCR) if (in.is_open()) { char c; while (in.get(c)) { if (c == CR) type |= 1; else if (c == LF) type |= 2; else if (type) break; } } in.close(); switch (type) { case 1: //cout << "file is Mac System 9" << endl; delim = '\r'; break; case 2: //cout << "file is UNIX" << endl; delim = '\n'; break; case 3: //cout << "file is DOS" << endl; delim = '\n'; break; default: //short or empty file //cout << "file is UNIX (default)" << endl; delim = '\n'; } return delim; } } clustalw-2.1/src/fileInput/EMBLFileParser.cpp0000644000175000017500000003305211452720413016063 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 10-02-07,Nigel Brown(EMBL): changed ifstream to InFileStream to handle * cross-platform end-of-lines. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "EMBLFileParser.h" namespace clustalw { /* * constructor sets up chartab array. */ EMBLFileParser::EMBLFileParser(string filePath) { fileName = filePath; fillCharTab(); } /* * dont need to destruct anything. */ EMBLFileParser::~EMBLFileParser() { } /* * get range of sequences */ vector EMBLFileParser::getSeqRange(int firstSeq, int no, string *offendingSeq) { vector seqRangeVector; int i; for (i=0; iopen(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // start at the beginning // Read in lines until we get to the begining of sequence seqNum. while (_currentSeqNum != seqNum) { while(!utilityObject->lineType(_line, "ID")) { if(!_fileIn->getline(_line, MAXLINE + 1)) // If we cannot get anymore! { _fileIn->close(); return Sequence(blank, blank, blank); } } ++_currentSeqNum; if(_currentSeqNum == seqNum) // Found the sequence { break; } // Get next line so that we are past the '>' line _fileIn->getline(_line, MAXLINE + 1); } for (i = 5; i <= (int)strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(_sname, _line + i, MAXNAMES); // remember entryname for (i = 0; i <= (int)strlen(_sname); i++) { if (_sname[i] == ' ') { _sname[i] = EOS; break; } } _sname[MAXNAMES] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); name = string(_sname); // Andreas Wilm (UCD): why cout here? cout << name << "\n"; while (!utilityObject->lineType(_line, "SQ")) { if(!_fileIn->getline(_line, MAXLINE + 1)) // If we cannot get anymore! { _fileIn->close(); // FIXME AW: why return with a name but otherwise empty seq? return Sequence(blank, name, blank); } } while (_fileIn->getline(_line, MAXLINE + 1)) { if (gotSeq && utilityObject->blankLine(_line)) { break; } // NOTE I changed this to -1 and -2 because the getline doesnt return the \n if (strlen(_line) > 2 && _line[strlen(_line) - 1] == '.' && _line[strlen(_line) - 2] == '.') { continue; } for (i = 0; i <= MAXLINE; i++) { c = _line[i]; if (c == '\n' || c == EOS || c == '/') { break; } // EOL c = chartab[c]; if (c) { gotSeq = true; characterSeq += c; } } if (c == '/') { break; } } _fileIn->close(); if ((int)characterSeq.length() > userParameters->getMaxAllowedSeqLength()) { parseExitCode=SEQUENCETOOBIG; if (offendingSeq!=NULL) offendingSeq->assign(name); // return empty seq return Sequence(blank, blank, blank); } return Sequence(characterSeq, name, title); } catch(...) { _fileIn->close(); cerr << "There was an exception in the EMBLFileParser::getSeq function.\n" << "Need to end program\n"; exit(1); } } /* * count the number of sequences in the file and return the number */ int EMBLFileParser::countSeqs() { char line[MAXLINE + 1]; // char c; line[0] = EOS; int numSeqs; // int i; //bool seqOk; numSeqs = 0; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige if(!_fileIn->is_open()) { return 0; // No sequences found! } while (_fileIn->getline(line, MAXLINE + 1)) { if (utilityObject->lineType(line, "ID")) { numSeqs++; } } _fileIn->close(); return numSeqs; } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function EMBLFileParser::countSeqs()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * get secondary structure information from the file. */ void EMBLFileParser::getSecStructure(vector& gapPenaltyMask, vector& secStructMask, string& secStructName, int &structPenalties, int length) { bool guigetss = false; if(userParameters->getProfileNum() == 1 && userParameters->getStructPenalties1()) guigetss = true; if(userParameters->getProfileNum() == 2 && userParameters->getStructPenalties2()) guigetss = true; char _title[MAXLINE + 1]; char _line[MAXLINE + 1]; char _lin2[MAXLINE + 1]; char _sname[MAXNAMES + 1]; char _feature[MAXLINE + 1]; int i; _line[0] = '\0'; try { _fileIn = new InFileStream; //nige _fileIn->open(fileName.c_str()); //nige _fileIn->seekg(0, std::ios::beg); // clear out the masks gapPenaltyMask.clear(); secStructMask.clear(); // find the start of the sequence entry for (;;) { while (!utilityObject->lineType(_line, "ID")) { if (!_fileIn->getline(_line, MAXLINE + 1)) { _fileIn->close(); return; } } for (i = 5; i <= (int)strlen(_line); i++) { if (_line[i] != ' ') { break; } } strncpy(_sname, _line + i, MAXNAMES); // remember entryname for (i = 0; i <= (int)strlen(_sname); i++) { if (_sname[i] == ' ') { _sname[i] = EOS; break; } } _sname[MAXNAMES] = EOS; utilityObject->rTrim(_sname); utilityObject->blankToUnderscore(_sname); // look for secondary structure feature table / gap penalty mask while (_fileIn->getline(_line, MAXLINE + 1)) { if (utilityObject->lineType(_line, "FT")) { sscanf(_line + 2, "%s", _feature); if (strcmp(_feature, "HELIX") == 0 || strcmp(_feature, "STRAND") == 0) { if (userParameters->getInteractive() && !userParameters->getGui()) { strcpy(_title, "Found secondary structure in alignment file: "); strcat(_title, _sname); (*_lin2) = utilityObject->promptForYesNo(_title, "Use it to set local gap penalties "); } else { (*_lin2) = 'y'; } if (guigetss || ((*_lin2 != 'n') && (*_lin2 != 'N'))) { structPenalties = SECST; for (i = 0; i < length; i++) { secStructMask.push_back('.'); } do { getSwissFeature(&_line[2], secStructMask, length); _fileIn->getline(_line, MAXLINE + 1); } while (utilityObject->lineType(_line, "FT")); } else { do { _fileIn->getline(_line, MAXLINE + 1); } while (utilityObject->lineType(_line, "FT")); } secStructName = string(_sname); } } else if (utilityObject->lineType(_line, "GM")) { if (userParameters->getInteractive()) { strcpy(_title, "Found gap penalty mask in alignment file: "); strcat(_title, _sname); (*_lin2) = utilityObject->promptForYesNo(_title, "Use it to set local gap penalties "); } else { (*_lin2) = 'y'; } if (guigetss || ((*_lin2 != 'n') && (*_lin2 != 'N'))) { structPenalties = GMASK; for (i = 0; i < length; i++) { gapPenaltyMask.push_back('1'); } do { getSwissMask(&_line[2], gapPenaltyMask, length); _fileIn->getline(_line, MAXLINE + 1); } while (utilityObject->lineType(_line, "GM")); } else { do { _fileIn->getline(_line, MAXLINE + 1); } while (utilityObject->lineType(_line, "GM")); } secStructName = string(_sname); } if (utilityObject->lineType(_line, "SQ")) { break; } if (structPenalties != NONE) { break; } } } _fileIn->close(); } catch(...) { _fileIn->close(); cerr << "An exception has occured in the function EMBLFileParser::getSecStructure()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * get the sec structure mask */ void EMBLFileParser::getSwissFeature(char* line, vector& secStructMask, int length) { char c, s, feature[MAXLINE + 1]; int i, startPos, endPos; try { if (sscanf(line, "%s%d%d", feature, &startPos, &endPos) != 3) { return ; } if (strcmp(feature, "HELIX") == 0) { c = 'A'; s = '$'; } else if (strcmp(feature, "STRAND") == 0) { c = 'B'; s = '%'; } else { return ; } if (startPos >= length || endPos >= length) { return ; } secStructMask[startPos - 1] = s; for (i = startPos; i < endPos - 1; i++) { secStructMask[i] = c; } secStructMask[endPos - 1] = s; } catch(...) { cerr << "An exception has occured in the function EMBLFileParser::getSwissFeature()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } /* * get the gap penalty mask. */ void EMBLFileParser::getSwissMask(char* line, vector& gapPenaltyMask, int length) { int i, value, startPos, endPos; try { if (sscanf(line, "%d%d%d", &value, &startPos, &endPos) != 3) { return; } if (value < 1 || value > 9) { return ; } if (startPos >= length || endPos >= length) { return ; } for (i = startPos - 1; i < endPos; i++) { gapPenaltyMask[i] = value + '0'; } } catch(...) { cerr << "An exception has occured in the function EMBLFileParser::getSwissMask()\n" << "Program needs to terminate.\nPlease contact the Clustal developers\n"; exit(1); } } } clustalw-2.1/src/main.cpp0000644000175000017500000000461211442167172012362 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "alignment/Alignment.h" #include "alignment/Sequence.h" #include "general/clustalw.h" #include "general/UserParameters.h" #include "substitutionMatrix/SubMatrix.h" #include "general/Utility.h" #include "fileInput/FileReader.h" #include "interface/InteractiveMenu.h" #include "interface/CommandLineParser.h" #include "general/DebugLog.h" #include "general/ClustalWResources.h" #include "general/Stats.h" #include namespace clustalw { UserParameters* userParameters; Utility* utilityObject; SubMatrix *subMatrix; DebugLog* logObject; Stats* statsObject; } using namespace std; using namespace clustalw; int main(int argc, char **argv) { userParameters = new UserParameters(false); utilityObject = new Utility(); subMatrix = new SubMatrix(); statsObject = new Stats(); ClustalWResources *resources = ClustalWResources::Instance(); resources->setPathToExecutable(string(argv[0])); userParameters->setDisplayInfo(true); //userParameters->setDebug(5); #if DEBUGFULL if(DEBUGLOG) { cout << "debugging is on\n\n\n"; logObject = new DebugLog("logfile.txt"); logObject->logMsg("Loggin is on!"); } #endif if (argc > 1) { //time_t start, end; //double dif; //start = time (NULL); //userParameters->setDisplayInfo(false); vector args; for (int i = 1; i < argc; ++i) { args.push_back(argv[i]); } CommandLineParser cmdLineParser(&args, false); if (statsObject->isEnabled()) statsObject->logCmdLine(argc,argv); //end = time (NULL); //dif = difftime(end, start); //cout << "It took " << dif << " seconds\n"; } if (argc<=1 || userParameters->getInteractive()) { // FIXME: additional parameters like infile are ignored! InteractiveMenu menu; userParameters->setMenuFlag(true); userParameters->setInteractive(true); menu.mainMenu(); } delete userParameters; delete utilityObject; delete subMatrix; if(logObject) { delete logObject; } return 0; } clustalw-2.1/src/substitutionMatrix/0000755000175000017500000000000011467270447014757 500000000000000clustalw-2.1/src/substitutionMatrix/SubMatrix.cpp0000644000175000017500000014521311442167171017317 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "SubMatrix.h" #include "matrices.h" #include "../general/InvalidCombination.cpp" #include "../general/debuglogObject.h" namespace clustalw { using namespace std; /** * * @param log */ SubMatrix::SubMatrix() : sizenAAMatrix(276), sizeDNAMatrix(153), matrixAvgScore(0), QTDNAHistMatNum(DNAIUB), QTAAHistMatNum(AAHISTGONNETPAM250), QTsegmentDNAMatNum(DNAIUB), QTsegmentAAMatNum(QTAASEGGONNETPAM250) { userSeries = false; setUpCrossReferences(); #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Creating the SubMatrix object\n"); } #endif try { /* Set up the vectors with the matrices defined in matrices.h * The matrices are intially defined as a short array, as there is no way * to intiailize a vector with a {....} list. */ blosum30mtVec = new Matrix(blosum30mt, blosum30mt + sizenAAMatrix); blosum40mtVec = new Matrix(blosum40mt, blosum40mt + sizenAAMatrix); blosum45mtVec = new Matrix(blosum45mt, blosum45mt + sizenAAMatrix); blosum62mt2Vec = new Matrix(blosum62mt2, blosum62mt2 + sizenAAMatrix); blosum80mtVec = new Matrix(blosum80mt, blosum80mt + sizenAAMatrix); pam20mtVec = new Matrix(pam20mt, pam20mt + sizenAAMatrix); pam60mtVec = new Matrix(pam60mt, pam60mt + sizenAAMatrix); pam120mtVec = new Matrix(pam120mt, pam120mt + sizenAAMatrix); pam350mtVec = new Matrix(pam350mt, pam350mt + sizenAAMatrix); idmatVec = new Matrix(idmat, idmat + sizenAAMatrix); gon40mtVec = new Matrix(gon40mt, gon40mt + sizenAAMatrix); gon80mtVec = new Matrix(gon80mt, gon80mt + sizenAAMatrix); gon120mtVec = new Matrix(gon120mt, gon120mt + sizenAAMatrix); gon160mtVec = new Matrix(gon160mt, gon160mt + sizenAAMatrix); gon250mtVec = new Matrix(gon250mt, gon250mt + sizenAAMatrix); gon350mtVec = new Matrix(gon350mt, gon350mt + sizenAAMatrix); clustalvdnamtVec = new Matrix(clustalvdnamt, clustalvdnamt + sizeDNAMatrix); swgapdnamtVec = new Matrix(swgapdnamt, swgapdnamt + sizeDNAMatrix); /* * Set up the vectors for user defined types. * Probably dont need to do this, as they may not be used. It would be better * to initialise their size if thye are used. */ userMat.resize(NUMRES * NUMRES); pwUserMat.resize(NUMRES * NUMRES); userDNAMat.resize(NUMRES * NUMRES); pwUserDNAMat.resize(NUMRES * NUMRES); QTscoreUserMatrix.resize(NUMRES * NUMRES); QTscoreUserDNAMatrix.resize(NUMRES * NUMRES); QTsegmentDNAMatrix.resize(NUMRES * NUMRES); QTsegmentAAMatrix.resize(NUMRES * NUMRES); userMatSeries.resize(MAXMAT); // Maximum number of matrices vector::iterator firstM = userMatSeries.begin(); vector::iterator lastM = userMatSeries.end(); while(firstM != lastM) { firstM->resize(NUMRES * NUMRES); firstM++; } // Maybe I should put this in with the other xref intialisations! AAXrefseries.resize(MAXMAT); vector::iterator firstX = AAXrefseries.begin(); vector::iterator lastX = AAXrefseries.end(); while(firstX != lastX) { firstX->resize(NUMRES + 1); firstX++; } // Set the defaults. matrixNum = 3; matrixName = new string("gonnet"); DNAMatrixNum = 1; DNAMatrixName = new string("iub"); pwMatrixNum = 3; pwMatrixName = new string("gonnet"); pwDNAMatrixNum = 1; pwDNAMatrixName = new string("iub"); } catch(const exception &ex) { cerr << ex.what() << endl; cerr << "Terminating program. Cannot continue\n"; exit(1); } } void SubMatrix::setValuesToDefault() { matrixAvgScore = 0; QTDNAHistMatNum = DNAIUB; QTAAHistMatNum = AAHISTGONNETPAM250; QTsegmentDNAMatNum = DNAIUB; QTsegmentAAMatNum = QTAASEGGONNETPAM250; userSeries = false; matrixNum = 3; DNAMatrixNum = 1; pwMatrixNum = 3; pwDNAMatrixNum = 1; } /** * The destructor frees up any dynamically allocated memory. */ SubMatrix::~SubMatrix() { delete blosum30mtVec; delete blosum40mtVec; delete blosum45mtVec; delete blosum62mt2Vec; delete blosum80mtVec; delete pam20mtVec; delete pam60mtVec; delete pam120mtVec; delete pam350mtVec; delete idmatVec; delete gon40mtVec; delete gon80mtVec; delete gon120mtVec; delete gon160mtVec; delete gon250mtVec; delete gon350mtVec; delete clustalvdnamtVec; delete swgapdnamtVec; delete matrixName; delete DNAMatrixName; delete pwMatrixName; delete pwDNAMatrixName; } /** * This function sets up the initial cross references. */ void SubMatrix::setUpCrossReferences() { char c1, c2; short i, j, maxRes; defaultAAXref.resize(NUMRES + 1); defaultDNAXref.resize(NUMRES + 1); string aminoAcidOrder = "ABCDEFGHIKLMNPQRSTVWXYZ"; string nucleicAcidOrder = "ABCDGHKMNRSTUVWXY"; /* * I also need to resize the user defined xrefs. */ DNAXref.resize(NUMRES + 1); AAXref.resize(NUMRES + 1); pwAAXref.resize(NUMRES + 1); pwDNAXref.resize(NUMRES + 1); QTscoreXref.resize(NUMRES + 1); QTscoreDNAXref.resize(NUMRES + 1); QTsegmentDNAXref.resize(NUMRES + 1); QTsegmentAAXref.resize(NUMRES + 1); /* * set up cross-reference for default matrices hard-coded in matrices.h */ for (i = 0; i < NUMRES; i++) { defaultAAXref[i] = -1; } for (i = 0; i < NUMRES; i++) { defaultDNAXref[i] = -1; } maxRes = 0; for (i = 0; (c1 = aminoAcidOrder[i]); i++) { for (j = 0; (c2 = userParameters->getAminoAcidCode(j)); j++) { if (c1 == c2) { defaultAAXref[i] = j; maxRes++; break; } } if ((defaultAAXref[i] == - 1) && (aminoAcidOrder[i] != '*')) { utilityObject->error("residue %c in matrices.h is not recognised", aminoAcidOrder[i]); } } maxRes = 0; for (i = 0; (c1 = nucleicAcidOrder[i]); i++) { for (j = 0; (c2 = userParameters->getAminoAcidCode(j)); j++) { if (c1 == c2) { defaultDNAXref[i] = j; maxRes++; break; } } if ((defaultDNAXref[i] == - 1) && (nucleicAcidOrder[i] != '*')) { utilityObject->error("nucleic acid %c in matrices.h is not recognised", nucleicAcidOrder[i]); } } } /** * The function getPairwiseMatrix is called by the user to get the correct sub matrix for the * pairwise alignment stage. It calls getMatrix to actually calculate the matrix. * This function provides an interface for the user. It allows the user to get the matrix * they wish to use for the pairwise alignment part. * @param matrix[][] * @param scale * @param matAvg * @return */ int SubMatrix::getPairwiseMatrix(int matrix[NUMRES][NUMRES], PairScaleValues& scale, int& matAvg) { int _maxRes; // Local copy. /* Pointers to Matrix and xref to use in calculation */ Matrix* _matPtr; Xref* _matXref; #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("In the function getPairwiseMatrix: \n"); } #endif string matrixPointer; string xrefPointer; #ifdef OS_MAC scale.intScale = 10; #else scale.intScale = 100; #endif scale.gapOpenScale = scale.gapExtendScale = 1.0; if (userParameters->getDNAFlag()) { #if DEBUGFULL if(logObject && DEBUGLOG) { string msg = " (DNA AND Pairwise) " + *pwDNAMatrixName + "\n"; logObject->logMsg(msg); } #endif if (pwDNAMatrixName->compare("iub") == 0) { matrixPointer = "swgapdnamtVec"; xrefPointer = "defaultDNAXref"; _matPtr = swgapdnamtVec; _matXref = &defaultDNAXref; } else if (pwDNAMatrixName->compare("clustalw") == 0) { matrixPointer = "clustalvdnamtVec"; xrefPointer = "defaultDNAXref"; _matPtr = clustalvdnamtVec; _matXref = &defaultDNAXref; scale.gapOpenScale = 0.6667; scale.gapExtendScale = 0.751; } else { matrixPointer = "pwUserDNAMat"; xrefPointer = "pwDNAXref"; _matPtr = &pwUserDNAMat; _matXref = &pwDNAXref; } _maxRes = getMatrix(_matPtr, _matXref, matrix, true, scale.intScale); if (_maxRes == 0) { return ((int) -1); } float _transitionWeight = userParameters->getTransitionWeight(); // Mark change 17-5-07 matrix[0][4] = static_cast(_transitionWeight * matrix[0][0]); matrix[4][0] = static_cast(_transitionWeight * matrix[0][0]); matrix[2][11] = static_cast(_transitionWeight * matrix[0][0]); matrix[11][2] = static_cast(_transitionWeight * matrix[0][0]); matrix[2][12] = static_cast(_transitionWeight * matrix[0][0]); matrix[12][2] = static_cast(_transitionWeight * matrix[0][0]); } else { #if DEBUGFULL if(logObject && DEBUGLOG) { string msg = " (Protein AND Pairwise) " + *pwMatrixName + "\n"; logObject->logMsg(msg); } #endif if (pwMatrixName->compare("blosum") == 0) { matrixPointer = "blosum30mtVec"; xrefPointer = "defaultAAXref"; _matPtr = blosum30mtVec; _matXref = &defaultAAXref; } else if (pwMatrixName->compare("pam") == 0) { matrixPointer = "pam350mtVec"; xrefPointer = "defaultAAXref"; _matPtr = pam350mtVec; _matXref = &defaultAAXref; } else if (pwMatrixName->compare("gonnet") == 0) { matrixPointer = "gon250mtVec"; xrefPointer = "defaultAAXref"; _matPtr = gon250mtVec; scale.intScale /= 10; _matXref = &defaultAAXref; } else if (pwMatrixName->compare("id") == 0) { matrixPointer = "idmatVec"; xrefPointer = "defaultAAXref"; _matPtr = idmatVec; _matXref = &defaultAAXref; } else { matrixPointer = "pwUserMat"; xrefPointer = "pwAAXref"; _matPtr = &pwUserMat; _matXref = &pwAAXref; } _maxRes = getMatrix(_matPtr, _matXref, matrix, true, scale.intScale); if (_maxRes == 0) { return ((int) -1); } } #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " Called getMatrix with " << matrixPointer << " and " << xrefPointer << ".\n" << " intScale = " << scale.intScale << ", gapOpenScale = " << scale.gapOpenScale << ", gapExtendScale = " << scale.gapExtendScale << "\n\n"; logObject->logMsg(outs.str()); } #endif matAvg = matrixAvgScore; return _maxRes; } /** * The function getProfileAlignMatrix provides an interface for the user to get * the matrix to be used in the profile alignment. This depends on the matrix series * that was chosen, and also on the percent identity. * @param matrix[][] * @param pcid * @param minLen * @param scaleParam * @param matAvg * @return */ int SubMatrix::getProfileAlignMatrix(int matrix[NUMRES][NUMRES], double pcid, int minLen, PrfScaleValues& scaleParam, int& matAvg) { bool found = false; bool errorGiven = false; bool _negMatrix = userParameters->getUseNegMatrix(); int i = 0, j = 0; int _maxRes = 0; scaleParam.intScale = 100; string matrixPointer; string xrefPointer; #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("In the function getProfileAlignMatrix: \n"); } #endif if (userParameters->getDNAFlag()) { #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " (DNA AND Multiple align) "<< DNAMatrixName->c_str() << "\n"; logObject->logMsg(outs.str()); } #endif scaleParam.scale = 1.0; if (DNAMatrixName->compare("iub") == 0) { _matPtr = swgapdnamtVec; _matXref = &defaultDNAXref; matrixPointer = "swgapdnamtVec"; xrefPointer = "defaultDNAXref"; } else if (DNAMatrixName->compare("clustalw") == 0) { _matPtr = clustalvdnamtVec; _matXref = &defaultDNAXref; scaleParam.scale = 0.66; matrixPointer = "clustalvdnamtVec"; xrefPointer = "defaultDNAXref"; } else { _matPtr = &userDNAMat; _matXref = &DNAXref; matrixPointer = "userDNAMat"; xrefPointer = "DNAXref"; } _maxRes = getMatrix(_matPtr, _matXref, matrix, _negMatrix, static_cast(scaleParam.intScale)); // Mark change 17-5-07 if (_maxRes == 0) { return ((int) - 1); } float _transitionWeight = userParameters->getTransitionWeight(); // fix suggested by Chanan Rubin at Compugen matrix[(*_matXref)[0]][(*_matXref)[4]] = static_cast(_transitionWeight * matrix[0][0]); matrix[(*_matXref)[4]][(*_matXref)[0]] = static_cast(_transitionWeight * matrix[0][0]); matrix[(*_matXref)[2]][(*_matXref)[11]] = static_cast(_transitionWeight * matrix[0][0]); matrix[(*_matXref)[11]][(*_matXref)[2]] = static_cast(_transitionWeight * matrix[0][0]); matrix[(*_matXref)[2]][(*_matXref)[12]] = static_cast(_transitionWeight * matrix[0][0]); matrix[(*_matXref)[12]][(*_matXref)[2]] = static_cast(_transitionWeight * matrix[0][0]); } else // Amino acid alignment!!!! { #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " (Protein AND Multiple align) "<< matrixName->c_str() << "\n"; logObject->logMsg(outs.str()); } #endif scaleParam.scale = 0.75; if (matrixName->compare("blosum") == 0) { scaleParam.scale = 0.75; if (_negMatrix || userParameters->getDistanceTree() == false) { _matPtr = blosum40mtVec; matrixPointer = "blosum40mtVec"; } else if (pcid > 80.0) { _matPtr = blosum80mtVec; matrixPointer = "blosum80mtVec"; } else if (pcid > 60.0) { _matPtr = blosum62mt2Vec; matrixPointer = "blosum62mt2Vec"; } else if (pcid > 40.0) { _matPtr = blosum45mtVec; matrixPointer = "blosum45mtVec"; } else if (pcid > 30.0) { scaleParam.scale = 0.5; _matPtr = blosum45mtVec; matrixPointer = "blosum45mtVec"; } else if (pcid > 20.0) { scaleParam.scale = 0.6; _matPtr = blosum45mtVec; matrixPointer = "blosum45mtVec"; } else { scaleParam.scale = 0.6; _matPtr = blosum30mtVec; matrixPointer = "blosum30mtVec"; } _matXref = &defaultAAXref; xrefPointer = "defaultAAXref"; } else if (matrixName->compare("pam") == 0) { scaleParam.scale = 0.75; if (_negMatrix || userParameters->getDistanceTree() == false) { _matPtr = pam120mtVec; matrixPointer = "pam120mtVec"; } else if (pcid > 80.0) { _matPtr = pam20mtVec; matrixPointer = "pam20mtVec"; } else if (pcid > 60.0) { _matPtr = pam60mtVec; matrixPointer = "pam60mtVec"; } else if (pcid > 40.0) { _matPtr = pam120mtVec; matrixPointer = "pam120mtVec"; } else { _matPtr = pam350mtVec; matrixPointer = "pam350mtVec"; } _matXref = &defaultAAXref; xrefPointer = "defaultAAXref"; } else if (matrixName->compare("gonnet") == 0) { scaleParam.scale /= 2.0; if (_negMatrix || userParameters->getDistanceTree() == false) { _matPtr = gon250mtVec; matrixPointer = "gon250mtVec"; } else if (pcid > 35.0) { _matPtr = gon80mtVec; scaleParam.scale /= 2.0; matrixPointer = "gon80mtVec"; } else if (pcid > 25.0) { if (minLen < 100) { _matPtr = gon250mtVec; matrixPointer = "gon250mtVec"; } else { _matPtr = gon120mtVec; matrixPointer = "gon120mtVec"; } } else { if (minLen < 100) { _matPtr = gon350mtVec; matrixPointer = "gon350mtVec"; } else { _matPtr = gon160mtVec; matrixPointer = "gon160mtVec"; } } _matXref = &defaultAAXref; xrefPointer = "defaultAAXref"; scaleParam.intScale /= 10; } else if (matrixName->compare("id") == 0) { _matPtr = idmatVec; _matXref = &defaultAAXref; xrefPointer = "defaultAAXref"; matrixPointer = "idmatVec"; } else if (userSeries) { _matPtr = NULL; found = false; for (i = 0; i < matSeries.nmat; i++) { if (pcid >= matSeries.mat[i].llimit && pcid <= matSeries.mat[i].ulimit) { j = i; found = true; break; } } if (found == false) { if (!errorGiven) { utilityObject->warning( "\nSeries matrix not found for sequence percent identity = %d.\n""(Using first matrix in series as a default.)\n""This alignment may not be optimal!\n""SUGGESTION: Check your matrix series input file and try again.", (int)pcid); } errorGiven = true; j = 0; } _matPtr = matSeries.mat[j].matptr; _matXref = matSeries.mat[j].AAXref; // this gives a scale of 0.5 for pcid=llimit and 1.0 for pcid=ulimit scaleParam.scale = 0.5 + (pcid - matSeries.mat[j].llimit) / ( (matSeries.mat[j].ulimit - matSeries.mat[j].llimit) *2.0); xrefPointer = "matSeries.mat[j].AAXref"; matrixPointer = "matSeries.mat[j].matptr"; } else { _matPtr = &userMat; _matXref = &AAXref; xrefPointer = "AAXref"; matrixPointer = "userMat"; } _maxRes = getMatrix(_matPtr, _matXref, matrix, _negMatrix, static_cast(scaleParam.intScale)); if (_maxRes == 0) { cerr << "Error: matrix " << matrixName << " not found\n"; return ( - 1); } } #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " Called getMatrix with " << matrixPointer << " and " << xrefPointer << ".\n" << " intScale = " << scaleParam.intScale << ", scale = " << scaleParam.scale << ", pcid = " << pcid << "\n\n"; logObject->logMsg(outs.str()); } #endif matAvg = matrixAvgScore; return _maxRes; } /** * The function getMatrix is what the other parts of the code call to get a useable * substitution matrix. This is stored in matrix[NUMRES][NUMRES]. * @param matptr * @param xref * @param matrix[][] * @param negFlag * @param scale * @return */ int SubMatrix::getMatrix(Matrix* matptr, Xref* xref, int matrix[NUMRES][NUMRES], bool negFlag, int scale, bool minimise) { int ggScore = 0; int grScore = 0; int i, j, k, ix = 0; int ti, tj; int maxRes; int av1, av2, av3, min, max; for (i = 0; i < NUMRES; i++) { for (j = 0; j < NUMRES; j++) { matrix[i][j] = 0; } } ix = 0; maxRes = 0; for (i = 0; i <= userParameters->getMaxAA(); i++) { ti = (*xref)[i]; for (j = 0; j <= i; j++) { tj = (*xref)[j]; if ((ti != - 1) && (tj != - 1)) { k = (*matptr)[ix]; if (ti == tj) { matrix[ti][ti] = k * scale; maxRes++; } else { matrix[ti][tj] = k * scale; matrix[tj][ti] = k * scale; } ix++; } } } --maxRes; av1 = av2 = av3 = 0; for (i = 0; i <= userParameters->getMaxAA(); i++) { for (j = 0; j <= i; j++) { av1 += matrix[i][j]; if (i == j) { av2 += matrix[i][j]; } else { av3 += matrix[i][j]; } } } av1 /= (maxRes * maxRes) / 2; av2 /= maxRes; av3 = static_cast(av3 / (((float)(maxRes * maxRes - maxRes)) / 2)); matrixAvgScore = - av3; min = max = matrix[0][0]; for (i = 0; i <= userParameters->getMaxAA(); i++) for (j = 1; j <= i; j++) { if (matrix[i][j] < min) { min = matrix[i][j]; } if (matrix[i][j] > max) { max = matrix[i][j]; } } //cout << "MAX = " << max << "\n"; if(!minimise) { /* if requested, make a positive matrix - add -(lowest score) to every entry */ if (negFlag == false) { if (min < 0) { for (i = 0; i <= userParameters->getMaxAA(); i++) { ti = (*xref)[i]; if (ti != - 1) { for (j = 0; j <= userParameters->getMaxAA(); j++) { tj = (*xref)[j]; if (tj != - 1) { matrix[ti][tj] -= min; } } } } } } // local copies of the gap positions int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); for (i = 0; i < userParameters->getGapPos1(); i++) { matrix[i][_gapPos1] = grScore; matrix[_gapPos1][i] = grScore; matrix[i][_gapPos2] = grScore; matrix[_gapPos2][i] = grScore; } matrix[_gapPos1][_gapPos1] = ggScore; matrix[_gapPos2][_gapPos2] = ggScore; matrix[_gapPos2][_gapPos1] = ggScore; matrix[_gapPos1][_gapPos2] = ggScore; } else { // DO THE SAGA MATRIX for (i = 0; i <= userParameters->getMaxAA(); i++) { for (j = 0; j <= userParameters->getMaxAA(); j++) { matrix[i][j] = max - matrix[i][j]; } } } maxRes += 2; return (maxRes); } /** * The function getUserMatFromFile is used to read in a user defined matrix. * @param str * @param alignResidueType * @param alignType * @return */ bool SubMatrix::getUserMatFromFile(char *str, int alignResidueType, int alignType) { int maxRes; FILE *infile; // Need to check if the values are a valid combination! checkResidueAndAlignType(alignResidueType, alignType); if(userParameters->getMenuFlag()) { utilityObject->getStr(string("Enter name of the matrix file"), line2); } else { line2 = string(str); } if(line2.size() == 0) { return false; } if((infile = fopen(line2.c_str(), "r")) == NULL) { utilityObject->error("Cannot find matrix file [%s]", line2.c_str()); return false; } strcpy(str, line2.c_str()); // Find out which part of the code we are reading the matrix in for. mat = getUserMatAddress(alignResidueType, alignType); xref = getUserXrefAddress(alignResidueType, alignType); if ((alignResidueType == Protein) && (alignType == MultipleAlign)) { // Try read in a matrix series. maxRes = readMatrixSeries(str, userMat, AAXref); } else // Read in a single matrix!!! { maxRes = readUserMatrix(str, *mat, *xref); } if (maxRes <= 0) return false; return true; } /** * The function compareMatrices is used to compare 2 matrices that have been read in. * It will compare them in a given region. It will not compare all of them, as some of it * will be random memory. * @param mat1[][] * @param mat2[][] */ void SubMatrix::compareMatrices(int mat1[NUMRES][NUMRES], int mat2[NUMRES][NUMRES]) { int same = 1; for(int row = 0; row < NUMRES; row++) { for(int col = 0; col < NUMRES; col++) { if(mat1[row][col] != mat2[row][col]) { same = 0; cout << "The row is " << row << ". The column is " << col << endl; break; // It is not the same. End the loop. } } } if(same == 0) { cout << "It was not the same\n"; } else { cout << "It is the same\n"; } } /** * This function is simply to display the results of the getMatrix function. * This is so that I can compare it to the original clustal version of it. * @param mat[][] */ void SubMatrix::printGetMatrixResults(int mat[NUMRES][NUMRES]) { ofstream outfile("getmatrix.out"); if(!outfile) cerr<<"oops failed to open !!!\n"; for(int row = 0; row < NUMRES; row++) { for(int col = 0; col < NUMRES; col++) { if((mat[row][col] > 9) || (mat[row][col] < 0)) { outfile <<" "<< mat[row][col]<<","; } else { outfile <<" "<< mat[row][col]<<","; } } outfile<<"\n"; } } /** * This function is from the old interface. It simply calls the readMatrixSeries * function. It seems to only be called from the commandline part. * @param str * @return */ bool SubMatrix::getUserMatSeriesFromFile(char *str) { int maxRes; FILE *infile; if(userParameters->getMenuFlag()) // Check if we are using menu! { utilityObject->getStr(string("Enter name of the matrix file"), line2); } else { //strcpy(lin2,str); line2 = string(str); } if(line2.size() == 0) return false; if((infile = fopen(line2.c_str(), "r"))==NULL) { utilityObject->error("Cannot find matrix file [%s]",line2.c_str()); return false; } strcpy(str, line2.c_str()); maxRes = readMatrixSeries(str, userMat, AAXref); if (maxRes <= 0) return false; return true; } /* * The function readMatrixSeries is used to read in a series of matrices from a file. * It calls readUserMatrix to read in the individual matrices. The matrices are stored * in userMatSeries. */ int SubMatrix::readMatrixSeries(const char *fileName, Matrix& userMat, Xref& xref) { FILE *fd = NULL; char mat_fileName[FILENAMELEN]; char inline1[1024]; int maxRes = 0; int nmat; int n, llimit, ulimit; if (fileName[0] == '\0') { utilityObject->error("comparison matrix not specified"); return ((int)0); } if ((fd = fopen(fileName, "r")) == NULL) { utilityObject->error("cannot open %s", fileName); return ((int)0); } /* check the first line to see if it's a series or a single matrix */ while (fgets(inline1, 1024, fd) != NULL) { if (commentline(inline1)) { continue; } if (utilityObject->lineType(inline1, "CLUSTAL_SERIES")) { userSeries = true; } else { userSeries = false; } break; } /* it's a single matrix */ if (userSeries == false) { fclose(fd); maxRes = readUserMatrix(fileName, userMat, xref); return (maxRes); } /* it's a series of matrices, find the next MATRIX line */ nmat = 0; matSeries.nmat = 0; while (fgets(inline1, 1024, fd) != NULL) { if (commentline(inline1)) { continue; } if (utilityObject->lineType(inline1, "MATRIX")) // Have found a matrix { if (sscanf(inline1 + 6, "%d %d %s", &llimit, &ulimit, mat_fileName) != 3) { utilityObject->error("Bad format in file %s\n", fileName); fclose(fd); return ((int)0); } if (llimit < 0 || llimit > 100 || ulimit < 0 || ulimit > 100) { utilityObject->error("Bad format in file %s\n", fileName); fclose(fd); return ((int)0); } if (ulimit <= llimit) { utilityObject->error("in file %s: lower limit is greater than upper (%d-%d)\n", fileName, llimit, ulimit); fclose(fd); return ((int)0); } n = readUserMatrix(mat_fileName, userMatSeries[nmat], AAXrefseries[nmat]); //cout << "Read in matrix number " << nmat << "\n"; // NOTE Testing!!!!! char nameOfFile[] = "matrix"; printInFormat(userMatSeries[nmat], nameOfFile); if (n <= 0) { utilityObject->error("Bad format in matrix file %s\n", mat_fileName); fclose(fd); return ((int)0); } matSeries.mat[nmat].llimit = llimit; matSeries.mat[nmat].ulimit = ulimit; matSeries.mat[nmat].matptr = &userMatSeries[nmat]; matSeries.mat[nmat].AAXref = &AAXrefseries[nmat]; nmat++; if(nmat >= MAXMAT) { // We have read in all the matrices that we can read into this vector // Write a message to the screen, and break out of loop. cerr << "The matrix series file has more entries than allowed in \n" << "a user defined series. The most that are allowed is " << MAXMAT << ".\n" << "The first " << MAXMAT << " have been read in and will be used.\n"; break; // Get out of the loop! } } } fclose(fd); matSeries.nmat = nmat; maxRes = n; return (maxRes); } /* * This function is used to read a single user matrix from a file. * It can be called repeatedly if there are multiple matrices in the file. */ int SubMatrix::readUserMatrix(const char *fileName, Matrix& userMat, Xref& xref) { double f; FILE *fd; int numargs, farg; int i, j, k = 0; char codes[NUMRES]; char inline1[1024]; char *args[NUMRES + 4]; char c1, c2; int ix1, ix = 0; int maxRes = 0; float scale; if (fileName[0] == '\0') { utilityObject->error("comparison matrix not specified"); return ((int)0); } if ((fd = fopen(fileName, "r")) == NULL) { utilityObject->error("cannot open %s", fileName); return ((int)0); } maxRes = 0; while (fgets(inline1, 1024, fd) != NULL) { if (commentline(inline1)) { continue; } if (utilityObject->lineType(inline1, "CLUSTAL_SERIES")) { utilityObject->error("in %s - single matrix expected.", fileName); fclose(fd); return ((int)0); } /* read residue characters. */ k = 0; for (j = 0; j < (int)strlen(inline1); j++) { if (isalpha((int)inline1[j])) { codes[k++] = inline1[j]; } if (k > NUMRES) { utilityObject->error("too many entries in matrix %s", fileName); fclose(fd); return ((int)0); } } codes[k] = '\0'; break; } if (k == 0) { utilityObject->error("wrong format in matrix %s", fileName); fclose(fd); return ((int)0); } /* cross-reference the residues */ for (i = 0; i < NUMRES; i++) { xref[i] = - 1; } maxRes = 0; for (i = 0; (c1 = codes[i]); i++) { for (j = 0; (c2 = userParameters->getAminoAcidCode(j)); j++) if (c1 == c2) { xref[i] = j; maxRes++; break; } if ((xref[i] == - 1) && (codes[i] != '*')) { utilityObject->warning("residue %c in matrix %s not recognised", codes[i], fileName); } } /* get the weights */ ix = ix1 = 0; while (fgets(inline1, 1024, fd) != NULL) { if (inline1[0] == '\n') { continue; } if (inline1[0] == '#' || inline1[0] == '!') { break; } numargs = getArgs(inline1, args, (int)(k + 1)); if (numargs < maxRes) { utilityObject->error("wrong format in matrix %s", fileName); fclose(fd); return ((int)0); } if (isalpha(args[0][0])) { farg = 1; } else { farg = 0; } /* decide whether the matrix values are float or decimal */ scale = 1.0; for (i = 0; i < (int)strlen(args[farg]); i++) if (args[farg][i] == '.') { /* we've found a float value */ scale = 10.0; break; } for (i = 0; i <= ix; i++) { if (xref[i] != - 1) { f = atof(args[i + farg]); userMat[ix1++] = (short)(f *scale); } } ix++; } if (ix != k + 1) { utilityObject->error("wrong format in matrix %s", fileName); fclose(fd); return ((int)0); } userMat.resize(ix1 + 1); maxRes += 2; fclose(fd); return (maxRes); } /** * * @param inline1 * @param args[] * @param max * @return */ int SubMatrix::getArgs(char *inline1,char *args[],int max) { char *inptr; int i; inptr = inline1; for (i = 0; i <= max; i++) { if ((args[i] = strtok(inptr, " \t\n")) == NULL) { break; } inptr = NULL; } return (i); } /** * * @return */ int SubMatrix::getMatrixNum() { return matrixNum; } /** * * @return */ int SubMatrix::getDNAMatrixNum() { return DNAMatrixNum; } /** * * @return */ int SubMatrix::getPWMatrixNum() { return pwMatrixNum; } /** * * @return */ int SubMatrix::getPWDNAMatrixNum() { return pwDNAMatrixNum; } /** * The function setCurrentNameAndNum is used to select a matrix series. * This will then be used for the alignment. The matrices will change, but the * series remains the same. We can set the series for pairwise/full for both * protein and DNA. NOTE: The default can be set to user defined matrices. * @param _matrixName * @param _matrixNum * @param alignResidueType * @param alignType */ void SubMatrix::setCurrentNameAndNum(string _matrixName, int _matrixNum, int alignResidueType,int alignType) { // Check if the values are valid. checkResidueAndAlignType(alignResidueType, alignType); string residue; string align; if((alignResidueType == Protein) && (alignType == Pairwise)) { residue = "Protein"; align = "Pairwise"; pwMatrixNum = _matrixNum; pwMatrixName = new string(_matrixName); } else if((alignResidueType == Protein) && (alignType == MultipleAlign)) { residue = "Protein"; align = "MultipleAlign"; matrixNum = _matrixNum; matrixName = new string(_matrixName); } else if((alignResidueType == DNA) && (alignType == Pairwise)) { residue = "DNA"; align = "Pairwise"; pwDNAMatrixNum = _matrixNum; pwDNAMatrixName = new string(_matrixName); } else if((alignResidueType == DNA) && (alignType == MultipleAlign)) { residue = "DNA"; align = "MultipleAlign"; DNAMatrixNum = _matrixNum; DNAMatrixName = new string(_matrixName); } #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << "The matrix/matrix series has been changed for " << "(" << residue << " AND " << align << ")." << " New value: " << _matrixName << "\n\n"; logObject->logMsg(outs.str()); } #endif } /** * * @param alignResidueType * @param alignType * @return */ int SubMatrix::getMatrixNumForMenu(int alignResidueType, int alignType) { checkResidueAndAlignType(alignResidueType, alignType); if((alignResidueType == Protein) && (alignType == Pairwise)) { return pwMatrixNum; } else if((alignResidueType == Protein) && (alignType == MultipleAlign)) { return matrixNum; } else if((alignResidueType == DNA) && (alignType == Pairwise)) { return pwDNAMatrixNum; } else if((alignResidueType == DNA) && (alignType == MultipleAlign)) { return DNAMatrixNum; } else return -100; // NOTE NONE of these. I need to put in better error checking } /** * * @param line * @return */ bool SubMatrix::commentline(char* line) { int i; if (line[0] == '#') { return true; } for (i = 0; line[i] != '\n' && line[i] != EOS; i++) { if (!isspace(line[i])) { return false; } } return true; } /** * This function prints out the vector to the file specified by name. * The vector is printed out in a triangular format, the same as the way * the arrays are displayed in matrices.h. This function is for testing purposes. * @param temp * @param name */ void SubMatrix::printInFormat(vector& temp, char* name) { char nameOfFile[30]; strcpy(nameOfFile, name); strcat(nameOfFile, ".out"); ofstream outfile(nameOfFile); if(!outfile) cerr<<"oops failed to open !!!\n"; outfile<<"short "< 9) || (temp[i] < 0)) { outfile <<" "<< temp[i]<<","; } else { outfile <<" "<< temp[i]<<","; } // Now increment so far soFar++; // Check to see if the next element is the last element if((i + 1) == (int)temp.size() - 1) { // Print out the last element. Then a curly brace, and break. if((temp[i+1] > 9) || (temp[i+1] < 0)) { outfile <<" "<< temp[i + 1]<<"};\n"; } else { outfile <<" "<< temp[i + 1]<<"};\n"; } break; } } ofstream outfile2("temp.out"); for(int i = 0; i < (int)temp.size(); i++) { outfile2 << temp[i] << " "; } } /** * * @param temp * @param name */ void SubMatrix::printVectorToFile(vector& temp, char* name) { char nameOfFile[30]; strcpy(nameOfFile, name); strcat(nameOfFile, ".out"); ofstream outfile(nameOfFile); if(!outfile) cerr<<"oops failed to open !!!\n"; for(int i = 0; i < (int)temp.size(); i++) { if((temp[i] > 9) || (temp[i] < 0)) { outfile <<" "<< temp[i]<<","; } else { outfile <<" "<< temp[i]<<","; } } outfile.close(); } /** * * @param alignResidueType * @param alignType * @return */ Matrix* SubMatrix::getUserMatAddress(int alignResidueType, int alignType) { if((alignResidueType == Protein) && (alignType == Pairwise)) { return &pwUserMat; } else if((alignResidueType == Protein) && (alignType == MultipleAlign)) { return &userMat; } else if((alignResidueType == DNA) && (alignType == Pairwise)) { return &pwUserDNAMat; } else if((alignResidueType == DNA) && (alignType == MultipleAlign)) { return &userDNAMat; } return NULL; } /** * * @param alignResidueType * @param alignType * @return */ Xref* SubMatrix::getUserXrefAddress(int alignResidueType, int alignType) { if((alignResidueType == Protein) && (alignType == Pairwise)) { return &pwAAXref; } else if((alignResidueType == Protein) && (alignType == MultipleAlign)) { return &AAXref; } else if((alignResidueType == DNA) && (alignType == Pairwise)) { return &pwDNAXref; } else if((alignResidueType == DNA) && (alignType == MultipleAlign)) { return &DNAXref; } return NULL; } /** * This is an error handling routine. If an incorrect combination of values * is given, it will terminate the program. * @param alignResidueType * @param alignType */ void SubMatrix::checkResidueAndAlignType(int alignResidueType, int alignType) { if(((alignResidueType != 0) && (alignResidueType != 1)) || ((alignType != 0) && (alignType != 1))) { InvalidCombination ex(alignResidueType, alignType); ex.whatHappened(); exit(1); } } /** * The function tempInterface is used to call the SubMatrix in the way it is * supposed to be used. It is for testing purposes. * @param alignResidueType * @param alignType */ void SubMatrix::tempInterface(int alignResidueType, int alignType) { char userFile[FILENAMELEN + 1]; userParameters->setDNAFlag(true); strcpy(userFile, "mat1"); userParameters->setMenuFlag(false); getUserMatFromFile(userFile, DNA, Pairwise); setCurrentNameAndNum(userFile, 4, 3, Pairwise); setCurrentNameAndNum("gonnet", 4, Protein, Pairwise); } /** * A single matrix is used in scoring the alignment. This is Blosum45. This is the * function to get it. * @param matrix[][] * @return */ int SubMatrix::getAlnScoreMatrix(int matrix[NUMRES][NUMRES]) { int _maxNumRes; /* //_maxNumRes = getMatrix(blosum45mtVec, &defaultAAXref, matrix, true, 100); _maxNumRes = getMatrix(blosum45mtVec, &defaultAAXref, matrix, false, 1, true); //_maxNumRes = getMatrix(blosum62mt2Vec, &defaultAAXref, matrix, true, 100); */ // 1.83 style _maxNumRes = getMatrix(blosum45mtVec, &defaultAAXref, matrix, true, 100); return _maxNumRes; } /** * This function is used to get the matrix that will be used for the calculation of * the histogram. The histogram values are used in ClustalQt. * @param matrix[][] * @param matNum * @param dnaMatNum */ void SubMatrix::getQTMatrixForHistogram(int matrix[NUMRES][NUMRES]) { Matrix* _matPtrLocal; Xref* _matXrefLocal; int maxRes; if(userParameters->getDNAFlag()) { if (QTDNAHistMatNum == DNAUSERDEFINED) { _matPtrLocal = &QTscoreUserDNAMatrix; _matXrefLocal = &QTscoreDNAXref; } else if (QTDNAHistMatNum == DNACLUSTALW) { _matPtrLocal = clustalvdnamtVec; _matXrefLocal = &defaultDNAXref; } else { _matPtrLocal = swgapdnamtVec; _matXrefLocal = &defaultDNAXref; } } else { if (QTAAHistMatNum == AAHISTIDENTITY) { _matPtrLocal = idmatVec; _matXrefLocal = &defaultAAXref; } else if (QTAAHistMatNum == AAHISTGONNETPAM80) { _matPtrLocal = gon80mtVec; _matXrefLocal = &defaultAAXref; } else if (QTAAHistMatNum == AAHISTGONNETPAM120) { _matPtrLocal = gon120mtVec; _matXrefLocal = &defaultAAXref; } else if (QTAAHistMatNum == AAHISTUSER) { _matPtrLocal = &QTscoreUserMatrix; _matXrefLocal = &QTscoreXref; } else if (QTAAHistMatNum == AAHISTGONNETPAM350) { _matPtrLocal = gon350mtVec; _matXrefLocal = &defaultAAXref; } else // Default { _matPtrLocal = gon250mtVec; _matXrefLocal = &defaultAAXref; } } maxRes = getMatrix(_matPtrLocal, _matXrefLocal, matrix, false, 100); } void SubMatrix::getQTMatrixForLowScoreSeg(int matrix[NUMRES][NUMRES]) { Matrix* _matPtrLocal; Xref* _matXrefLocal; int maxRes; int _maxAA = userParameters->getMaxAA(); int max = 0; int offset; if(userParameters->getDNAFlag()) { if (QTsegmentDNAMatNum == DNAUSERDEFINED) { _matPtrLocal = &QTsegmentDNAMatrix; _matXrefLocal = &QTsegmentDNAXref; } else if (QTsegmentDNAMatNum == DNACLUSTALW) { _matPtrLocal = clustalvdnamtVec; _matXrefLocal = &defaultDNAXref; } else { _matPtrLocal = swgapdnamtVec; _matXrefLocal = &defaultDNAXref; } /* get a positive matrix - then adjust it according to scale */ maxRes = getMatrix(_matPtrLocal, _matXrefLocal, matrix, false, 100); /* find the maximum value */ for(int i = 0; i <= _maxAA; i++) { for(int j = 0; j <= _maxAA; j++) { if(matrix[i][j] > max) { max = matrix[i][j]; } } } /* subtract max * scale / 2 from each matrix value */ offset = static_cast(static_cast(max * userParameters->getQTlowScoreDNAMarkingScale()) / 20.0); for(int i = 0; i <= _maxAA; i++) { for(int j = 0; j <= _maxAA; j++) { matrix[i][j] -= offset; } } } else { if (QTsegmentAAMatNum == QTAASEGGONNETPAM80) { _matPtrLocal = gon80mtVec; _matXrefLocal = &defaultAAXref; } else if (QTsegmentAAMatNum == QTAASEGGONNETPAM120) { _matPtrLocal = gon120mtVec; _matXrefLocal = &defaultAAXref; } else if (QTsegmentAAMatNum == QTAASEGUSER) { _matPtrLocal = &QTsegmentAAMatrix; _matXrefLocal = &QTsegmentAAXref; } else if (QTsegmentAAMatNum == QTAASEGGONNETPAM350) { _matPtrLocal = gon350mtVec; _matXrefLocal = &defaultAAXref; } else { _matPtrLocal = gon250mtVec; _matXrefLocal = &defaultAAXref; } /* get a negative matrix */ maxRes = getMatrix(_matPtrLocal, _matXrefLocal, matrix, true, 100); } } bool SubMatrix::getQTLowScoreMatFromFile(char* fileName, bool dna) { int maxRes; FILE *infile; line2 = string(fileName); if(line2.size() == 0) { return false; } if((infile = fopen(line2.c_str(), "r")) == NULL) { utilityObject->error("Cannot find matrix file [%s]", line2.c_str()); return false; } strcpy(fileName, line2.c_str()); if(dna) { maxRes = readUserMatrix(fileName, QTsegmentDNAMatrix, QTsegmentDNAXref); } else { maxRes = readUserMatrix(fileName, QTsegmentAAMatrix, QTsegmentAAXref); } if (maxRes <= 0) { return false; } return true; } bool SubMatrix::getAAScoreMatFromFile(char *str) { int maxRes; FILE *infile; line2 = string(str); if(line2.size() == 0) { return false; } if((infile = fopen(line2.c_str(), "r")) == NULL) { utilityObject->error("Cannot find matrix file [%s]", line2.c_str()); return false; } strcpy(str, line2.c_str()); maxRes = readUserMatrix(str, QTscoreUserMatrix, QTscoreXref); if (maxRes <= 0) { return false; } return true; } bool SubMatrix::getDNAScoreMatFromFile(char *str) { int maxRes; FILE *infile; line2 = string(str); if(line2.size() == 0) { return false; } if((infile = fopen(line2.c_str(), "r")) == NULL) { utilityObject->error("Cannot find matrix file [%s]", line2.c_str()); return false; } strcpy(str, line2.c_str()); maxRes = readUserMatrix(str, QTscoreUserDNAMatrix, QTscoreDNAXref); if (maxRes <= 0) { return false; } return true; } } clustalw-2.1/src/substitutionMatrix/globalmatrix.h0000644000175000017500000000065411442167171017532 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef GLOBALMATRIX_H #define GLOBALMATRIX_H #include "SubMatrix.h" namespace clustalw { // Mark Dec 13 2005 /* * The reason for having a global sub matrix object is that we have * user defined matrices that can be read in at any time and then used later in the * MSA stage. */ extern SubMatrix *subMatrix; } #endif clustalw-2.1/src/substitutionMatrix/matrices.h0000644000175000017500000011602011442167171016647 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef MATRICES_H #define MATRICES_H namespace clustalw { short blosum30mt[]={ 4, 0, 5, -3, -2, 17, 0, 5, -3, 9, 0, 0, 1, 1, 6, -2, -3, -3, -5, -4, 10, 0, 0, -4, -1, -2, -3, 8, -2, -2, -5, -2, 0, -3, -3, 14, 0, -2, -2, -4, -3, 0, -1, -2, 6, 0, 0, -3, 0, 2, -1, -1, -2, -2, 4, -1, -1, 0, -1, -1, 2, -2, -1, 2, -2, 4, 1, -2, -2, -3, -1, -2, -2, 2, 1, 2, 2, 6, 0, 4, -1, 1, -1, -1, 0, -1, 0, 0, -2, 0, 8, -1, -2, -3, -1, 1, -4, -1, 1, -3, 1, -3, -4, -3, 11, 1, -1, -2, -1, 2, -3, -2, 0, -2, 0, -2, -1, -1, 0, 8, -1, -2, -2, -1, -1, -1, -2, -1, -3, 1, -2, 0, -2, -1, 3, 8, 1, 0, -2, 0, 0, -1, 0, -1, -1, 0, -2, -2, 0, -1, -1, -1, 4, 1, 0, -2, -1, -2, -2, -2, -2, 0, -1, 0, 0, 1, 0, 0, -3, 2, 5, 1, -2, -2, -2, -3, 1, -3, -3, 4, -2, 1, 0, -2, -4, -3, -1, -1, 1, 5, -5, -5, -2, -4, -1, 1, 1, -5, -3, -2, -2, -3, -7, -3, -1, 0, -3, -5, -3, 20, 0, -1, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, -2, -1, -4, -3, -6, -1, -2, 3, -3, 0, -1, -1, 3, -1, -4, -2, -1, 0, -2, -1, 1, 5, -1, 9, 0, 0, 0, 0, 5, -4, -2, 0, -3, 1, -1, -1, -1, 0, 4, 0, -1, -1, -3, -1, 0, -2, 4}; /* short blosum35mt[]={ 5, -1, 5, -2, -2, 15, -1, 5, -3, 8, -1, 0, -1, 2, 6, -2, -2, -4, -3, -3, 8, 0, 0, -3, -2, -2, -3, 7, -2, 0, -4, 0, -1, -3, -2, 12, -1, -2, -4, -3, -3, 1, -3, -3, 5, 0, 0, -2, -1, 1, -1, -1, -2, -2, 5, -2, -2, -2, -2, -1, 2, -3, -2, 2, -2, 5, 0, -2, -4, -3, -2, 0, -1, 1, 1, 0, 3, 6, -1, 4, -1, 1, -1, -1, 1, 1, -1, 0, -2, -1, 7, -2, -1, -4, -1, 0, -4, -2, -1, -1, 0, -3, -3, -2, 10, 0, 0, -3, -1, 2, -4, -2, -1, -2, 0, -2, -1, 1, 0, 7, -1, -1, -3, -1, -1, -1, -2, -1, -3, 2, -2, 0, -1, -2, 2, 8, 1, 0, -3, -1, 0, -1, 1, -1, -2, 0, -2, -1, 0, -2, 0, -1, 4, 0, -1, -1, -1, -1, -1, -2, -2, -1, 0, 0, 0, 0, 0, 0, -2, 2, 5, 0, -2, -2, -2, -2, 1, -3, -4, 4, -2, 2, 1, -2, -3, -3, -1, -1, 1, 5, -2, -3, -5, -3, -1, 1, -1, -4, -1, 0, 0, 1, -2, -4, -1, 0, -2, -2, -2, 16, 0, -1, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, -2, -5, -2, -1, 3, -2, 0, 0, -1, 0, 0, -2, -3, 0, 0, -1, -2, 0, 3, -1, 8, -1, 0, -2, 1, 5, -3, -2, -1, -3, 1, -2, -2, 0, 0, 4, 0, 0, -1, -2, -1, 0, -1, 4}; */ short blosum40mt[]={ 5, -1, 5, -2, -2, 16, -1, 6, -2, 9, -1, 1, -2, 2, 7, -3, -3, -2, -4, -3, 9, 1, -1, -3, -2, -3, -3, 8, -2, 0, -4, 0, 0, -2, -2, 13, -1, -3, -4, -4, -4, 1, -4, -3, 6, -1, 0, -3, 0, 1, -3, -2, -1, -3, 6, -2, -3, -2, -3, -2, 2, -4, -2, 2, -2, 6, -1, -3, -3, -3, -2, 0, -2, 1, 1, -1, 3, 7, -1, 4, -2, 2, -1, -3, 0, 1, -2, 0, -3, -2, 8, -2, -2, -5, -2, 0, -4, -1, -2, -2, -1, -4, -2, -2, 11, 0, 0, -4, -1, 2, -4, -2, 0, -3, 1, -2, -1, 1, -2, 8, -2, -1, -3, -1, -1, -2, -3, 0, -3, 3, -2, -1, 0, -3, 2, 9, 1, 0, -1, 0, 0, -2, 0, -1, -2, 0, -3, -2, 1, -1, 1, -1, 5, 0, 0, -1, -1, -1, -1, -2, -2, -1, 0, -1, -1, 0, 0, -1, -2, 2, 6, 0, -3, -2, -3, -3, 0, -4, -4, 4, -2, 2, 1, -3, -3, -3, -2, -1, 1, 5, -3, -4, -6, -5, -2, 1, -2, -5, -3, -2, -1, -2, -4, -4, -1, -2, -5, -4, -3, 19, 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -2, -1, -1, 0, 0, -1, -2, -1, -2, -3, -4, -3, -2, 4, -3, 2, 0, -1, 0, 1, -2, -3, -1, -1, -2, -1, -1, 3, -1, 9, -1, 2, -3, 1, 5, -4, -2, 0, -4, 1, -2, -2, 0, -1, 4, 0, 0, -1, -3, -2, -1, -2, 5}; short blosum45mt[]={ 5, -1, 4, -1, -2, 12, -2, 5, -3, 7, -1, 1, -3, 2, 6, -2, -3, -2, -4, -3, 8, 0, -1, -3, -1, -2, -3, 7, -2, 0, -3, 0, 0, -2, -2, 10, -1, -3, -3, -4, -3, 0, -4, -3, 5, -1, 0, -3, 0, 1, -3, -2, -1, -3, 5, -1, -3, -2, -3, -2, 1, -3, -2, 2, -3, 5, -1, -2, -2, -3, -2, 0, -2, 0, 2, -1, 2, 6, -1, 4, -2, 2, 0, -2, 0, 1, -2, 0, -3, -2, 6, -1, -2, -4, -1, 0, -3, -2, -2, -2, -1, -3, -2, -2, 9, -1, 0, -3, 0, 2, -4, -2, 1, -2, 1, -2, 0, 0, -1, 6, -2, -1, -3, -1, 0, -2, -2, 0, -3, 3, -2, -1, 0, -2, 1, 7, 1, 0, -1, 0, 0, -2, 0, -1, -2, -1, -3, -2, 1, -1, 0, -1, 4, 0, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 2, 5, 0, -3, -1, -3, -3, 0, -3, -3, 3, -2, 1, 1, -3, -3, -3, -2, -1, 0, 5, -2, -4, -5, -4, -3, 1, -2, -3, -2, -2, -2, -2, -4, -3, -2, -2, -4, -3, -3, 15, 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -2, -1, -2, -2, -3, -2, -2, 3, -3, 2, 0, -1, 0, 0, -2, -3, -1, -1, -2, -1, -1, 3, -1, 8, -1, 2, -3, 1, 4, -3, -2, 0, -3, 1, -2, -1, 0, -1, 4, 0, 0, -1, -3, -2, -1, -2, 4}; /* short blosum50mt[]={ 5, -2, 5, -1, -3, 13, -2, 5, -4, 8, -1, 1, -3, 2, 6, -3, -4, -2, -5, -3, 8, 0, -1, -3, -1, -3, -4, 8, -2, 0, -3, -1, 0, -1, -2, 10, -1, -4, -2, -4, -4, 0, -4, -4, 5, -1, 0, -3, -1, 1, -4, -2, 0, -3, 6, -2, -4, -2, -4, -3, 1, -4, -3, 2, -3, 5, -1, -3, -2, -4, -2, 0, -3, -1, 2, -2, 3, 7, -1, 4, -2, 2, 0, -4, 0, 1, -3, 0, -4, -2, 7, -1, -2, -4, -1, -1, -4, -2, -2, -3, -1, -4, -3, -2, 10, -1, 0, -3, 0, 2, -4, -2, 1, -3, 2, -2, 0, 0, -1, 7, -2, -1, -4, -2, 0, -3, -3, 0, -4, 3, -3, -2, -1, -3, 1, 7, 1, 0, -1, 0, -1, -3, 0, -1, -3, 0, -3, -2, 1, -1, 0, -1, 5, 0, 0, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 2, 5, 0, -4, -1, -4, -3, -1, -4, -4, 4, -3, 1, 1, -3, -3, -3, -3, -2, 0, 5, -3, -5, -5, -5, -3, 1, -3, -3, -3, -3, -2, -1, -4, -4, -1, -3, -4, -3, -3, 15, -1, -1, -2, -1, -1, -2, -2, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, 0, -1, -3, -1, -2, -3, -3, -3, -2, 4, -3, 2, -1, -2, -1, 0, -2, -3, -1, -1, -2, -2, -1, 2, -1, 8, -1, 2, -3, 1, 5, -4, -2, 0, -3, 1, -3, -1, 0, -1, 4, 0, 0, -1, -3, -2, -1, -2, 5}; short blosum55mt[]={ 5, -2, 5, 0, -4, 13, -2, 5, -4, 8, -1, 1, -4, 2, 7, -3, -5, -3, -5, -4, 9, 0, -1, -3, -2, -3, -4, 8, -2, 0, -4, -1, -1, -1, -2, 11, -2, -4, -2, -4, -4, 0, -5, -4, 6, -1, 0, -4, -1, 1, -4, -2, 0, -4, 6, -2, -4, -2, -5, -4, 1, -5, -3, 2, -3, 6, -1, -3, -2, -4, -3, 0, -3, -2, 2, -2, 3, 8, -2, 4, -3, 2, 0, -4, 0, 1, -4, 0, -4, -3, 8, -1, -2, -3, -2, -1, -5, -3, -3, -3, -1, -4, -3, -2, 10, -1, 0, -4, 0, 2, -4, -2, 1, -4, 2, -3, 0, 0, -1, 7, -2, -1, -4, -2, 0, -3, -3, 0, -4, 3, -3, -2, -1, -3, 1, 8, 2, 0, -1, 0, 0, -3, 0, -1, -3, 0, -3, -2, 1, -1, 0, -1, 5, 0, -1, -1, -1, -1, -3, -2, -2, -1, -1, -2, -1, 0, -1, -1, -1, 2, 6, 0, -4, -1, -4, -3, -1, -4, -4, 4, -3, 1, 1, -4, -3, -3, -3, -2, 0, 5, -4, -5, -4, -5, -3, 2, -3, -3, -3, -4, -3, -2, -5, -5, -2, -3, -4, -3, -4, 15, -1, -1, -2, -2, -1, -2, -2, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -3, -1, -2, -3, -3, -3, -2, 4, -4, 2, -1, -2, -1, -1, -2, -4, -1, -2, -2, -2, -2, 3, -1, 9, -1, 2, -4, 1, 5, -4, -3, 0, -4, 1, -3, -2, 0, -1, 4, 0, 0, -1, -3, -3, -1, -2, 5}; short blosum62mt[]={ 4, -2, 4, 0, -3, 9, -2, 4, -3, 6, -1, 1, -4, 2, 5, -2, -3, -2, -3, -3, 6, 0, -1, -3, -1, -2, -3, 6, -2, 0, -3, -1, 0, -1, -2, 8, -1, -3, -1, -3, -3, 0, -4, -3, 4, -1, 0, -3, -1, 1, -3, -2, -1, -3, 5, -1, -4, -1, -4, -3, 0, -4, -3, 2, -2, 4, -1, -3, -1, -3, -2, 0, -3, -2, 1, -1, 2, 5, -2, 3, -3, 1, 0, -3, 0, 1, -3, 0, -3, -2, 6, -1, -2, -3, -1, -1, -4, -2, -2, -3, -1, -3, -2, -2, 7, -1, 0, -3, 0, 2, -3, -2, 0, -3, 1, -2, 0, 0, -1, 5, -1, -1, -3, -2, 0, -3, -2, 0, -3, 2, -2, -1, 0, -2, 1, 5, 1, 0, -1, 0, 0, -2, 0, -1, -2, 0, -2, -1, 1, -1, 0, -1, 4, 0, -1, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 1, 5, 0, -3, -1, -3, -2, -1, -3, -3, 3, -2, 1, 1, -3, -2, -2, -3, -2, 0, 4, -3, -4, -2, -4, -3, 1, -2, -2, -3, -3, -2, -1, -4, -4, -2, -3, -3, -2, -3, 11, 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, 0, 0, -1, -2, -1, -2, -3, -2, -3, -2, 3, -3, 2, -1, -2, -1, -1, -2, -3, -1, -2, -2, -2, -1, 2, -1, 7, -1, 1, -3, 1, 4, -3, -2, 0, -3, 1, -3, -1, 0, -1, 3, 0, 0, -1, -2, -3, -1, -2, 4}; */ short blosum62mt2[]={ 8, -4, 8, 0, -6, 18, -4, 8, -6, 12, -2, 2, -8, 4, 10, -4, -6, -4, -6, -6, 12, 0, -2, -6, -2, -4, -6, 12, -4, 0, -6, -2, 0, -2, -4, 16, -2, -6, -2, -6, -6, 0, -8, -6, 8, -2, 0, -6, -2, 2, -6, -4, -2, -6, 10, -2, -8, -2, -8, -6, 0, -8, -6, 4, -4, 8, -2, -6, -2, -6, -4, 0, -6, -4, 2, -2, 4, 10, -4, 6, -6, 2, 0, -6, 0, 2, -6, 0, -6, -4, 12, -2, -4, -6, -2, -2, -8, -4, -4, -6, -2, -6, -4, -4, 14, -2, 0, -6, 0, 4, -6, -4, 0, -6, 2, -4, 0, 0, -2, 10, -2, -2, -6, -4, 0, -6, -4, 0, -6, 4, -4, -2, 0, -4, 2, 10, 2, 0, -2, 0, 0, -4, 0, -2, -4, 0, -4, -2, 2, -2, 0, -2, 8, 0, -2, -2, -2, -2, -4, -4, -4, -2, -2, -2, -2, 0, -2, -2, -2, 2, 10, 0, -6, -2, -6, -4, -2, -6, -6, 6, -4, 2, 2, -6, -4, -4, -6, -4, 0, 8, -6, -8, -4, -8, -6, 2, -4, -4, -6, -6, -4, -2, -8, -8, -4, -6, -6, -4, -6, 22, 0, -2, -4, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -4, -2, -2, 0, 0, -2, -4, -2, -4, -6, -4, -6, -4, 6, -6, 4, -2, -4, -2, -2, -4, -6, -2, -4, -4, -4, -2, 4, -2, 14, -2, 2, -6, 2, 8, -6, -4, 0, -6, 2, -6, -2, 0, -2, 6, 0, 0, -2, -4, -6, -2, -4, 8}; /* short blosum65mt[]={ 4, -2, 4, 0, -3, 9, -2, 4, -4, 6, -1, 1, -4, 2, 5, -2, -3, -2, -4, -3, 6, 0, -1, -3, -1, -2, -3, 6, -2, 0, -3, -1, 0, -1, -2, 8, -1, -3, -1, -3, -3, 0, -4, -3, 4, -1, 0, -3, -1, 1, -3, -2, -1, -3, 5, -2, -4, -1, -4, -3, 0, -4, -3, 2, -3, 4, -1, -3, -2, -3, -2, 0, -3, -2, 1, -2, 2, 6, -2, 3, -3, 1, 0, -3, -1, 1, -3, 0, -4, -2, 6, -1, -2, -3, -2, -1, -4, -2, -2, -3, -1, -3, -3, -2, 8, -1, 0, -3, 0, 2, -3, -2, 1, -3, 1, -2, 0, 0, -1, 6, -1, -1, -4, -2, 0, -3, -2, 0, -3, 2, -2, -2, 0, -2, 1, 6, 1, 0, -1, 0, 0, -2, 0, -1, -2, 0, -3, -2, 1, -1, 0, -1, 4, 0, -1, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 1, 5, 0, -3, -1, -3, -3, -1, -3, -3, 3, -2, 1, 1, -3, -2, -2, -3, -2, 0, 4, -3, -4, -2, -5, -3, 1, -3, -2, -2, -3, -2, -2, -4, -4, -2, -3, -3, -3, -3, 10, -1, -1, -2, -1, -1, -2, -2, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -2, -1, -2, -3, -2, -3, -2, 3, -3, 2, -1, -2, -1, -1, -2, -3, -2, -2, -2, -2, -1, 2, -1, 7, -1, 1, -4, 1, 4, -3, -2, 0, -3, 1, -3, -2, 0, -1, 3, 0, 0, -1, -2, -3, -1, -2, 4}; short blosum70mt[]={ 4, -2, 4, -1, -4, 9, -2, 4, -4, 6, -1, 1, -4, 1, 5, -2, -4, -2, -4, -4, 6, 0, -1, -3, -2, -2, -4, 6, -2, -1, -4, -1, 0, -1, -2, 8, -2, -4, -1, -4, -4, 0, -4, -4, 4, -1, -1, -4, -1, 1, -3, -2, -1, -3, 5, -2, -4, -2, -4, -3, 0, -4, -3, 2, -3, 4, -1, -3, -2, -3, -2, 0, -3, -2, 1, -2, 2, 6, -2, 3, -3, 1, 0, -3, -1, 0, -4, 0, -4, -2, 6, -1, -2, -3, -2, -1, -4, -3, -2, -3, -1, -3, -3, -2, 8, -1, 0, -3, -1, 2, -3, -2, 1, -3, 1, -2, 0, 0, -2, 6, -2, -1, -4, -2, 0, -3, -3, 0, -3, 2, -3, -2, -1, -2, 1, 6, 1, 0, -1, 0, 0, -3, -1, -1, -3, 0, -3, -2, 0, -1, 0, -1, 4, 0, -1, -1, -1, -1, -2, -2, -2, -1, -1, -2, -1, 0, -1, -1, -1, 1, 5, 0, -3, -1, -4, -3, -1, -4, -3, 3, -3, 1, 1, -3, -3, -2, -3, -2, 0, 4, -3, -4, -3, -5, -4, 1, -3, -2, -3, -3, -2, -2, -4, -4, -2, -3, -3, -3, -3, 11, -1, -1, -2, -2, -1, -2, -2, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -3, -1, -2, -3, -3, -4, -3, 3, -4, 2, -1, -2, -1, -1, -2, -3, -2, -2, -2, -2, -2, 2, -2, 7, -1, 0, -4, 1, 4, -4, -2, 0, -3, 1, -3, -2, 0, -1, 3, 0, 0, -1, -3, -3, -1, -2, 4}; short blosum75mt[]={ 4, -2, 4, -1, -4, 9, -2, 4, -4, 6, -1, 1, -5, 1, 5, -3, -4, -2, -4, -4, 6, 0, -1, -3, -2, -3, -4, 6, -2, -1, -4, -1, 0, -2, -2, 8, -2, -4, -1, -4, -4, 0, -5, -4, 4, -1, -1, -4, -1, 1, -4, -2, -1, -3, 5, -2, -4, -2, -4, -4, 0, -4, -3, 1, -3, 4, -1, -3, -2, -4, -2, 0, -3, -2, 1, -2, 2, 6, -2, 3, -3, 1, -1, -4, -1, 0, -4, 0, -4, -3, 6, -1, -2, -4, -2, -1, -4, -3, -2, -3, -1, -3, -3, -3, 8, -1, 0, -3, -1, 2, -4, -2, 1, -3, 1, -3, 0, 0, -2, 6, -2, -1, -4, -2, 0, -3, -3, 0, -3, 2, -3, -2, -1, -2, 1, 6, 1, 0, -1, -1, 0, -3, -1, -1, -3, 0, -3, -2, 0, -1, 0, -1, 5, 0, -1, -1, -1, -1, -2, -2, -2, -1, -1, -2, -1, 0, -1, -1, -1, 1, 5, 0, -4, -1, -4, -3, -1, -4, -4, 3, -3, 1, 1, -3, -3, -2, -3, -2, 0, 4, -3, -5, -3, -5, -4, 1, -3, -2, -3, -4, -2, -2, -4, -5, -2, -3, -3, -3, -3, 11, -1, -2, -2, -2, -1, -2, -2, -1, -2, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -3, -1, -2, -3, -3, -4, -3, 3, -4, 2, -2, -2, -1, -2, -3, -4, -2, -2, -2, -2, -2, 2, -2, 7, -1, 0, -4, 1, 4, -4, -2, 0, -4, 1, -3, -2, 0, -2, 3, 0, 0, -1, -3, -3, -1, -3, 4}; */ short blosum80mt[]={ 7, -3, 6, -1, -6, 13, -3, 6, -7, 10, -2, 1, -7, 2, 8, -4, -6, -4, -6, -6, 10, 0, -2, -6, -3, -4, -6, 9, -3, -1, -7, -2, 0, -2, -4, 12, -3, -6, -2, -7, -6, -1, -7, -6, 7, -1, -1, -6, -2, 1, -5, -3, -1, -5, 8, -3, -7, -3, -7, -6, 0, -7, -5, 2, -4, 6, -2, -5, -3, -6, -4, 0, -5, -4, 2, -3, 3, 9, -3, 5, -5, 2, -1, -6, -1, 1, -6, 0, -6, -4, 9, -1, -4, -6, -3, -2, -6, -5, -4, -5, -2, -5, -4, -4, 12, -2, -1, -5, -1, 3, -5, -4, 1, -5, 2, -4, -1, 0, -3, 9, -3, -2, -6, -3, -1, -5, -4, 0, -5, 3, -4, -3, -1, -3, 1, 9, 2, 0, -2, -1, -1, -4, -1, -2, -4, -1, -4, -3, 1, -2, -1, -2, 7, 0, -1, -2, -2, -2, -4, -3, -3, -2, -1, -3, -1, 0, -3, -1, -2, 2, 8, -1, -6, -2, -6, -4, -2, -6, -5, 4, -4, 1, 1, -5, -4, -4, -4, -3, 0, 7, -5, -8, -5, -8, -6, 0, -6, -4, -5, -6, -4, -3, -7, -7, -4, -5, -6, -5, -5, 16, -1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -3, -2, -2, -1, -1, -2, -5, -2, -4, -5, -5, -6, -5, 4, -6, 3, -3, -4, -2, -3, -4, -6, -3, -4, -3, -3, -3, 3, -3, 11, -2, 0, -7, 1, 6, -6, -4, 0, -6, 1, -5, -3, -1, -2, 5, 0, -1, -2, -4, -5, -1, -4, 6}; /* short blosum85mt[]={ 5, -2, 4, -1, -4, 9, -2, 4, -5, 7, -1, 0, -5, 1, 6, -3, -4, -3, -4, -4, 7, 0, -1, -4, -2, -3, -4, 6, -2, -1, -5, -2, -1, -2, -3, 8, -2, -5, -2, -5, -4, -1, -5, -4, 5, -1, -1, -4, -1, 0, -4, -2, -1, -3, 6, -2, -5, -2, -5, -4, 0, -5, -3, 1, -3, 4, -2, -4, -2, -4, -3, -1, -4, -3, 1, -2, 2, 7, -2, 4, -4, 1, -1, -4, -1, 0, -4, 0, -4, -3, 7, -1, -3, -4, -2, -2, -4, -3, -3, -4, -2, -4, -3, -3, 8, -1, -1, -4, -1, 2, -4, -3, 1, -4, 1, -3, 0, 0, -2, 6, -2, -2, -4, -2, -1, -4, -3, 0, -4, 2, -3, -2, -1, -2, 1, 6, 1, 0, -2, -1, -1, -3, -1, -1, -3, -1, -3, -2, 0, -1, -1, -1, 5, 0, -1, -2, -2, -1, -3, -2, -2, -1, -1, -2, -1, 0, -2, -1, -2, 1, 5, -1, -4, -1, -4, -3, -1, -4, -4, 3, -3, 0, 0, -4, -3, -3, -3, -2, 0, 5, -3, -5, -4, -6, -4, 0, -4, -3, -3, -5, -3, -2, -5, -5, -3, -4, -4, -4, -3, 11, -1, -2, -3, -2, -1, -2, -2, -2, -2, -1, -2, -1, -2, -2, -1, -2, -1, -1, -1, -3, -2, -3, -4, -3, -4, -4, 3, -5, 2, -2, -3, -2, -2, -3, -4, -2, -3, -2, -2, -2, 2, -2, 7, -1, 0, -5, 1, 4, -4, -3, 0, -4, 1, -4, -2, -1, -2, 4, 0, -1, -1, -3, -4, -1, -3, 4}; short blosum90mt[]={ 5, -2, 4, -1, -4, 9, -3, 4, -5, 7, -1, 0, -6, 1, 6, -3, -4, -3, -5, -5, 7, 0, -2, -4, -2, -3, -5, 6, -2, -1, -5, -2, -1, -2, -3, 8, -2, -5, -2, -5, -4, -1, -5, -4, 5, -1, -1, -4, -1, 0, -4, -2, -1, -4, 6, -2, -5, -2, -5, -4, 0, -5, -4, 1, -3, 5, -2, -4, -2, -4, -3, -1, -4, -3, 1, -2, 2, 7, -2, 4, -4, 1, -1, -4, -1, 0, -4, 0, -4, -3, 7, -1, -3, -4, -3, -2, -4, -3, -3, -4, -2, -4, -3, -3, 8, -1, -1, -4, -1, 2, -4, -3, 1, -4, 1, -3, 0, 0, -2, 7, -2, -2, -5, -3, -1, -4, -3, 0, -4, 2, -3, -2, -1, -3, 1, 6, 1, 0, -2, -1, -1, -3, -1, -2, -3, -1, -3, -2, 0, -2, -1, -1, 5, 0, -1, -2, -2, -1, -3, -3, -2, -1, -1, -2, -1, 0, -2, -1, -2, 1, 6, -1, -4, -2, -5, -3, -2, -5, -4, 3, -3, 0, 0, -4, -3, -3, -3, -2, -1, 5, -4, -6, -4, -6, -5, 0, -4, -3, -4, -5, -3, -2, -5, -5, -3, -4, -4, -4, -3, 11, -1, -2, -3, -2, -2, -2, -2, -2, -2, -1, -2, -1, -2, -2, -1, -2, -1, -1, -2, -3, -2, -3, -4, -4, -4, -4, 3, -5, 1, -2, -3, -2, -2, -3, -4, -3, -3, -3, -2, -3, 2, -2, 8, -1, 0, -5, 0, 4, -4, -3, 0, -4, 1, -4, -2, -1, -2, 4, 0, -1, -1, -3, -4, -1, -3, 4}; */ short pam20mt[]={ 6, -5, 6, -8,-14, 10, -4, 6,-16, 8, -3, 0,-16, 2, 8, -9,-12,-15,-17,-16, 9, -3, -4,-11, -4, -5,-10, 7, -8, -2, -8, -5, -6, -7,-10, 9, -6, -7, -7, -9, -6, -3,-13,-11, 9, -8, -3,-16, -6, -5,-16, -8, -8, -7, 7, -7,-10,-17,-15,-10, -4,-12, -7, -2, -9, 7, -6,-12,-16,-13, -8, -5,-10,-13, -2, -3, 0, 11, -5, 6,-13, 1, -3,-10, -4, -1, -6, -2, -8,-11, 8, -2, -8, -9, -9, -7,-11, -7, -5,-10, -8, -8, -9, -7, 8, -5, -4,-16, -4, 0,-15, -8, 0, -9, -4, -6, -5, -5, -4, 9, -8, -9, -9,-12,-11,-10,-11, -3, -6, -1,-10, -5, -7, -5, -2, 9, -1, -2, -4, -5, -5, -7, -3, -7, -8, -5, -9, -6, -1, -3, -6, -4, 7, -1, -4, -9, -6, -7,-10, -7, -8, -3, -4, -8, -5, -3, -5, -7, -8, 0, 7, -3, -9, -7, -9, -8, -9, -7, -7, 1,-10, -3, -2, -9, -7, -8, -9, -8, -4, 7, -16,-11,-18,-17,-19, -6,-17, -8,-16,-14, -7,-15, -9,-16,-15, -3, -6,-15,-18, 13, -4, -6,-11, -7, -6, -9, -6, -6, -6, -6, -7, -6, -4, -6, -6, -7, -4, -5, -6,-13, -6, -9, -7, -5,-13, -9, 1,-16, -4, -7,-10, -8,-13, -5,-16,-14,-11, -8, -7, -8, -6, -9, 10, -4, -1,-16, 0, 6,-16, -6, -2, -7, -5, -8, -6, -4, -5, 7, -5, -6, -7, -8,-17, -6,-11, 6}; short pam60mt[]={ 5, -2, 5, -5, -9, 9, -2, 5,-10, 7, -1, 2,-10, 3, 7, -6, -8, -9,-11,-10, 8, 0, -2, -7, -2, -2, -7, 6, -5, 0, -6, -2, -3, -4, -6, 8, -3, -4, -4, -5, -4, -1, -7, -6, 7, -5, -1,-10, -2, -3,-10, -5, -4, -4, 6, -4, -7,-11, -9, -7, -1, -8, -4, 0, -6, 6, -3, -6,-10, -7, -5, -2, -6, -7, 1, 0, 2, 10, -2, 5, -7, 2, 0, -6, -1, 1, -4, 0, -5, -6, 6, 0, -4, -6, -5, -3, -7, -4, -2, -6, -4, -5, -6, -4, 7, -3, -1,-10, -1, 2, -9, -5, 2, -5, -1, -3, -2, -2, -1, 7, -5, -5, -6, -6, -6, -7, -7, 0, -4, 2, -6, -2, -3, -2, 0, 8, 1, 0, -1, -2, -2, -5, 0, -4, -4, -2, -6, -4, 1, 0, -3, -2, 5, 1, -2, -5, -3, -4, -6, -3, -5, -1, -2, -5, -2, -1, -2, -4, -4, 1, 6, -1, -5, -4, -6, -4, -5, -4, -5, 3, -6, -1, 0, -5, -4, -5, -5, -4, -1, 6, -10, -8,-12,-11,-12, -3,-11, -5,-10, -8, -4, -9, -6,-10, -9, 0, -4, -9,-11, 13, -2, -3, -6, -3, -3, -5, -3, -3, -3, -3, -4, -3, -2, -3, -3, -4, -2, -2, -3, -8, -3, -6, -5, -2, -8, -7, 3,-10, -2, -4, -7, -5, -7, -3,-10, -8, -8, -5, -5, -5, -3, -5, 9, -2, 1,-10, 2, 5,-10, -3, 0, -4, -2, -5, -4, -1, -2, 6, -2, -3, -4, -5,-11, -3, -7, 5}; short pam120mt[]={ 3, 0, 4, -3, -6, 9, 0, 4, -7, 5, 0, 3, -7, 3, 5, -4, -5, -6, -7, -7, 8, 1, 0, -4, 0, -1, -5, 5, -3, 1, -4, 0, -1, -3, -4, 7, -1, -3, -3, -3, -3, 0, -4, -4, 6, -2, 0, -7, -1, -1, -7, -3, -2, -3, 5, -3, -4, -7, -5, -4, 0, -5, -3, 1, -4, 5, -2, -4, -6, -4, -3, -1, -4, -4, 1, 0, 3, 8, -1, 3, -5, 2, 1, -4, 0, 2, -2, 1, -4, -3, 4, 1, -2, -4, -3, -2, -5, -2, -1, -3, -2, -3, -3, -2, 6, -1, 0, -7, 1, 2, -6, -3, 3, -3, 0, -2, -1, 0, 0, 6, -3, -2, -4, -3, -3, -5, -4, 1, -2, 2, -4, -1, -1, -1, 1, 6, 1, 0, 0, 0, -1, -3, 1, -2, -2, -1, -4, -2, 1, 1, -2, -1, 3, 1, 0, -3, -1, -2, -4, -1, -3, 0, -1, -3, -1, 0, -1, -2, -2, 2, 4, 0, -3, -3, -3, -3, -3, -2, -3, 3, -4, 1, 1, -3, -2, -3, -3, -2, 0, 5, -7, -6, -8, -8, -8, -1, -8, -3, -6, -5, -3, -6, -4, -7, -6, 1, -2, -6, -8, 12, -1, -1, -4, -2, -1, -3, -2, -2, -1, -2, -2, -2, -1, -2, -1, -2, -1, -1, -1, -5, -2, -4, -3, -1, -5, -5, 4, -6, -1, -2, -5, -2, -4, -2, -6, -5, -5, -3, -3, -3, -2, -3, 8, -1, 2, -7, 3, 4, -6, -2, 1, -3, -1, -3, -2, 0, -1, 4, -1, -1, -2, -3, -7, -1, -5, 4}; /* short pam160mt[]={ 2, 0, 3, -2, -4, 9, 0, 3, -5, 4, 0, 2, -5, 3, 4, -3, -4, -5, -6, -5, 7, 1, 0, -3, 0, 0, -4, 4, -2, 1, -3, 0, 0, -2, -3, 6, -1, -2, -2, -3, -2, 0, -3, -3, 5, -2, 0, -5, 0, -1, -5, -2, -1, -2, 4, -2, -4, -6, -4, -3, 1, -4, -2, 2, -3, 5, -1, -3, -5, -3, -2, 0, -3, -3, 2, 0, 3, 7, 0, 2, -4, 2, 1, -3, 0, 2, -2, 1, -3, -2, 3, 1, -1, -3, -2, -1, -4, -1, -1, -2, -2, -3, -2, -1, 5, -1, 1, -5, 1, 2, -5, -2, 2, -2, 0, -2, -1, 0, 0, 5, -2, -1, -3, -2, -2, -4, -3, 1, -2, 3, -3, -1, -1, -1, 1, 6, 1, 0, 0, 0, 0, -3, 1, -1, -2, -1, -3, -2, 1, 1, -1, -1, 2, 1, 0, -2, -1, -1, -3, -1, -2, 0, 0, -2, -1, 0, 0, -1, -1, 1, 3, 0, -2, -2, -3, -2, -2, -2, -2, 3, -3, 1, 1, -2, -2, -2, -3, -1, 0, 4, -5, -5, -7, -6, -7, -1, -7, -3, -5, -4, -2, -4, -4, -5, -5, 1, -2, -5, -6, 12, 0, -1, -3, -1, -1, -3, -1, -1, -1, -1, -2, -1, 0, -1, -1, -1, 0, 0, -1, -4, -1, -3, -3, 0, -4, -4, 5, -5, 0, -2, -4, -2, -3, -2, -5, -4, -4, -3, -3, -3, -1, -3, 8, 0, 2, -5, 2, 3, -5, -1, 1, -2, 0, -3, -2, 1, -1, 3, 0, -1, -1, -2, -6, -1, -4, 3}; short pam250mt[]={ 2, 0, 3, -2, -4, 12, 0, 3, -5, 4, 0, 3, -5, 3, 4, -3, -4, -4, -6, -5, 9, 1, 0, -3, 1, 0, -5, 5, -1, 1, -3, 1, 1, -2, -2, 6, -1, -2, -2, -2, -2, 1, -3, -2, 5, -1, 1, -5, 0, 0, -5, -2, 0, -2, 5, -2, -3, -6, -4, -3, 2, -4, -2, 2, -3, 6, -1, -2, -5, -3, -2, 0, -3, -2, 2, 0, 4, 6, 0, 2, -4, 2, 1, -3, 0, 2, -2, 1, -3, -2, 2, 1, -1, -3, -1, -1, -5, 0, 0, -2, -1, -3, -2, 0, 6, 0, 1, -5, 2, 2, -5, -1, 3, -2, 1, -2, -1, 1, 0, 4, -2, -1, -4, -1, -1, -4, -3, 2, -2, 3, -3, 0, 0, 0, 1, 6, 1, 0, 0, 0, 0, -3, 1, -1, -1, 0, -3, -2, 1, 1, -1, 0, 2, 1, 0, -2, 0, 0, -3, 0, -1, 0, 0, -2, -1, 0, 0, -1, -1, 1, 3, 0, -2, -2, -2, -2, -1, -1, -2, 4, -2, 2, 2, -2, -1, -2, -2, -1, 0, 4, -6, -5, -8, -7, -7, 0, -7, -3, -5, -3, -2, -4, -4, -6, -5, 2, -2, -5, -6, 17, 0, -1, -3, -1, -1, -2, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, 0, -1, -4, -1, -3, -3, 0, -4, -4, 7, -5, 0, -1, -4, -1, -2, -2, -5, -4, -4, -3, -3, -2, 0, -2, 10, 0, 2, -5, 3, 3, -5, 0, 2, -2, 0, -3, -2, 1, 0, 3, 0, 0, -1, -2, -6, -1, -4, 3}; */ short pam350mt[]={ 2, 1, 3, -2, -5, 18, 1, 3, -6, 4, 1, 3, -6, 4, 4, -4, -5, -5, -6, -6, 13, 2, 1, -4, 1, 1, -6, 5, -1, 1, -4, 1, 1, -2, -2, 7, 0, -2, -3, -2, -2, 2, -2, -2, 5, -1, 1, -6, 1, 0, -6, -1, 1, -2, 5, -2, -4, -7, -4, -4, 3, -4, -2, 4, -3, 8, -1, -2, -6, -3, -2, 1, -3, -2, 3, 0, 5, 6, 0, 2, -4, 2, 2, -4, 1, 2, -2, 1, -3, -2, 2, 1, 0, -3, 0, 0, -5, 0, 0, -2, -1, -3, -2, 0, 6, 0, 2, -6, 2, 3, -5, -1, 3, -2, 1, -2, -1, 1, 1, 4, -1, 0, -4, -1, 0, -5, -2, 2, -2, 4, -3, 0, 1, 0, 2, 7, 1, 1, 0, 1, 0, -4, 1, -1, -1, 0, -3, -2, 1, 1, 0, 0, 1, 1, 0, -2, 0, 0, -3, 1, -1, 0, 0, -2, -1, 1, 1, 0, -1, 1, 2, 0, -2, -2, -2, -2, -1, -1, -2, 4, -2, 3, 2, -2, -1, -2, -3, -1, 0, 5, -7, -6,-10, -8, -8, 1, -8, -3, -6, -4, -2, -5, -5, -7, -5, 4, -3, -6, -7, 27, 0, 0, -3, -1, 0, -2, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, -5, -1, -4, -4, 1, -5, -5, 11, -6, 0, 0, -5, 0, -2, -3, -6, -5, -5, -3, -3, -2, 1, -2, 14, 0, 2, -6, 3, 3, -6, 0, 2, -2, 1, -3, -2, 2, 0, 3, 1, 0, 0, -2, -7, 0, -5, 3}; /* short md_40mt[]={ 9, 0, 0, -7, 0, 16, -6, 0,-13, 11, -5, 0,-15, 3, 11, -11, 0, -5,-15,-16, 13, -3, 0, -7, -4, -4,-15, 10, -9, 0, -6, -4, -8, -7,-10, 14, -6, 0,-11,-12,-12, -5,-13,-11, 11, -8, 0,-12, -8, -3,-16, -9, -6,-11, 11, -9, 0,-10,-14,-13, -1,-14, -7, -1,-12, 9, -6, 0, -9,-12,-11, -7,-12, -9, 1, -7, 1, 14, -6, 0, -8, 1, -5,-12, -5, 0, -8, -1,-12, -9, 12, -2, 0,-11,-11,-11,-11, -9, -4,-11,-10, -5,-10, -9, 12, -7, 0,-12, -6, 0,-14, -9, 2,-12, -1, -6, -8, -5, -3, 12, -7, 0, -5,-10, -8,-15, -4, 0,-10, 3, -9, -8, -6, -6, 0, 11, 0, 0, -2, -6, -8, -6, -2, -6, -8, -7, -7, -8, 1, -1, -7, -5, 9, 1, 0, -7, -8, -8,-11, -7, -7, -2, -5, -9, -2, -2, -4, -7, -6, 1, 10, -1, 0, -7, -9, -8, -6, -8,-12, 4,-12, -2, 0,-10, -9,-11,-11, -7, -4, 10, -14, 0, -4,-15,-15, -7, -7,-13,-13,-13, -8,-11,-14,-14,-11, -4, -9,-12,-10, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 0, -2, -8,-14, 2,-13, 2, -9,-13, -9,-11, -6,-13, -9,-10, -7,-10,-11, -6, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short md_120mt[]={ 6, 0, 0, -3, 0, 14, -2, 0, -7, 8, -2, 0, -8, 5, 8, -6, 0, -2, -9,-10, 11, 0, 0, -3, 0, -1, -9, 8, -4, 0, -2, -1, -3, -2, -4, 11, -1, 0, -5, -7, -7, -1, -6, -6, 7, -4, 0, -6, -2, 0, -9, -4, -1, -6, 8, -4, 0, -5, -8, -8, 2, -8, -4, 2, -6, 7, -2, 0, -5, -7, -6, -2, -6, -5, 3, -4, 3, 10, -1, 0, -3, 3, -1, -6, -1, 2, -4, 1, -6, -5, 8, 0, 0, -5, -5, -5, -5, -4, -1, -5, -4, -2, -5, -3, 9, -3, 0, -6, -1, 2, -7, -4, 4, -6, 2, -3, -4, -1, 0, 9, -3, 0, -2, -4, -3, -8, -1, 2, -6, 4, -5, -4, -2, -2, 2, 8, 2, 0, 0, -2, -3, -3, 0, -2, -3, -3, -3, -3, 2, 1, -3, -2, 5, 2, 0, -3, -3, -4, -6, -2, -3, 0, -2, -4, 0, 1, 0, -3, -3, 2, 6, 1, 0, -3, -5, -5, -2, -4, -6, 5, -6, 1, 2, -5, -4, -6, -6, -3, 0, 7, -8, 0, 0, -9, -9, -3, -3, -6, -7, -6, -4, -6, -8, -8, -6, -1, -5, -7, -6, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 2, -4, -7, 5, -8, 4, -5, -7, -4, -6, -2, -7, -4, -5, -3, -6, -6, -2, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short md_250mt[]={ 2, 0, 0, -1, 0, 11, -1, 0, -3, 5, -1, 0, -4, 4, 5, -3, 0, 0, -5, -5, 8, 1, 0, -1, 1, 1, -5, 5, -2, 0, 0, 0, 0, 0, -2, 6, 0, 0, -2, -3, -3, 0, -3, -3, 4, -1, 0, -3, 0, 1, -5, -1, 1, -3, 5, -1, 0, -2, -4, -4, 2, -4, -2, 2, -3, 5, 0, 0, -2, -3, -3, 0, -3, -2, 3, -2, 3, 6, 0, 0, -1, 2, 1, -3, 0, 1, -2, 1, -3, -2, 3, 1, 0, -2, -2, -2, -2, -1, 0, -2, -1, 0, -2, -1, 6, -1, 0, -3, 0, 2, -4, -1, 3, -3, 2, -2, -2, 0, 0, 5, -1, 0, -1, -1, 0, -4, 0, 2, -3, 4, -3, -2, 0, -1, 2, 5, 1, 0, 1, 0, -1, -2, 1, -1, -1, -1, -2, -1, 1, 1, -1, -1, 2, 2, 0, -1, -1, -1, -2, 0, -1, 1, -1, -1, 0, 1, 1, -1, -1, 1, 2, 1, 0, -2, -3, -2, 0, -2, -3, 4, -3, 2, 2, -2, -1, -3, -3, -1, 0, 4, -4, 0, 1, -5, -5, -1, -1, -3, -4, -3, -2, -3, -4, -4, -3, 0, -3, -4, -3, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 2, -2, -4, 5, -4, 4, -2, -3, -1, -3, -1, -3, -2, -2, -1, -3, -3, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short md_350mt[]={ 1, 0, 0, 0, 0, 9, 0, 0, -2, 3, 0, 0, -2, 3, 3, -2, 0, 1, -3, -4, 6, 1, 0, 0, 1, 1, -3, 4, -1, 0, 0, 0, 0, 0, -1, 3, 0, 0, -1, -2, -2, 1, -2, -2, 3, -1, 0, -1, 0, 1, -3, 0, 1, -2, 3, -1, 0, -1, -3, -3, 2, -2, -1, 2, -2, 3, 0, 0, -1, -2, -2, 1, -2, -1, 2, -2, 2, 3, 0, 0, -1, 1, 1, -2, 0, 1, -1, 1, -2, -1, 2, 1, 0, -1, -1, -1, -2, -1, 0, -1, -1, 0, -1, 0, 4, -1, 0, -2, 1, 1, -2, 0, 2, -2, 2, -1, -1, 0, 0, 3, -1, 0, 0, 0, 0, -3, 0, 1, -2, 3, -2, -1, 0, 0, 2, 3, 1, 0, 0, 0, 0, -1, 1, 0, -1, 0, -1, -1, 1, 1, 0, 0, 1, 1, 0, 0, 0, -1, -1, 0, -1, 0, 0, -1, 0, 0, 1, -1, 0, 1, 1, 0, 0, -1, -2, -2, 0, -1, -2, 2, -2, 1, 2, -1, -1, -2, -2, 0, 0, 2, -3, 0, 1, -4, -3, 0, -1, -2, -3, -2, -1, -2, -3, -3, -2, 0, -2, -3, -2, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 2, -2, -2, 5, -3, 3, -1, -2, 0, -1, -1, -2, -1, -1, -1, -2, -2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; */ short idmat[]={ 10, 0, 10, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10}; short gon40mt[]={ 92, 0, 0, -31, 0, 163, -56, 0,-135, 111, -37, 0,-140, 16, 105, -92, 0, -64,-152,-143, 126, -32, 0, -91, -51, -76,-152, 105, -65, 0, -67, -41, -40, -50, -81, 145, -76, 0, -87,-150,-106, -39,-158, -94, 104, -54, 0,-132, -47, -13,-127, -79, -34, -86, 103, -68, 0, -85,-155,-108, -13,-141, -85, 5, -85, 89, -45, 0, -63,-130, -80, -16,-114, -60, 10, -57, 16, 140, -62, 0, -83, 6, -38,-104, -40, -7, -99, -20,-112, -91, 115, -37, 0,-137, -69, -60,-128, -87, -71,-108, -62, -83,-119, -78, 124, -43, 0,-113, -32, 10,-100, -71, 0, -91, 2, -60, -35, -25, -46, 118, -61, 0, -86, -77, -50,-130, -69, -31,-103, 19, -84, -81, -47, -73, -6, 112, 0, 0, -35, -36, -41,-111, -37, -48, -95, -43, -95, -64, -11, -35, -35, -51, 99, -25, 0, -59, -47, -52, -90, -85, -46, -51, -34, -78, -44, -27, -42, -39, -52, 13, 100, -22, 0, -43,-133, -74, -58,-122, -98, 28, -82, -18, -22,-103, -86, -79, -88, -74, -25, 97, -120, 0, -68,-171,-131, -6,-108, -70, -93,-127, -71, -72,-119,-149, -87, -63, -98,-120,-115, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -95, 0, -56, -98,-107, 31,-129, 5, -76, -88, -64, -66, -62,-106, -81, -75, -69, -87, -73, 1, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon80mt[]={ 75, 0, 0, -10, 0, 154, -31, 0, -93, 96, -17, 0, -94, 31, 88, -64, 0, -39,-111,-102, 114, -11, 0, -61, -26, -47,-115, 97, -39, 0, -43, -17, -17, -26, -53, 127, -43, 0, -54,-106, -73, -15,-114, -64, 86, -30, 0, -88, -21, 4, -89, -50, -12, -59, 85, -43, 0, -55,-109, -75, 7,-104, -57, 22, -58, 77, -26, 0, -39, -88, -53, 3, -83, -38, 25, -37, 31, 117, -34, 0, -55, 21, -13, -75, -18, 9, -71, -2, -79, -62, 97, -16, 0, -93, -42, -35, -93, -58, -45, -75, -37, -58, -78, -48, 114, -22, 0, -76, -9, 23, -70, -44, 14, -60, 17, -39, -19, -6, -24, 95, -36, 0, -60, -44, -23, -90, -43, -10, -71, 33, -58, -53, -22, -45, 11, 97, 14, 0, -15, -14, -19, -77, -16, -25, -62, -20, -64, -41, 5, -14, -15, -27, 78, -5, 0, -34, -24, -27, -62, -52, -24, -28, -15, -49, -25, -7, -20, -18, -27, 25, 81, -6, 0, -21, -89, -51, -31, -86, -65, 41, -54, 3, 1, -69, -57, -51, -60, -43, -9, 80, -87, 0, -43,-124, -98, 16, -81, -43, -63, -89, -44, -45, -86,-112, -62, -41, -72, -87, -80, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -65, 0, -32, -69, -74, 49, -94, 21, -47, -60, -35, -37, -39, -76, -53, -50, -46, -58, -47, 23, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon120mt[]={ 59, 0, 0, -1, 0, 144, -18, 0, -69, 82, -9, 0, -68, 35, 72, -48, 0, -26, -87, -78, 102, -3, 0, -45, -14, -31, -92, 90, -26, 0, -31, -7, -6, -14, -37, 110, -27, 0, -36, -80, -55, -3, -87, -48, 72, -19, 0, -64, -8, 11, -67, -34, -2, -44, 69, -30, 0, -39, -82, -57, 15, -82, -42, 28, -44, 66, -17, 0, -26, -64, -40, 11, -65, -28, 29, -27, 34, 95, -20, 0, -41, 26, -1, -58, -7, 14, -55, 5, -61, -46, 80, -6, 0, -68, -28, -22, -72, -41, -31, -56, -24, -44, -56, -32, 105, -12, 0, -56, 1, 25, -53, -30, 17, -43, 20, -30, -14, 1, -14, 74, -23, 0, -45, -27, -10, -68, -30, -1, -53, 36, -44, -38, -10, -30, 16, 83, 16, 0, -7, -5, -9, -58, -6, -14, -44, -10, -47, -29, 10, -5, -7, -15, 60, 2, 0, -21, -13, -15, -47, -35, -14, -17, -6, -34, -16, 0, -10, -9, -16, 26, 64, 0, 0, -11, -65, -38, -17, -65, -47, 42, -39, 13, 10, -50, -42, -36, -44, -28, -3, 65, -68, 0, -29, -96, -78, 27, -66, -28, -46, -68, -29, -31, -68, -89, -49, -30, -57, -67, -59, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -48, 0, -20, -53, -56, 55, -74, 26, -31, -44, -20, -22, -28, -59, -38, -37, -35, -42, -33, 33, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon160mt[]={ 46, 0, 0, 3, 0, 135, -11, 0, -53, 70, -4, 0, -52, 34, 59, -38, 0, -18, -70, -62, 91, 2, 0, -34, -7, -21, -76, 82, -18, 0, -23, -1, -1, -7, -27, 93, -18, 0, -25, -62, -43, 3, -70, -37, 59, -12, 0, -48, -1, 13, -53, -24, 2, -35, 55, -22, 0, -29, -65, -45, 19, -67, -32, 30, -34, 57, -12, 0, -19, -50, -31, 14, -52, -21, 29, -21, 34, 76, -12, 0, -31, 26, 5, -47, -2, 15, -44, 8, -48, -36, 65, -1, 0, -52, -19, -14, -58, -30, -22, -43, -16, -35, -42, -22, 96, -7, 0, -42, 6, 23, -41, -21, 17, -32, 20, -24, -12, 5, -8, 56, -16, 0, -35, -16, -3, -53, -21, 3, -41, 35, -35, -29, -4, -21, 17, 71, 16, 0, -2, 0, -3, -45, -1, -8, -33, -4, -36, -23, 11, 0, -2, -9, 44, 5, 0, -14, -6, -8, -36, -24, -8, -12, -2, -24, -11, 3, -4, -4, -9, 23, 50, 1, 0, -6, -49, -30, -8, -52, -35, 40, -30, 17, 14, -38, -32, -27, -34, -20, 0, 53, -55, 0, -21, -78, -64, 32, -55, -19, -34, -54, -20, -22, -55, -74, -40, -24, -47, -54, -45, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, -13, -42, -44, 56, -60, 27, -20, -35, -11, -13, -22, -48, -29, -29, -28, -32, -24, 38, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon250mt[]={ 24, 0, 0, 5, 0, 115, -3, 0, -32, 47, 0, 0, -30, 27, 36, -23, 0, -8, -45, -39, 70, 5, 0, -20, 1, -8, -52, 66, -8, 0, -13, 4, 4, -1, -14, 60, -8, 0, -11, -38, -27, 10, -45, -22, 40, -4, 0, -28, 5, 12, -33, -11, 6, -21, 32, -12, 0, -15, -40, -28, 20, -44, -19, 28, -21, 40, -7, 0, -9, -30, -20, 16, -35, -13, 25, -14, 28, 43, -3, 0, -18, 22, 9, -31, 4, 12, -28, 8, -30, -22, 38, 3, 0, -31, -7, -5, -38, -16, -11, -26, -6, -23, -24, -9, 76, -2, 0, -24, 9, 17, -26, -10, 12, -19, 15, -16, -10, 7, -2, 27, -6, 0, -22, -3, 4, -32, -10, 6, -24, 27, -22, -17, 3, -9, 15, 47, 11, 0, 1, 5, 2, -28, 4, -2, -18, 1, -21, -14, 9, 4, 2, -2, 22, 6, 0, -5, 0, -1, -22, -11, -3, -6, 1, -13, -6, 5, 1, 0, -2, 15, 25, 1, 0, 0, -29, -19, 1, -33, -20, 31, -17, 18, 16, -22, -18, -15, -20, -10, 0, 34, -36, 0, -10, -52, -43, 36, -40, -8, -18, -35, -7, -10, -36, -50, -27, -16, -33, -35, -26, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, -5, -28, -27, 51, -40, 22, -7, -21, 0, -2, -14, -31, -17, -18, -19, -19, -11, 41, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon300mt[]={ 16, 0, 0, 5, 0, 104, -1, 0, -24, 37, 1, 0, -23, 23, 27, -18, 0, -5, -37, -31, 60, 5, 0, -15, 3, -4, -42, 58, -6, 0, -10, 5, 4, 0, -10, 45, -6, 0, -7, -30, -21, 11, -36, -16, 33, -2, 0, -21, 6, 11, -26, -7, 5, -17, 24, -9, 0, -10, -32, -22, 19, -36, -14, 25, -17, 33, -5, 0, -6, -24, -16, 15, -28, -10, 22, -11, 24, 31, -1, 0, -14, 18, 9, -25, 5, 10, -22, 8, -24, -17, 27, 3, 0, -23, -4, -2, -30, -11, -8, -20, -3, -18, -19, -6, 66, -1, 0, -18, 9, 14, -20, -6, 9, -15, 13, -13, -8, 7, -1, 18, -4, 0, -17, 0, 5, -25, -6, 6, -19, 22, -18, -13, 4, -6, 13, 37, 8, 0, 1, 5, 3, -22, 4, -1, -14, 2, -17, -11, 7, 4, 2, 0, 15, 5, 0, -3, 1, 1, -17, -7, -1, -4, 2, -9, -5, 4, 2, 1, -1, 11, 17, 0, 0, 1, -23, -15, 4, -26, -15, 26, -13, 17, 15, -17, -14, -12, -15, -8, 0, 26, -29, 0, -7, -42, -36, 36, -34, -5, -13, -28, -4, -6, -30, -41, -23, -14, -27, -28, -19, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, 0, -3, -22, -22, 46, -33, 18, -3, -17, 3, 1, -12, -25, -14, -14, -15, -15, -7, 40, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short gon350mt[]={ 10, 0, 0, 4, 0, 93, 0, 0, -19, 29, 1, 0, -17, 19, 20, -14, 0, -3, -30, -25, 51, 5, 0, -12, 4, -2, -35, 51, -4, 0, -8, 5, 4, 1, -7, 33, -4, 0, -5, -24, -17, 11, -29, -13, 27, -1, 0, -16, 6, 9, -21, -4, 5, -13, 18, -7, 0, -7, -25, -18, 18, -30, -11, 22, -14, 28, -4, 0, -4, -19, -13, 14, -23, -8, 19, -9, 21, 23, 0, 0, -11, 15, 9, -20, 5, 8, -18, 7, -19, -14, 20, 3, 0, -18, -2, 0, -25, -7, -5, -16, -2, -15, -14, -3, 56, 0, 0, -14, 8, 11, -16, -4, 7, -11, 10, -11, -7, 6, 0, 12, -2, 0, -13, 2, 6, -20, -4, 6, -15, 18, -14, -11, 4, -4, 10, 28, 6, 0, 1, 5, 3, -18, 5, 0, -11, 2, -13, -9, 6, 4, 2, 1, 10, 4, 0, -2, 2, 1, -13, -5, -1, -3, 2, -7, -4, 4, 2, 1, 0, 8, 11, 0, 0, 2, -18, -12, 5, -21, -11, 22, -10, 16, 14, -13, -11, -9, -12, -6, 0, 21, -24, 0, -4, -35, -29, 35, -30, -3, -9, -23, -1, -3, -24, -34, -19, -12, -22, -23, -14, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, -1, -18, -17, 42, -27, 15, -1, -14, 5, 2, -10, -20, -11, -12, -12, -12, -4, 39, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short clustalvdnamt[]={ 10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; short swgapdnamt[]={ 10, -9, 10, -9, 10, 10, 10, 10, -9, 10, -9, 10, -9, 10, 10, 10, 10, 10, 10, -9, 10, -9, 10, -9, 10, 10, 10, 10, 10, 10, 10, 10, -9, 10, -9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, -9, 10, 10, 10, 10, 10, 10, 10, -9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, -9, 10, -9, 10, -9, 10, 10, -9, 10, -9, -9, 10, -9, 10, -9, 10, -9, 10, 10, -9, 10, -9, -9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, -9, -9, 10, 10, 10, -9, 10, -9, 10, 10, 10, 10, 10, -9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, -9, 10, 10, 10, -9, 10, 10, 10, 10, -9, 10, 10, 10, 10, 10, 10, 10}; } #endif clustalw-2.1/src/substitutionMatrix/SubMatrix.h0000644000175000017500000001470711442167171016767 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This is the interface class to all the substitution matrices. * It provides the matrices in a form that the rest of the program can use. * It is also used to store the user defined matrix. This will be used mainly as an interface * to the matrices defined in matrices.h. * The way this class will work is the user can read in matrix series or a single matrix, * or they can select one of the matrix series (e.g Blosum). This will then be used in the * alignment stages. There are separate matrices for amino acid pairwise and progressive, * and for DNA alignments both pairwise and progressive. * It is possible to have a series of matrices that are user defined for amino acid * progressive ONLY!! * A single matrix is choosen for pairwise and for DNA alignments. * This class does 3 jobs. It reads in matrices from files/arrays, it provides * matrices in the formats that are used in the alignment stage, it allows users to select * which matrices they would like to use. */ #ifndef SUBMATRIX_H #define SUBMATRIX_H #include #include #include "../general/clustalw.h" #include "../general/userparams.h" #include "../general/utils.h" #include "../general/Array2D.h" namespace clustalw { using namespace std; typedef vector Xref; typedef vector Matrix; class SubMatrix { public: /* Functions */ SubMatrix(); ~SubMatrix(); bool getUserMatFromFile(char *str, int alignResidueType, int alignType); bool getAAScoreMatFromFile(char *str); bool getDNAScoreMatFromFile(char *str); bool getQTLowScoreMatFromFile(char *fileName, bool dna); bool getUserMatSeriesFromFile(char *str); void setCurrentNameAndNum(string _matrixName, int _matrixNum, int alignResidueType, int alignType); int getMatrixNumForMenu(int alignResidueType, int alignType); int getPairwiseMatrix(int matrix[NUMRES][NUMRES], PairScaleValues& scale, int& matAvg); int getProfileAlignMatrix(int matrix[NUMRES][NUMRES], double pcid, int minLen, PrfScaleValues& scaleParam, int& matAvg); int getAlnScoreMatrix(int matrix[NUMRES][NUMRES]); // Access functions for the interactive menu. int getMatrixNum(); int getDNAMatrixNum(); int getPWMatrixNum(); int getPWDNAMatrixNum(); void getQTMatrixForHistogram(int matrix[NUMRES][NUMRES]); // NOTE Qt int getQTAAHistMatNum(){return QTAAHistMatNum;}; int getQTDNAHistMatNum(){return QTDNAHistMatNum;}; void setQTAAHistMatNum(int num){QTAAHistMatNum = num;}; void setQTDNAHistMatNum(int num){QTDNAHistMatNum = num;}; void getQTMatrixForLowScoreSeg(int matrix[NUMRES][NUMRES]); int getQTsegmentDNAMatNum(){return QTsegmentDNAMatNum;} void setQTsegmentDNAMatNum(int dnaMat){QTsegmentDNAMatNum = dnaMat;} int getQTsegmentAAMatNum(){return QTsegmentAAMatNum;} void setQTsegmentAAMatNum(int aaMat){QTsegmentAAMatNum = aaMat;} void tempInterface(int alignResidueType, int alignType); void setValuesToDefault(); /* Attributes */ private: /* Functions */ int getMatrix(Matrix* matPtr, Xref* xref, int matrix[NUMRES][NUMRES], bool negFlag, int scale, bool minimise = false); int readMatrixSeries(const char *fileName, Matrix& userMat, Xref& xref); int readUserMatrix(const char *fileName, Matrix& userMat, Xref& xref); int getArgs(char *inline1, char *args[], int max); void setUpCrossReferences(); bool commentline(char* line); // The functions below are purely for testing purposes. void printGetMatrixResults(int mat[NUMRES][NUMRES]); void compareMatrices(int mat1[NUMRES][NUMRES], int mat2[NUMRES][NUMRES]); void printInFormat(vector& temp, char* name = "tempfile.out"); void printVectorToFile(vector& temp, char* name = "tempfile.out"); Matrix* getUserMatAddress(int alignResidueType, int alignType); Xref* getUserXrefAddress(int alignResidueType, int alignType); void checkResidueAndAlignType(int alignResidueType, int alignType); /* Attributes */ bool userSeries; int matrixNum; int DNAMatrixNum; int pwMatrixNum; int pwDNAMatrixNum; string* matrixName; string* DNAMatrixName; string* pwMatrixName; string* pwDNAMatrixName; // Matrix cross references. Xref defaultDNAXref; Xref defaultAAXref; Xref DNAXref; // User defined dna xref Xref AAXref; Xref pwAAXref; // pairwise Xref pwDNAXref; Xref QTscoreXref; Xref QTscoreDNAXref; Xref QTsegmentDNAXref; Xref QTsegmentAAXref; vector AAXrefseries; vector userMatSeries; Matrix userMat; Matrix pwUserMat; Matrix userDNAMat; Matrix pwUserDNAMat; Matrix QTscoreUserMatrix; Matrix QTscoreUserDNAMatrix; Matrix QTsegmentDNAMatrix; Matrix QTsegmentAAMatrix; /* These are vectors to store the matrices defined in matrices.h */ const int sizenAAMatrix; const int sizeDNAMatrix; Matrix* blosum30mtVec; Matrix* blosum40mtVec; Matrix* blosum45mtVec; Matrix* blosum62mt2Vec; Matrix* blosum80mtVec; Matrix* pam20mtVec; Matrix* pam60mtVec; Matrix* pam120mtVec; Matrix* pam350mtVec; Matrix* idmatVec; Matrix* gon40mtVec; Matrix* gon80mtVec; Matrix* gon120mtVec; Matrix* gon160mtVec; Matrix* gon250mtVec; Matrix* gon350mtVec; Matrix* clustalvdnamtVec; Matrix* swgapdnamtVec; int matrixAvgScore; // NOTE Needed by other classes. UserMatrixSeries matSeries; string line2; int QTDNAHistMatNum; int QTAAHistMatNum; int QTsegmentDNAMatNum; int QTsegmentAAMatNum; // Temp, to hold current selection Matrix* mat; Xref* xref; Matrix* _matPtr; Xref* _matXref; }; } #endif clustalw-2.1/src/alignment/0000755000175000017500000000000011467270447012774 500000000000000clustalw-2.1/src/alignment/AlignmentOutput.cpp0000644000175000017500000024572711444161711016564 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Output routines ported from clustalx C code in 'interface.c'. * * Changes: * * 18-04-07,Nigel Brown(EMBL): clustalx code used (firsRes, length) convention * to define output columns, while the port uses (firsRes, lastRes). Fixed * problems in all 7 output routines where the conventions were mixed giving * over-long output blocks. * * 18-7-07: Mark (UCD), made changes to fastaOut, clustalOut, nbrfOut and gdeOut * * 9-2-08: Paul (UCD), changes to clustalOut to make output the same as 1.83 * added const NAMESWIDTH which is calculated based on the * length of the longest sequence name and the upper and lower * limits specified in MAXNAMESTODISPLAY and MINNAMESTODISPLAY */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "AlignmentOutput.h" namespace clustalw { AlignmentOutput::AlignmentOutput() : clusSecStructOffset(9), clusSequenceOffset(15+1) // MARK made a change here for test case findRangeValues 10seqs { // NOTE in the old clustal these arrays ended with NULL as a value. try { strongGroup.resize(9); strongGroup[0] = string("STA"); strongGroup[1] = string("NEQK"); strongGroup[2] = string("NHQK"); strongGroup[3] = string("NDEQ"); strongGroup[4] = string("QHRK"); strongGroup[5] = string("MILV"); strongGroup[6] = string("MILF"); strongGroup[7] = string("HY"); strongGroup[8] = string("FYW"); weakGroup.resize(11); weakGroup[0] = string("CSA"); weakGroup[1] = string("ATV"); weakGroup[2] = string("SAG"); weakGroup[3] = string("STNK"); weakGroup[4] = string("STPA"); weakGroup[5] = string("SGND"); weakGroup[6] = string("SNDEQK"); weakGroup[7] = string("NDEQHK"); weakGroup[8] = string("NEQHRK"); weakGroup[9] = string("FVLIM"); weakGroup[10] = string("HFY"); } catch(const exception& e) { cerr << "An exception has occured in the contructor of AlignmentOutput.\n" << e.what() << "\n"; exit(1); } } /* * The function createAlignmentOutput is used to call all the individual functions * for the different file types. It is possible to output the alignment in all file * types at the same time. */ void AlignmentOutput::createAlignmentOutput(Alignment* alignPtr, int firstSeq, int lastSeq) { int length; int firstRes; // starting sequence range - Ramu int lastRes; // ending sequence range bool rangeOK; if((firstSeq <= 0) || (lastSeq < firstSeq)) { utilityObject->error("Cannot produce alignment output." " Incorrect call to createAlignmentOutput." " firstSeq = %d" " lastSeq = %d\n", firstSeq, lastSeq); return; } length = 0; firstRes = 1; lastRes = 0; rangeOK = false; try { length = alignPtr->getLengthLongestSequence(); lastRes = length; if (userParameters->getRangeFromToSet()) { firstRes = userParameters->getRangeFrom(); lastRes = userParameters->getRangeTo(); // Check if the numbers are ok. if ((firstRes > lastRes) || (firstRes == -1) || (lastRes == -1)) { cerr << "seqrange numbers are not set properly, using default....\n"; firstRes = 1; lastRes = length; } else { rangeOK = true; } } if (rangeOK && (lastRes > length)) { lastRes = length; cout << "Seqrange " << lastRes << " is more than the " << length << " setting it to " << length << " \n"; } if (userParameters->getMenuFlag()) { cout << "Consensus length = " << lastRes << " \n"; } outputRegion partToOutput; partToOutput._firstSeq = firstSeq; partToOutput._lastSeq = lastSeq; partToOutput._firstRes = firstRes; partToOutput._lastRes = lastRes; if(userParameters->getOutputClustal()) { if(clustalOutFile.get() != 0 && clustalOutFile->is_open()) { clustalOut(alignPtr, partToOutput); if(clustalOutFile->is_open()) { clustalOutFile->close(); } utilityObject->info("CLUSTAL-Alignment file created [%s]\n", clustalOutName.c_str()); } } if(userParameters->getOutputNbrf()) { if(nbrfOutFile.get() != 0 && nbrfOutFile->is_open()) { nbrfOut(alignPtr, partToOutput); if(nbrfOutFile->is_open()) { nbrfOutFile->close(); } utilityObject->info("NBRF/PIR-Alignment file created [%s]\n", nbrfOutName.c_str()); } } if(userParameters->getOutputGCG()) { if(gcgOutFile.get() != 0 && gcgOutFile->is_open()) { gcgOut(alignPtr, partToOutput); if(gcgOutFile->is_open()) { gcgOutFile->close(); } utilityObject->info("GCG-Alignment file created [%s]\n", gcgOutName.c_str()); } } if(userParameters->getOutputPhylip()) { if(phylipOutFile.get() != 0 && phylipOutFile->is_open()) { phylipOut(alignPtr, partToOutput); if(phylipOutFile->is_open()) { phylipOutFile->close(); } utilityObject->info("PHYLIP-Alignment file created [%s]\n", phylipOutName.c_str()); } } if(userParameters->getOutputGde()) { if(gdeOutFile.get() != 0 && gdeOutFile->is_open()) { gdeOut(alignPtr, partToOutput); if(gdeOutFile->is_open()) { gdeOutFile->close(); } utilityObject->info("GDE-Alignment file created [%s]\n", gdeOutName.c_str()); } } if(userParameters->getOutputNexus()) { if(nexusOutFile.get() != 0 && nexusOutFile->is_open()) { nexusOut(alignPtr, partToOutput); if(nexusOutFile->is_open()) { nexusOutFile->close(); } utilityObject->info("NEXUS-Alignment file created [%s]\n", nexusOutName.c_str()); } } if(userParameters->getOutputFasta()) { if(fastaOutFile.get() != 0 && fastaOutFile->is_open()) { fastaOut(alignPtr, partToOutput); if(fastaOutFile->is_open()) { fastaOutFile->close(); } utilityObject->info("Fasta-Alignment file created [%s]\n", fastaOutName.c_str()); } } // Output the alignment to the screen if it is required. if (userParameters->getShowAlign() && userParameters->getMenuFlag()) { showAlign(); } } catch(const exception& e) { cerr << "An exception has occured in the createAlignmentOutput function.\n" << e.what() << "\n"; exit(1); } } bool AlignmentOutput::QTOpenFilesForOutput(AlignmentFileNames fileNames) { if(!userParameters->getOutputClustal() && !userParameters->getOutputNbrf() && !userParameters->getOutputGCG() && !userParameters->getOutputPhylip() && !userParameters->getOutputGde() && !userParameters->getOutputNexus() && !userParameters->getOutputFasta()) { utilityObject->error("You must select an alignment output format\n"); return false; } if(fileNames.clustalFile == "" && fileNames.fastaFile == "" && fileNames.gcgFile == "" && fileNames.gdeFile == "" && fileNames.nexusFile == "" && fileNames.nrbfFile == "" && fileNames.phylipFile == "") { utilityObject->error("No names for output files. Cannot output alignment.\n"); return false; } if(fileNames.clustalFile != "") { clustalOutName = fileNames.clustalFile; if(!openExplicitFile(clustalOutFile, clustalOutName)) { return false; } } if(fileNames.fastaFile != "") { fastaOutName = fileNames.fastaFile; if(!openExplicitFile(fastaOutFile, fastaOutName)) { return false; } } if(fileNames.gcgFile != "") { gcgOutName = fileNames.gcgFile; if(!openExplicitFile(gcgOutFile, gcgOutName)) { return false; } } if(fileNames.gdeFile != "") { gdeOutName = fileNames.gdeFile; if(!openExplicitFile(gdeOutFile, gdeOutName)) { return false; } } if(fileNames.nexusFile != "") { nexusOutName = fileNames.nexusFile; if(!openExplicitFile(nexusOutFile, nexusOutName)) { return false; } } if(fileNames.nrbfFile != "") { nbrfOutName = fileNames.nrbfFile; if(!openExplicitFile(nbrfOutFile, nbrfOutName)) { return false; } } if(fileNames.phylipFile != "") { phylipOutName = fileNames.phylipFile; if(!openExplicitFile(phylipOutFile, phylipOutName)) { return false; } } return true; } /* * The function openAlignmentOutput opens a file for output. It returns true if it * has been successful and false if it has not been successful */ bool AlignmentOutput::openAlignmentOutput(string path) { if(!userParameters->getOutputClustal() && !userParameters->getOutputNbrf() && !userParameters->getOutputGCG() && !userParameters->getOutputPhylip() && !userParameters->getOutputGde() && !userParameters->getOutputNexus() && !userParameters->getOutputFasta()) { utilityObject->error("You must select an alignment output format\n"); return false; } string _fileNameToOutput = path; if(_fileNameToOutput == "") { /*_fileNameToOutput = userParameters->getSeqName();*/ /* BUG 166 , file extension, FS, 2009-01-26 */ utilityObject->getPath(userParameters->getSeqName(), &_fileNameToOutput); } if(userParameters->getOutputClustal()) { if (userParameters->getOutfileName() != "") { clustalOutName = userParameters->getOutfileName(); if(!openExplicitFile(clustalOutFile, clustalOutName)) { return false; } } else { clustalOutName = openOutputFile(clustalOutFile, "\nEnter a name for the CLUSTAL output file ", _fileNameToOutput, "aln"); if(clustalOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputNbrf()) { if (userParameters->getOutfileName() != "") { nbrfOutName = userParameters->getOutfileName(); if(!openExplicitFile(nbrfOutFile, nbrfOutName)) { return false; } } else { nbrfOutName = openOutputFile(nbrfOutFile, "\nEnter a name for the NBRF/PIR output file", _fileNameToOutput, "pir"); if(nbrfOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputGCG()) { if (userParameters->getOutfileName() != "") { gcgOutName = userParameters->getOutfileName(); if(!openExplicitFile(gcgOutFile, gcgOutName)) { return false; } } else { gcgOutName = openOutputFile(gcgOutFile, "\nEnter a name for the GCG output file", _fileNameToOutput, "msf"); if(gcgOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputPhylip()) { if (userParameters->getOutfileName() != "") { phylipOutName = userParameters->getOutfileName(); if(!openExplicitFile(phylipOutFile, phylipOutName)) { return false; } } else { phylipOutName = openOutputFile(phylipOutFile, "\nEnter a name for the PHYLIP output file", _fileNameToOutput, "phy"); if(phylipOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputGde()) { if (userParameters->getOutfileName() != "") { gdeOutName = userParameters->getOutfileName(); if(!openExplicitFile(gdeOutFile, gdeOutName)) { return false; } } else { gdeOutName = openOutputFile(gdeOutFile, "\nEnter a name for the GDE output file ", _fileNameToOutput, "gde"); if(gdeOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputNexus()) { if (userParameters->getOutfileName() != "") { nexusOutName = userParameters->getOutfileName(); if(!openExplicitFile(nexusOutFile, nexusOutName)) { return false; } } else { nexusOutName = openOutputFile(nexusOutFile, "\nEnter a name for the NEXUS output file ", _fileNameToOutput, "nxs"); if(nexusOutName == "") { return false; // We have not been successful. } } } if(userParameters->getOutputFasta()) { if (userParameters->getOutfileName() != "") { fastaOutName = userParameters->getOutfileName(); if(!openExplicitFile(fastaOutFile, fastaOutName)) { return false; } } else { fastaOutName = openOutputFile(fastaOutFile, "\nEnter a name for the Fasta output file ", _fileNameToOutput, "fasta"); if(fastaOutName == "") { return false; // We have not been successful. } } } return true; } /* * The function openExplicitFile is used to open a file when we have the name already. * It returns true if the file has been opened correctly, false otherwise. */ bool AlignmentOutput::openExplicitFile(auto_ptr& outFile, string fileName) { if (fileName == "") { cerr << "Bad output file [" << fileName << "]\n"; utilityObject->error("Bad output file [%s]\n", fileName.c_str()); return false; } outFile.reset(new ofstream(fileName.c_str(), ofstream::trunc)); if(!outFile->is_open()) { utilityObject->error("Cannot open output file [%s]\n", fileName.c_str()); return false; } return true; } /* * The function openOutputFile is used to open a file when we dont have the name yet. * This function returns the name if it has been successful. If it has not been * successful it returns a blank string "" */ string AlignmentOutput::openOutputFile(auto_ptr& outFile, string prompt, string path, string fileExtension) { string temp; string _fileName; // Will return this name. string message; _fileName = path + fileExtension; if(_fileName.compare(userParameters->getSeqName()) == 0) { cout << "Output file name is the same as input file.\n"; if (userParameters->getMenuFlag()) { message = "\n\nEnter new name to avoid overwriting [" + _fileName + "]"; utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } } else if (userParameters->getMenuFlag()) { message = prompt + " [" + _fileName + "]"; utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } outFile.reset(new ofstream(_fileName.c_str(), ofstream::trunc)); if(!outFile->is_open()) { utilityObject->error("Cannot open output file [%s]\n", _fileName.c_str()); return ""; } return _fileName; } /* * fastaOut: output the alignment in FASTA format */ void AlignmentOutput::fastaOut(Alignment* alignPtr, outputRegion partToOutput) { char residue; int val; int i, ii; int j, slen; int lineLength; int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; rangeNum rnum; cout << "firstres = " << firstRes << " lastres = " << lastRes << "\n"; try { const SeqArray* alignment = alignPtr->getSeqArray(); //NOTE june29 vector sequence; sequence.assign(lastRes + 1, '0'); lineLength = PAGEWIDTH - alignPtr->getMaxNames(); lineLength = lineLength - lineLength % 10; // round to a multiple of 10 if (lineLength > LINELENGTH || lineLength <= 0) // Mark 18-7-07 { lineLength = LINELENGTH; } for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); slen = 0; //for(j = firstRes; j < firstRes + lastRes; j++) //- nige for(j = firstRes; j <= lastRes; j++) //- nige { if (j <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '-'; } else { residue = userParameters->getAminoAcidCode(val); } if (userParameters->getLowercase()) { sequence[j - firstRes] = residue; } else { sequence[j - firstRes] = residue; } slen++; } (*fastaOutFile) << ">" << nameonly(alignPtr->getName(i)); if(userParameters->getSeqRange()) { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); (*fastaOutFile) << "/" << rnum.start << "-" << rnum.end; } (*fastaOutFile) << "\n"; for(j = 1; j <= slen; j++) { (*fastaOutFile) << sequence[j-1]; if((j % lineLength == 0) || (j == slen)) { (*fastaOutFile) << "\n"; } } } fastaOutFile->close(); cout << "FASTA file created!\n"; } catch(const bad_alloc& e) { fastaOutFile->close(); cerr << "A bad_alloc exception has occured in the fastaOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { fastaOutFile->close(); cerr << "An exception has occured in the fastaOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { fastaOutFile->close(); cerr << "An exception has occured in the fastaOut function.\n"; exit(1); } } /* * gcgOut: output the alignment in gcg file format */ void AlignmentOutput::gcgOut(Alignment* alignPtr, outputRegion partToOutput) { char residue; int val; int i, ii, chunks, block; int j, k, pos1, pos2; long grandChecksum; try { int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; rangeNum rnum; vector sequence; vector allChecks; int _maxLength = alignPtr->getMaxAlnLength(); sequence.assign(_maxLength + 1, '0'); allChecks.assign(lastSeq + 1, 0); const SeqArray* alignment = alignPtr->getSeqArray(); for(i = firstSeq; i <= lastSeq; i++) { //for(j = firstRes; j <= firstRes + lastRes - 1; j++) //- nige for(j = firstRes; j <= lastRes; j++) //- nige { if (j <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '.'; } else { residue = userParameters->getAminoAcidCode(val); } sequence[j - firstRes + 1] = residue; } // pad any short sequences with gaps, to make all sequences the same length for(; j <= firstRes + lastRes - 1; j++) { sequence[j - firstRes + 1] = '.'; } allChecks[i] = SeqGCGCheckSum(&sequence, lastRes); } int _index; grandChecksum = 0; for(i = 1; i <= alignPtr->getNumSeqs(); i++) { _index = alignPtr->getOutputIndex(i - 1); grandChecksum += allChecks[_index]; } grandChecksum = grandChecksum % 10000; (*gcgOutFile) << "PileUp\n\n"; (*gcgOutFile) << "\n\n MSF:" << setw(5) << lastRes << " Type: "; if(userParameters->getDNAFlag()) { (*gcgOutFile) << "N"; } else { (*gcgOutFile) << "P"; } (*gcgOutFile) << " Check:" << setw(6) << grandChecksum << " .. \n\n"; float _seqWeight; int length = lastRes - firstRes + 1; //- nige for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); _seqWeight = (alignPtr->getSeqWeight(i - 1) * 100) / (float) INT_SCALE_FACTOR; (*gcgOutFile) << " Name: " << alignPtr->getName(i) << " oo Len:" //<< setw(5) << lastRes << " Check:" << setw(6) << allChecks[i] //- nige << setw(5) << length << " Check:" << setw(6) << allChecks[i] << " Weight: " << fixed << setprecision(1) << _seqWeight << "\n"; } (*gcgOutFile) << "\n//\n"; chunks = length / GCG_LINELENGTH; //- nige if(length % GCG_LINELENGTH != 0) //- nige { ++chunks; } for(block = 1; block <= chunks; block++) { (*gcgOutFile) << "\n\n"; pos1 = ((block - 1) * GCG_LINELENGTH) + 1; pos2 = (length < pos1 + GCG_LINELENGTH - 1)? length : pos1 + GCG_LINELENGTH - 1;//- nige for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); if (!userParameters->getSeqRange()) { (*gcgOutFile) << "\n" << setw(alignPtr->getMaxNames() + 5) << left << alignPtr->getName(i) << " "; } else { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); std::stringstream ss; std::stringstream ss2; string rangeStart; string rangeEnd; ss << rnum.start; ss >> rangeStart; ss2 << rnum.end; ss2 >> rangeEnd; string nameAndRange = nameonly(alignPtr->getName(i)) + "/" + rangeStart; nameAndRange += "-" + rangeEnd; (*gcgOutFile) << "\n" << setw(alignPtr->getMaxNames() + 15) << left << nameAndRange; } for(j = pos1, k = 1; j <= pos2; j++, k++) { //JULIE - //check for int sequences - pad out with '.' characters to end if (j + firstRes - 1 <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j + firstRes - 1); val = (*alignment)[i][j + firstRes - 1]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { residue = '.'; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '.'; } else { residue = userParameters->getAminoAcidCode(val); } (*gcgOutFile) << residue; if(j % 10 == 0) { (*gcgOutFile) << " "; } } } } (*gcgOutFile) << "\n\n"; gcgOutFile->close(); } catch(const bad_alloc& e) { gcgOutFile->close(); cerr << "A bad_alloc exception has occured in the gcgOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { gcgOutFile->close(); cerr << "An exception has occured in the gcgOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { gcgOutFile->close(); cerr << "An exception has occured in the gcgOut function.\n"; exit(1); } } void AlignmentOutput::phylipOut(Alignment* alignPtr, outputRegion partToOutput) { int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; try { char residue; int val; int i, ii, chunks, block; int j, k, pos1, pos2; int nameLen; bool warn; vector _seqNames; const SeqArray* alignment = alignPtr->getSeqArray(); rangeNum rnum; // Push on a blank string. This is because the index starts at 1 for the seqs etc.. _seqNames.push_back(""); nameLen = 0; for(i = firstSeq; i <= lastSeq; i++) { _seqNames.push_back(alignPtr->getName(i)); ii = _seqNames.size(); if(nameLen < ii) { nameLen = ii; } } if(nameLen > 10) { warn = false; for(i = 0; i < (int)_seqNames.size() - 1; i++) { for(j = i + 1; j < (int)_seqNames.size(); j++) { if (_seqNames[i].compare(_seqNames[j]) == 0) { warn = true; } } } if(warn) { utilityObject->warning("Truncating sequence names to 10 characters for PHYLIP output.\nNames in the PHYLIP format file are NOT unambiguous."); } else { utilityObject->warning("Truncating sequence names to 10 characters for PHYLIP output."); } } int length = lastRes - firstRes + 1; //- nige chunks = length / GCG_LINELENGTH; //- nige if(length % GCG_LINELENGTH != 0) //- nige { ++chunks; } (*phylipOutFile) << setw(6) << alignPtr->getNumSeqs() << " " << setw(6) << length; //-nige for(block = 1; block <= chunks; block++) { pos1 = ((block - 1) * GCG_LINELENGTH) + 1; //pos2 = (lastRes < pos1 + GCG_LINELENGTH - 1)? lastRes : pos1 + GCG_LINELENGTH - 1; //- nige pos2 = (length < pos1 + GCG_LINELENGTH - 1)? length : pos1 + GCG_LINELENGTH - 1; for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); if(block == 1) { if(!userParameters->getSeqRange()) { string name = alignPtr->getName(i); (*phylipOutFile) << "\n" << setw(10) << left << name.substr(0,10) << " "; } else { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); std::stringstream ss; std::stringstream ss2; string rangeStart; string rangeEnd; ss << rnum.start; ss >> rangeStart; ss2 << rnum.end; ss2 >> rangeEnd; string nameAndRange = nameonly(alignPtr->getName(i)) + "/"; nameAndRange += rangeStart + "-" + rangeEnd; (*phylipOutFile) << "\n" << setw(alignPtr->getMaxNames() + 15) << left << nameAndRange; } } else { (*phylipOutFile) << "\n "; } for(j = pos1, k = 1; j <= pos2; j++, k++) { if (j + firstRes - 1 <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j + firstRes - 1); val = (*alignment)[i][j + firstRes - 1]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '-'; } else { residue = userParameters->getAminoAcidCode(val); } (*phylipOutFile) << residue; if(j % 10 == 0) { (*phylipOutFile) << " "; } } } (*phylipOutFile) << "\n"; } } catch(const bad_alloc& e) { phylipOutFile->close(); cerr << "A bad_alloc exception has occured in the phylipOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { phylipOutFile->close(); cerr << "An exception has occured in the phylipOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { phylipOutFile->close(); cerr << "An exception has occured in the phylipOut function.\n"; exit(1); } } void AlignmentOutput::nexusOut(Alignment* alignPtr, outputRegion partToOutput) { int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; try { char residue; int val; int i, ii, chunks, block; int j, k, pos1, pos2; const SeqArray* alignment = alignPtr->getSeqArray(); rangeNum rnum; int length = lastRes - firstRes + 1; //- nige chunks = length / GCG_LINELENGTH; //- nige if(length % GCG_LINELENGTH != 0) //- nige { ++chunks; } (*nexusOutFile) << "#NEXUS\n"; (*nexusOutFile) << "BEGIN DATA;\n"; (*nexusOutFile) << "dimensions ntax=" << alignPtr->getNumSeqs() << " nchar=" << length << ";\n"; //- nige (*nexusOutFile) << "format missing=?\n"; // removed - bugzilla bug 204 /* (*nexusOutFile) << "symbols=\""; for(i = 0; i <= userParameters->getMaxAA(); i++) { (*nexusOutFile) << userParameters->getAminoAcidCode(i); } (*nexusOutFile) << "\"\n"; */ (*nexusOutFile) << "interleave datatype="; bool _dnaFlag = userParameters->getDNAFlag(); string _type = _dnaFlag ? "DNA " : "PROTEIN "; (*nexusOutFile) << _type; (*nexusOutFile) << "gap= -;\n"; (*nexusOutFile) << "\nmatrix"; for(block = 1; block <= chunks; block++) { pos1 = ((block - 1) * GCG_LINELENGTH) + 1; pos2 = (length < pos1 + GCG_LINELENGTH - 1)? length : pos1 + GCG_LINELENGTH - 1; //- nige for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); if (!userParameters->getSeqRange()) { (*nexusOutFile) << "\n" << setw(alignPtr->getMaxNames() + 1) << left << alignPtr->getName(i) << " "; } else { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); std::stringstream ss; std::stringstream ss2; string rangeStart; string rangeEnd; ss << rnum.start; ss >> rangeStart; ss2 << rnum.end; ss2 >> rangeEnd; string nameAndRange = nameonly(alignPtr->getName(i)) + "/"; nameAndRange += rangeStart + "-" + rangeEnd; (*nexusOutFile) << "\n" << setw(alignPtr->getMaxNames() + 15) << left << nameAndRange; } for(j = pos1, k = 1; j <= pos2; j++, k++) { if (j + firstRes - 1 <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j + firstRes - 1); val = (*alignment)[i][j + firstRes - 1]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '-'; } else { residue = userParameters->getAminoAcidCode(val); } (*nexusOutFile) << residue; } } (*nexusOutFile) << "\n"; } (*nexusOutFile) << ";\nend;\n"; } catch(const bad_alloc& e) { nexusOutFile->close(); cerr << "A bad_alloc exception has occured in the nexusOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { nexusOutFile->close(); cerr << "An exception has occured in the nexusOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { nexusOutFile->close(); cerr << "An exception has occured in the nexusOut function.\n"; exit(1); } } /* * gdeOut: print out the alignment in gde file format. */ void AlignmentOutput::gdeOut(Alignment* alignPtr, outputRegion partToOutput) { int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; int length = lastRes - firstRes + 1; //- nige try { char residue; int val; vector _ssMask1, _ssMask2, seq; int i, ii; int j, slen; int lineLength; const SeqArray* alignment = alignPtr->getSeqArray(); rangeNum rnum; seq.assign(alignPtr->getMaxAlnLength() + 1, '0'); // decide the line length for this alignment - maximum is LINELENGTH lineLength = PAGEWIDTH - alignPtr->getMaxNames(); lineLength = lineLength - lineLength % 10; // round to a multiple of 10 if (lineLength > LINELENGTH || lineLength <= 0) { lineLength = LINELENGTH; } // If we are using the secondary structure info from profile 1, set it up if (userParameters->getStructPenalties1() == SECST && userParameters->getUseSS1() == true) { int _lengthSeq1 = alignPtr->getSeqLength(1); vector* _secStructMask1 = alignPtr->getSecStructMask1(); _ssMask1.assign(_lengthSeq1 + 10, 0); for (i = 0;i < _lengthSeq1;i++) { _ssMask1[i] = _secStructMask1->at(i); } printSecStructMask(_lengthSeq1, _secStructMask1, &_ssMask1); } // If we are using the secondary structure info from profile 2, set it up if (userParameters->getStructPenalties2() == SECST && userParameters->getUseSS2() == true) { int indexProfile2FirstSeq = alignPtr->getProfile1NumSeqs() + 1; int lengthSeqProfile2 = alignPtr->getSeqLength(indexProfile2FirstSeq); _ssMask2.assign(lengthSeqProfile2 + 10, 0); vector* _secStructMask2 = alignPtr->getSecStructMask2(); for (i=0;i < lengthSeqProfile2;i++) { _ssMask2[i] = _secStructMask2->at(i); } printSecStructMask(lengthSeqProfile2, _secStructMask2, &_ssMask2); } bool _dnaFlag = userParameters->getDNAFlag(); string _prefix = _dnaFlag ? "#" : "%"; for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); (*gdeOutFile) << _prefix; if(!userParameters->getSeqRange()) { (*gdeOutFile) << alignPtr->getName(i) << "\n"; } else { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); (*gdeOutFile) << nameonly(alignPtr->getName(i)) << "/" << rnum.start << "-" << rnum.end << "\n"; } slen = 0; //for(j = firstRes; j < firstRes + lastRes; j++) //- nige for(j = firstRes; j <= lastRes; j++) //- nige { if (j <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '-'; } else { residue = userParameters->getAminoAcidCode(val); } if (userParameters->getLowercase()) { seq[j - firstRes] = (char)tolower((int)residue); } else { seq[j - firstRes] = residue; } slen++; } for(j = 1; j <= slen; j++) { (*gdeOutFile) << seq[j-1]; if((j % lineLength == 0) || (j == slen)) { (*gdeOutFile) << "\n"; } } } if (userParameters->getOutputStructPenalties() == 0 || userParameters->getOutputStructPenalties() == 2) { if (userParameters->getStructPenalties1() == SECST && userParameters->getUseSS1() == true) { (*gdeOutFile) << "\"SS_" << setw(alignPtr->getMaxNames()) << left << alignPtr->getSecStructName1() << "\n"; //for(i = firstRes; i < firstRes + lastRes; i++) //- nige for(i = firstRes; i <= lastRes; i++) //- nige { val = _ssMask1[i - 1]; if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { seq[i - firstRes] = '-'; } else { seq[i - firstRes] = val; } } for(i = 1; i <= lastRes; i++) { (*gdeOutFile) << seq[i-1]; if((i % lineLength == 0) || (i == lastRes)) { (*gdeOutFile) << "\n"; } } } if (userParameters->getStructPenalties2() == SECST && userParameters->getUseSS2() == true) { (*gdeOutFile) << "\"SS_" << setw(alignPtr->getMaxNames()) << left << alignPtr->getSecStructName2() << "\n"; //for(i = firstRes; i < firstRes + lastRes; i++) //- nige for(i = firstRes; i <= lastRes; i++) //- nige { val = _ssMask2[i - 1]; if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { seq[i - firstRes] = '-'; } else { seq[i - firstRes] = val; } } //for(i = 1; i <= lastRes; i++) //- nige for(i = 1; i <= length; i++) //- nige { (*gdeOutFile) << seq[i - 1]; //if((i % lineLength == 0) || (i == lastRes)) //- nige if((i % lineLength == 0) || (i == length)) //- nige { (*gdeOutFile) << "\n"; } } } } if (userParameters->getOutputStructPenalties() == 1 || userParameters->getOutputStructPenalties() == 2) { if (userParameters->getStructPenalties1() != NONE && userParameters->getUseSS1() == true) { (*gdeOutFile) << "\"GM_" << setw(alignPtr->getMaxNames()) << left << alignPtr->getSecStructName1() << "\n"; vector* _gapPenaltyMask1 = alignPtr->getGapPenaltyMask1(); //for(i = firstRes; i < firstRes + lastRes; i++) //- nige for(i = firstRes; i <= lastRes; i++) //- nige { val = _gapPenaltyMask1->at(i - 1); if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { seq[i - firstRes] = '-'; } else { seq[i - firstRes] = val; } } //for(i = 1; i <= lastRes; i++) //- nige for(i = 1; i <= length; i++) //- nige { (*gdeOutFile) << seq[i - 1]; //if((i % lineLength == 0) || (i == lastRes)) //- nige if((i % lineLength == 0) || (i == length)) //- nige { (*gdeOutFile) << "\n"; } } } if (userParameters->getStructPenalties2() != NONE && userParameters->getUseSS2() == true) { (*gdeOutFile) << "\"GM_" << setw(alignPtr->getMaxNames()) << left << alignPtr->getSecStructName2() << "\n"; vector* _gapPenaltyMask2 = alignPtr->getGapPenaltyMask2(); //for(i = firstRes; i < firstRes + lastRes; i++) //- nige for(i = firstRes; i < length; i++) //- nige { val = _gapPenaltyMask2->at(i-1); if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { seq[i - firstRes] = '-'; } else { seq[i - firstRes] = val; } } //for(i = 1; i <= lastRes; i++) //- nige for(i = 1; i <= length; i++) //- nige { (*gdeOutFile) << seq[i - 1]; //if((i % lineLength == 0) || (i == lastRes)) //- nige if((i % lineLength == 0) || (i == length)) //- nige { (*gdeOutFile) << "\n"; } } } } gdeOutFile->close(); } catch(const bad_alloc& e) { gdeOutFile->close(); cerr << "A bad_alloc exception has occured in the gdeOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { gdeOutFile->close(); cerr << "An exception has occured in the gdeOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { gdeOutFile->close(); cerr << "An exception has occured in the gdeOut function.\n"; exit(1); } } void AlignmentOutput::nbrfOut(Alignment* alignPtr, outputRegion partToOutput) { char residue; int val; int i, ii; int j, slen; int lineLength; rangeNum rnum; int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; try { int _maxLength = alignPtr->getMaxAlnLength(); vector sequence; sequence.assign(_maxLength + 1, '0'); const SeqArray* alignment = alignPtr->getSeqArray(); // decide the line length for this alignment - maximum is LINELENGTH lineLength = PAGEWIDTH - alignPtr->getMaxNames(); lineLength = lineLength - lineLength % 10; // round to a multiple of 10 if (lineLength > LINELENGTH || lineLength <= 0) // Mark, 18-7-07 { lineLength = LINELENGTH; } // Get name prefix. DL if DNA, P1 if protein string namePrefix; bool _dnaFlag = userParameters->getDNAFlag(); namePrefix = _dnaFlag ? ">DL;" : ">P1;"; //int length = lastRes - firstRes + 1; //- nige for(ii = firstSeq; ii <= lastSeq; ii++) { i = alignPtr->getOutputIndex(ii - 1); (*nbrfOutFile) << namePrefix; if (!userParameters->getSeqRange()) { (*nbrfOutFile) << alignPtr->getName(i) << "\n" << alignPtr->getTitle(i) << "\n"; } else { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); (*nbrfOutFile) << nameonly(alignPtr->getName(i)) << "/" << rnum.start << "-"<< rnum.end << "\n" << alignPtr->getTitle(i) << "\n"; } slen = 0; //for(j = firstRes; j < firstRes + lastRes; j++) //- nige for(j = firstRes; j <= lastRes; j++) //- nige { // NOTE I changed this here!!!!! if (j <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { residue = '-'; } else { residue = userParameters->getAminoAcidCode(val); } sequence[j - firstRes] = residue; slen++; } for(j = 1; j <= slen; j++) { (*nbrfOutFile) << sequence[j - 1]; if((j % lineLength == 0) || (j == slen)) { (*nbrfOutFile) << "\n"; } } (*nbrfOutFile) << "*\n"; } nbrfOutFile->close(); } catch(const bad_alloc& e) { nbrfOutFile->close(); cerr << "A bad_alloc exception has occured in the nbrfOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { nbrfOutFile->close(); cerr << "An exception has occured in the nbrfOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { nbrfOutFile->close(); cerr << "An exception has occured in the nbrfOut function.\n"; exit(1); } } /* * The function clustalOut is used to ouput the Alignment into a clustal format * file. */ void AlignmentOutput::clustalOut(Alignment* alignPtr, outputRegion partToOutput) { int firstRes = partToOutput._firstRes; int lastRes = partToOutput._lastRes; int firstSeq = partToOutput._firstSeq; int lastSeq = partToOutput._lastSeq; try { vector seq1; vector seqNo; vector printSeqNo; vector ss_mask1, ss_mask2; const SeqArray* alignment = alignPtr->getSeqArray(); char temp[MAXLINE]; char c; int val; int ii, lv1, catident1[NUMRES], catident2[NUMRES], ident, chunks; int i, j, k, l; int pos, ptr; int lineLength; rangeNum rnum; string tmpStr = ""; string sequenceLine = ""; int _numSequences = alignPtr->getNumSeqs(); // PMcG revert to Clustalw1.83 output format for name width const int NAMESWIDTH=std::max(std::min(MAXNAMESTODISPLAY,alignPtr->getMaxNames()) , MINNAMESTODISPLAY); seqNo.assign(_numSequences + 1, 0); printSeqNo.assign(_numSequences + 1, 0); // check that lastSeq <= _numSequences if(lastSeq > _numSequences) { lastSeq = _numSequences; } for (i = firstSeq; i <= lastSeq; i++) { printSeqNo[i] = seqNo[i] = 0; for(j = 1; j < firstRes; j++) { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 if((val >= 0) || (val <= userParameters->getMaxAA())) { seqNo[i]++; } } } seq1.assign(alignPtr->getMaxAlnLength() + 1, 0); // Check if we have secondary structure in file 1 and if we want to output it. if (userParameters->getStructPenalties1() == SECST && userParameters->getUseSS1() == true) { int lengthSeq1 = alignPtr->getSeqLength(1); ss_mask1.assign(lengthSeq1 + 10, 0); vector* _secStructMask1 = alignPtr->getSecStructMask1(); for (i = 0; i < lengthSeq1; i++) { ss_mask1[i] = _secStructMask1->at(i); } printSecStructMask(lengthSeq1, _secStructMask1, &ss_mask1); } // Check if we have secondary structure in file 2 and if we want to output it. if (userParameters->getStructPenalties2() == SECST && userParameters->getUseSS2() == true && userParameters->getProfile2Empty() == false) { // AW added test getProfile2Empty was meant to fix bug // 141, but only prevents segfault, output still faulty. // Has to be fixed somewhere else int indexProfile2FirstSeq = alignPtr->getProfile1NumSeqs() + 1; int lengthSeqProfile2 = alignPtr->getSeqLength(indexProfile2FirstSeq); ss_mask2.assign(lengthSeqProfile2 + 10, 0); vector* _secStructMask2 = alignPtr->getSecStructMask2(); for (i = 0; i < lengthSeqProfile2; i++) { ss_mask2[i] = _secStructMask2->at(i); } printSecStructMask(lengthSeqProfile2, _secStructMask2, &ss_mask2); } (*clustalOutFile) << "CLUSTAL "<< userParameters->getRevisionLevel() << " multiple sequence alignment\n\n"; // decide the line length for this alignment - maximum is LINELENGTH //PMcG 9-2-2008 make line output same as 1.83 //lineLength = PAGEWIDTH - alignPtr->getMaxNames(); lineLength = PAGEWIDTH - NAMESWIDTH; lineLength = lineLength - lineLength % 10; // round to a multiple of 10 if (lineLength > LINELENGTH || lineLength <= 0) // Mark 18-7-07 { lineLength = LINELENGTH; } int length = lastRes - firstRes + 1; //- nige chunks = length / lineLength; //- nige if(length % lineLength != 0) //- nige { ++chunks; } //printf("firstRes=%d,lastRes=%d,length=%d,chunks=%d\n", // firstRes, lastRes, length, chunks); // This will loop through each of the blocks. for(lv1 = 1; lv1 <= chunks; ++lv1) { // pos is begining of chunk, ptr is the end of the chunk to be displayed. pos = ((lv1 - 1) * lineLength) + 1; ptr = (length < pos + lineLength - 1) ? length : pos + lineLength - 1; //- nige (*clustalOutFile) << "\n"; int _outStructPenalty = userParameters->getOutputStructPenalties(); string secStructName1 = alignPtr->getSecStructName1(); // Mark 18-7-07 if((int)secStructName1.size() > MAXNAMESTODISPLAY) { //secStructName1 = secStructName1.substr(0, MAXNAMESTODISPLAY); secStructName1 = secStructName1.substr(0, NAMESWIDTH); } if (_outStructPenalty == 0 || _outStructPenalty == 2) { if (userParameters->getStructPenalties1() == SECST && userParameters->getUseSS1() == true) { for(i = pos; i <= ptr; ++i) { // Check if we can access mask position first if((int)ss_mask1.size() > i + firstRes - 2) { val = ss_mask1[i + firstRes - 2]; if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { temp[i - pos] = '-'; } else { temp[i - pos] = val; } } else { break; } } temp[i - pos] = EOS; if(userParameters->getSeqRange()) { //(*clustalOutFile) << "!SS_" << setw(MAXNAMESTODISPLAY + (*clustalOutFile) << "!SS_" << setw(NAMESWIDTH + clusSecStructOffset) << left << secStructName1 << " " << temp << "\n"; } else { //(*clustalOutFile) << "!SS_" << setw(MAXNAMESTODISPLAY) (*clustalOutFile) << "!SS_" << setw(NAMESWIDTH) << left << secStructName1 << " " << temp << "\n"; } } } if (_outStructPenalty == 1 || _outStructPenalty == 2) { if (userParameters->getStructPenalties1() != NONE && userParameters->getUseSS1() == true) { vector* _gapPenaltyMask1 = alignPtr->getGapPenaltyMask1(); for(i = pos; i <= ptr; ++i) { if((int)_gapPenaltyMask1->size() > i + firstRes - 2) { val = _gapPenaltyMask1->at(i + firstRes - 2); if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { temp[i - pos] = '-'; } else { temp[i - pos] = val; } } else { break; } } temp[i - pos] = EOS; //(*clustalOutFile) << "!GM_" << setw(MAXNAMESTODISPLAY) << left (*clustalOutFile) << "!GM_" << setw(NAMESWIDTH) << left << secStructName1 << " " << temp << "\n"; } } string secStructName2 = alignPtr->getSecStructName2(); // Mark 18-7-07 //if((int)secStructName2.size() > MAXNAMESTODISPLAY) if((int)secStructName2.size() > NAMESWIDTH) { //secStructName2 = secStructName2.substr(0, MAXNAMESTODISPLAY); secStructName2 = secStructName2.substr(0, NAMESWIDTH); } if (_outStructPenalty == 0 || _outStructPenalty == 2) { if (userParameters->getStructPenalties2() == SECST && userParameters->getUseSS2() == true) { for(i = pos; i <= ptr; ++i) { if((int)ss_mask2.size() > i + firstRes - 2) { val = ss_mask2[i + firstRes - 2]; if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { temp[i - pos] = '-'; } else { temp[i - pos] = val; } } else { break; } } temp[i - pos] = EOS; if (userParameters->getSeqRange()) { //(*clustalOutFile) << "!SS_" << setw(MAXNAMESTODISPLAY + (*clustalOutFile) << "!SS_" << setw(NAMESWIDTH + clusSecStructOffset) << left << secStructName2; (*clustalOutFile) << " " << temp << "\n"; } else { //(*clustalOutFile) << "!SS_" << setw(MAXNAMESTODISPLAY) (*clustalOutFile) << "!SS_" << setw(NAMESWIDTH) << left << secStructName2 << " " << temp << "\n"; } } } if (_outStructPenalty == 1 || _outStructPenalty == 2) { if (userParameters->getStructPenalties2() != NONE && userParameters->getUseSS2() == true) { vector* _gapPenaltyMask2 = alignPtr->getGapPenaltyMask2(); for(i = pos; i <= ptr; ++i) { if((int)_gapPenaltyMask2->size() > i + firstRes - 2) { val = _gapPenaltyMask2->at(i + firstRes - 2); if (val == userParameters->getGapPos1() || val == userParameters->getGapPos2()) { temp[i - pos] = '-'; } else { temp[i - pos] = val; } } else { break; } } temp[i - pos] = EOS; //(*clustalOutFile) << "!GM_" << setw(MAXNAMESTODISPLAY) << left (*clustalOutFile) << "!GM_" << setw(NAMESWIDTH) << left << secStructName2 << " " << temp << "\n"; } } for(ii = firstSeq; ii <= lastSeq; ++ii) { i = alignPtr->getOutputIndex(ii - 1); printSeqNo[i] = 0; for(j = pos; j <= ptr; ++j) { if (j + firstRes - 1 <= alignPtr->getSeqLength(i)) { //val = alignPtr.getResidue(i, j + firstRes - 1); val = (*alignment)[i][j + firstRes - 1]; // NOTE june29 } else { val = -3; } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { seq1[j] = '-'; } else { seq1[j] = userParameters->getAminoAcidCode(val); seqNo[i]++; printSeqNo[i] = 1; } } for(; j <= ptr; ++j) { seq1[j]='-'; } sequenceLine = ""; for(int index = pos; index < ptr + 1; index++) { sequenceLine += seq1[index]; } string seqName = alignPtr->getName(i); //if((int)seqName.size() > MAXNAMESTODISPLAY) if((int)seqName.size() > NAMESWIDTH) { //seqName = seqName.substr(0, MAXNAMESTODISPLAY); seqName = seqName.substr(0, NAMESWIDTH); } if (!userParameters->getSeqRange()) { // NOTE I made a change here from + 5, to + 6. //(*clustalOutFile) << setw(alignPtr->getMaxNames() + 6) << left // << alignPtr->getName(i); //(*clustalOutFile) << setw(MAXNAMESTODISPLAY + 6) << left // << seqName; // PMcG changed this to revert to behaviour of clustalw1.83 // //(*clustalOutFile) << setw(std::max(std::min(MAXNAMESTODISPLAY,alignPtr->getMaxNames()) , MINNAMESTODISPLAY) + 6) (*clustalOutFile) << setw(NAMESWIDTH + 6) << left << seqName; } else // Put the sequence range information in! { findRangeValues(alignPtr, &rnum, firstRes, lastRes, ii); string nameOnly = nameonly(seqName); std::stringstream ss; std::stringstream ss2; string rangeStart; string rangeEnd; ss << rnum.start; ss >> rangeStart; ss2 << rnum.end; ss2 >> rangeEnd; tmpStr = nameOnly + "/" + rangeStart + "-" + rangeEnd; //(*clustalOutFile) << setw(MAXNAMESTODISPLAY + clusSequenceOffset) (*clustalOutFile) << setw(NAMESWIDTH + clusSequenceOffset) << left << tmpStr; } (*clustalOutFile) << sequenceLine; if (userParameters->getClSeqNumbers() && printSeqNo[i]) { (*clustalOutFile) << " " << seqNo[i]; } (*clustalOutFile) << "\n"; } // Now print out the conservation information! for(i = pos; i <= ptr; ++i) { seq1[i] = ' '; ident = 0; for(j = 1; j <= (int)strongGroup.size(); j++) { catident1[j - 1] = 0; } for(j = 1; j <= (int)weakGroup.size(); j++) { catident2[j - 1] = 0; } for(j = firstSeq; j <= lastSeq; ++j) { if((i + firstRes - 1 <= alignPtr->getSeqLength(j)) && (i + firstRes - 1 <= alignPtr->getSeqLength(firstSeq))) {// NOTE june29 if(((*alignment)[firstSeq][i + firstRes - 1] >= 0) && ((*alignment)[firstSeq][i + firstRes - 1] <= userParameters->getMaxAA())) { // Count how many are identical to the first sequence if((*alignment)[firstSeq][i + firstRes - 1] == (*alignment)[j][i + firstRes - 1]) { ++ident; } // Count how many are in the same category. for(k = 1; k <= (int)strongGroup.size(); k++) { for(l = 0; (c = strongGroup[k - 1][l]); l++) { int resCode = (*alignment)[j][i + firstRes - 1]; if(resCode <= userParameters->getMaxAA() + 1) { if (userParameters->getAminoAcidCode(resCode) == c) { catident1[k - 1]++; break; } } } } for(k = 1; k <= (int)weakGroup.size(); k++) { for(l = 0; (c = weakGroup[k - 1][l]); l++) {//NOTE june29 int resCode = (*alignment)[j][i + firstRes - 1]; if(resCode <= userParameters->getMaxAA() + 1) { if (userParameters->getAminoAcidCode(resCode) == c) { catident2[k - 1]++; break; } } } } } } } // Now do the conservation part for each block. if(ident == lastSeq - firstSeq + 1) { seq1[i] = '*'; // All residues the same! } else if (!userParameters->getDNAFlag()) { for(k = 1; k <= (int)strongGroup.size(); k++) { if (catident1[k - 1] == lastSeq - firstSeq + 1) { seq1[i] = ':'; // All residues member of the same category break; } } if(seq1[i] == ' ') { for(k = 1; k <= (int)weakGroup.size(); k++) { if (catident2[k - 1] == lastSeq - firstSeq + 1) { seq1[i] = '.'; // All residues member of the same category break; } } } } } sequenceLine = ""; for(int index = pos; index < ptr + 1; index++) { sequenceLine += seq1[index]; } //for(k = 0; k < MAXNAMESTODISPLAY + 6; k++) for(k = 0; k < NAMESWIDTH + 6; k++) { (*clustalOutFile) << " "; } if(userParameters->getSeqRange()) { (*clustalOutFile) << " "; } (*clustalOutFile) << sequenceLine << "\n"; } clustalOutFile->close(); } catch(const bad_alloc& e) { clustalOutFile->close(); cerr << "A bad_alloc exception has occured in the clustalOut function.\n" << e.what() << "\n"; exit(1); } catch(VectorOutOfRange e) { clustalOutFile->close(); cerr << "An exception has occured in the clustalOut function.\n" << e.what() << "\n"; exit(1); } catch(exception e) { clustalOutFile->close(); cerr << "An exception has occured in the clustalOut function.\n" << e.what() << "\n"; exit(1); } catch(...) { clustalOutFile->close(); cerr << "An exception has occured in the clustalOut function.\n"; exit(1); } } /* * The function printSecStructMask takes in the 2 mask vectors. It makes changes to * mask and puts the result in structMask. This is the one that will be printed out. * NOTE I have had to use (*structMask)[i] syntax. This is not good. But there is no * way to do random access setting in vectors otherwise. */ void AlignmentOutput::printSecStructMask(int prfLength, vector* mask, vector* structMask) { int i, j; // calculate the gap penalty mask from the secondary structures i = 0; try { while (i < prfLength) { if (tolower(mask->at(i)) == 'a' || mask->at(i) == '$') { for (j = 0; j < userParameters->getHelixEndMinus(); j++) { if (i + j >= prfLength || (tolower(mask->at(i+j)) != 'a' && mask->at(i+j) != '$')) { break; } (*structMask)[i+j] = 'a'; } i += j; while (tolower(mask->at(i)) == 'a' || mask->at(i) == '$') { if (i >= prfLength) break; if (mask->at(i) == '$') { (*structMask)[i] = 'A'; i++; break; } else (*structMask)[i] = (*mask)[i]; i++; } for (j = 0; j < userParameters->getHelixEndMinus(); j++) { if ((i-j-1>=0) && (tolower(mask->at(i-j-1)) == 'a' || mask->at(i-j-1) == '$')) { (*structMask)[i - j - 1] = 'a'; } } } else if (tolower(mask->at(i)) == 'b' || mask->at(i) == '%') { for (j = 0; j < userParameters->getStrandEndMinus(); j++) { if (i + j >= prfLength || (tolower(mask->at(i+j)) != 'b' && mask->at(i+j) != '%')) { break; } (*structMask)[i+j] = 'b'; } i += j; while (tolower(mask->at(i)) == 'b' || mask->at(i) == '%') { if (i >= prfLength) break; if (mask->at(i) == '%') { (*structMask)[i] = 'B'; i++; break; } else { (*structMask)[i] = mask->at(i); } i++; } for (j = 0; j < userParameters->getStrandEndMinus(); j++) { if ((i - j - 1 >= 0) && (tolower(mask->at(i - j - 1)) == 'b' || mask->at(i-j-1) == '%')) { (*structMask)[i-j-1] = 'b'; } } } else { i++; } } } catch(const exception& e) { // Catch all the exceptions cerr << "There has been an exception in the function printSecStructMask\n" << e.what() << "\n"; exit(1); } } /* * The function findRangeValues is used to find the range to be printed out. * * */ void AlignmentOutput::findRangeValues(Alignment* alignPtr, rangeNum *rnum, int firstRes, int len, int firstSeq) { assert(rnum); assert(firstRes > 0); assert(len > 0); assert(firstSeq > 0); try { int val; int i, ii; int j, slen; char tmpName[FILENAMELEN + 15]; int iStart = 0; int iEnd = 0; // to print sequence start-end with names int found = 0; int ngaps = 0; int tmpStart = 0; int tmpEnd = 0; int ntermgaps = 0; int pregaps = 0; int tmpk = 0; int isRange = 0; int formula = 0; const SeqArray* alignment = alignPtr->getSeqArray(); tmpName[0] = '\0'; slen = 0; ii = firstSeq ; i = alignPtr->getOutputIndex(ii - 1); // NOTE Same as elsewhere! string name = alignPtr->getName(i); if( (sscanf(name.c_str(),"%[^/]/%d-%d",tmpName, &tmpStart, &tmpEnd) == 3)) { isRange = 1; } for(tmpk = 1; tmpk < firstRes; tmpk++) { // do this irrespective of above sscanf //val = alignPtr.getResidue(i, tmpk); val = (*alignment)[i][tmpk]; // NOTE june29 if ((val < 0) || (val > userParameters->getMaxAA())) { //it is gap pregaps++; } } for(j = firstRes; j < firstRes + len; j++) { if(j > alignPtr->getSeqLength(i)) { val = -3; // Cant get it so break out. } else { //val = alignPtr.getResidue(i, j); val = (*alignment)[i][j]; // NOTE june29 } if((val == -3) || (val == 253)) { break; } else if((val < 0) || (val > userParameters->getMaxAA())) { ngaps++; } else { found = j; } if ( found && (iStart == 0) ) { iStart = found; ntermgaps = ngaps; } slen++; } if(userParameters->getSeqRange()) { cout << "Name : " << alignPtr->getName(i) << " " << "\n firstRes = "<< firstRes << " " << " len = " << len << " " << "\n iStart = " << iStart << " " << "\n tmpStart = " << tmpStart << " " << "\n ngaps = " << ngaps << " " << "\n pregaps = " << pregaps << " "; if (!isRange) { formula = iStart - pregaps; } else { formula = iStart - pregaps + ( tmpStart == 1 ? 0: tmpStart-1) ; } cout << "\n\nsuggestion iStart - pregaps + tmpStart - ntermgaps = " << iStart << " - " << pregaps << " + " << tmpStart << " - " << ntermgaps << " formula " << formula << " "; } else { cerr << "\n no range found .... strange, iStart = " << iStart; formula = 1; } if (pregaps == firstRes - 1) // all gaps - now the conditions........ { formula = tmpStart ; // keep the previous start... } formula = (formula <= 0) ? 1: formula; if (pregaps == 0 && tmpStart == 0) { formula = firstRes; } iEnd = formula + len - ngaps -1; rnum->start = formula; rnum->end = iEnd; cout << "\n check... " << alignPtr->getName(i) << " " << rnum->start << " - " << rnum->end; cout << " Done checking........."; } catch(VectorOutOfRange e) { cerr << "An exception has occured in the findRangeValues function.\n" << e.what() << "\n"; exit(1); } catch(...) { cerr << "An exception has occured in findRangeValues function\n"; exit(1); } } string AlignmentOutput::nameonly(string s) { string tmp; try { int i = 0; while (i < (int)s.size()) { if(s.at(i) != '/') { tmp += s.at(i); i++; } else { break; } } } catch(const exception& e) { cerr << "An exception has occured in the function nameonly\n" << e.what(); exit(1); } return tmp; } int AlignmentOutput::SeqGCGCheckSum(vector* seq, int length) { int i; long check; int seqResIndex = 1; //int seqLength = seq->size(); for (i = 0, check = 0; i < length; i++, seqResIndex++) { char _toUpperCase = (*seq)[seqResIndex]; check += ((i % 57) + 1) * toupper(_toUpperCase); } return (check % 10000); } void AlignmentOutput::showAlign() { //FILE *file; int numLines; char temp[MAXLINE + 1]; temp[0] = '\0'; string fileName; string answer; if(userParameters->getOutputClustal()) { fileName = clustalOutName; } else if(userParameters->getOutputNbrf()) { fileName = nbrfOutName; } else if(userParameters->getOutputGCG()) { fileName = gcgOutName; } else if(userParameters->getOutputPhylip()) { fileName = phylipOutName; } else if(userParameters->getOutputGde()) { fileName = gdeOutName; } else if(userParameters->getOutputNexus()) { fileName = nexusOutName; } else if(userParameters->getOutputFasta()) { fileName = fastaOutName; } else { return; // No file output type! } ifstream _fileIn; _fileIn.open(fileName.c_str(), ios::in); _fileIn.seekg(0, std::ios::beg); // start at the beginning cout << "\n\n"; numLines = 0; while(_fileIn.getline(temp, MAXLINE + 1, '\n')) { //fputs(temp,stdout); cout << temp << "\n"; ++numLines; if(numLines >= PAGE_LEN) { cout << "\n"; utilityObject->getStr(string("Press [RETURN] to continue or X to stop"), answer); if(toupper(answer[0]) == 'X') { _fileIn.close(); return; } else { numLines = 0; } } } _fileIn.close(); cout << "\n"; utilityObject->getStr(string("Press [RETURN] to continue"), answer); } } clustalw-2.1/src/alignment/ObjectiveScore.cpp0000644000175000017500000001665011442167172016327 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "ObjectiveScore.h" #include "Alignment.h" #include "../general/userparams.h" #include "../general/debuglogObject.h" namespace clustalw { ObjectiveScore::ObjectiveScore() : score(0), alignToScore(0), scale(100000), sagaGapEx(12), sagaGapOp(8), gapPos1(userParameters->getGapPos1()), gapPos2(userParameters->getGapPos2()) { } long ObjectiveScore::getScore(const Alignment* alnToScore) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("In getScore function"); } #endif alignToScore = alnToScore; // If it doesnt point to any object return 0; if(!alignToScore) { return 0; } int maxRes = subMatrix->getAlnScoreMatrix(matrix); if (maxRes == 0) { utilityObject->error("Matrix for alignment scoring not found\n"); return 0; } const vector* seqWeight = alignToScore->getSeqWeights(); vector normalisedSeqWeights; calcNormalisedSeqWeights(seqWeight, &normalisedSeqWeights); int seq1, seq2; float w1, w2 = 1.0; float weight = 1.0; score = 0; float pwScoreLetters = 0, pwScoreGaps = 0, pwScore = 0; float scoreTotal = 0.0; int numSeqs = alignToScore->getNumSeqs(); int sizeNormalSeqWeight = normalisedSeqWeights.size(); for (seq1 = 1; seq1 <= numSeqs && seq1 <= sizeNormalSeqWeight; seq1++) { w1 = normalisedSeqWeights[seq1 - 1]; for (seq2 = seq1 + 1; seq2 <= numSeqs && seq2 <= sizeNormalSeqWeight; seq2++) { w2 = normalisedSeqWeights[seq2 - 1]; weight = w1 * w2; pwScoreLetters = scoreLetters(seq1, seq2); pwScoreGaps = scoreGaps(seq1, seq2); pwScore = pwScoreLetters + pwScoreGaps; scoreTotal += weight * pwScore; #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " weight = " << weight << " scoreLetters = " << pwScoreLetters << " scoreGaps = " << pwScoreGaps << " scorePair = " << pwScore << "\n" << "scoreTotal = " << scoreTotal << "\n"; logObject->logMsg(outs.str()); } #endif } } score = static_cast(scoreTotal); #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " score = " << score; logObject->logMsg(outs.str()); } #endif utilityObject->info("Alignment Score %d\n", score); return score; } float ObjectiveScore::scoreLetters(int seq1, int seq2) { if(!alignToScore) { return 0; } const unsigned numColsSeq1 = alignToScore->getSeqLength(seq1); const unsigned numColsSeq2 = alignToScore->getSeqLength(seq2); if(numColsSeq1 != numColsSeq2) { return 0; // The sequences should be the same length after alignment. } float scoreLetters = 0; unsigned colStart = 1; bool gap1, gap2; for(unsigned col = 1; col < numColsSeq1; col++) { gap1 = alignToScore->isGap(seq1, col); gap2 = alignToScore->isGap(seq2, col); if(!gap1 || !gap2) { colStart = col; break; } } unsigned colEnd = numColsSeq1; for(unsigned col = numColsSeq1; col >= 1; --col) { gap1 = alignToScore->isGap(seq1, col); gap2 = alignToScore->isGap(seq2, col); if(!gap1 || !gap2) { colEnd = col; break; } } const SeqArray* seqArray = alignToScore->getSeqArray(); int scoreMatch = 0; for(unsigned col = colStart; col <= colEnd; col++) { int res1 = (*seqArray)[seq1][col]; int res2 = (*seqArray)[seq2][col]; scoreMatch = matrix[res1][res2]; scoreLetters += scoreMatch; } return scoreLetters; } float ObjectiveScore::scoreGaps(int seq1, int seq2) { if(!alignToScore) { return 0; } const unsigned numColsSeq1 = alignToScore->getSeqLength(seq1); const unsigned numColsSeq2 = alignToScore->getSeqLength(seq2); if(numColsSeq1 != numColsSeq2) { return 0; // The sequences should be the same length after alignment. } unsigned colStart = 1; bool gap1, gap2; for(unsigned col = 1; col < numColsSeq1; col++) { gap1 = alignToScore->isGap(seq1, col); gap2 = alignToScore->isGap(seq2, col); if(!gap1 || !gap2) { colStart = col; break; } } unsigned colEnd = numColsSeq1; for(unsigned col = numColsSeq1; col >= 1; --col) { gap1 = alignToScore->isGap(seq1, col); gap2 = alignToScore->isGap(seq2, col); if(!gap1 || !gap2) { colEnd = col; break; } } bool inGap1 = false; bool inGap2 = false; float gapOpen = userParameters->getGapOpen(); float gapExtend = userParameters->getGapExtend(); float scoreGaps = 0; for(unsigned col = colStart; col <= colEnd; col++) { gap1 = alignToScore->isGap(seq1, col); gap2 = alignToScore->isGap(seq2, col); if(gap1 && gap2) { continue; } if(gap1) { if(!inGap1) { // NOTE I left out the option of having different end gaps stuff. scoreGaps += gapOpen; inGap1 = true; // Opening a gap in seq1 } else { // Already in a gap scoreGaps += gapExtend; } continue; } else if(gap2) { if(!inGap2) { // NOTE I left out the option of having different end gaps stuff. scoreGaps += gapOpen; inGap2 = true; // Opening a gap in seq2 } else { // Already in a gap scoreGaps += gapExtend; } continue; } inGap1 = inGap2 = false; } return scoreGaps; } void ObjectiveScore::calcNormalisedSeqWeights(const vector* seqWeight, vector* normSeqWeight) { if(!seqWeight || !normSeqWeight) { return; } int sumWeights = 0; for(int i = 0; i < (int)seqWeight->size() - 1; i++) { sumWeights += (*seqWeight)[i]; } normSeqWeight->resize(seqWeight->size()); for(int i = 0; i < (int)seqWeight->size() - 1; i++) { (*normSeqWeight)[i] = static_cast((*seqWeight)[i]) / static_cast(sumWeights); #if DEBUGFULL if(logObject && DEBUGLOG) { ostringstream outs; outs << " normSeqWeight[i] = " << (*normSeqWeight)[i]; logObject->logMsg(outs.str()); } #endif } } } clustalw-2.1/src/alignment/Sequence.h0000644000175000017500000000314111442167172014625 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This class contains the sequence information. It should also contain * the sequence name, and the encoded version. * A vector of Sequences is passed to the Alignment object to set it up. * CHANGES: * Mark 22-1-2007: Added a unique sequence identifier to help with correct output * order of sequences. */ #ifndef SEQUENCE_H #define SEQUENCE_H #include #include #include "../general/userparams.h" #include "../general/utils.h" namespace clustalw { class Sequence { public: /* Functions */ Sequence(std::string& seq, std::string& name, std::string& title); Sequence(std::string& seq, std::string& name, std::string& title, unsigned long id); Sequence(std::vector* encodedSequence, std::string& name, std::string& title, unsigned long id); void encodeSequence(); void printSequence(); std::vector* getSequence(); bool isEmpty(); std::string getName(); std::string getTitle(); bool checkDNAFlag(); unsigned long getIdentifier(){return identifier;} /* Attributes */ private: /* Functions */ void checkIntegrity(); void copyStringIntoVector(std::vector* _vectorTo, std::string* _stringFrom); /* Attributes */ std::vector _sequence; std::vector _encodedSequence; std::string _name; std::string _title; unsigned long identifier; }; } #endif clustalw-2.1/src/alignment/ObjectiveScore.h0000644000175000017500000000233311442167172015765 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This ObjectiveScore class is used to provide an objective function to score * an alignment. * It is used with iteration to improve an alignment. */ #ifndef OBJECTIVESCORE_H #define OBJECTIVESCORE_H #include "../general/clustalw.h" #include "../substitutionMatrix/globalmatrix.h" namespace clustalw { class Alignment; typedef struct { int first; int second; } Pair; class ObjectiveScore { public: ObjectiveScore(); long getScore(const Alignment* alnToScore); private: float scoreLetters(int seq1, int seq2); float scoreGaps(int seq1, int seq2); void calcNormalisedSeqWeights(const vector* seqWeight, vector* normSeqWeight); long score; int matrix[NUMRES][NUMRES]; const Alignment* alignToScore; long scale; int weightScale; int sagaGapEx, sagaGapOp; int gapPos1, gapPos2; static const int BOTHGAPS = 0; static const int NOGAPS = -1; static const int GAPINSEQB = 1; static const int GAPINSEQA = 2; }; } #endif clustalw-2.1/src/alignment/Alignment.cpp0000644000175000017500000015325511444162430015334 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * * 16-02-07,Nigel Brown(EMBL): Added friend NameIterator to allow a caller to * process the name vector. * * 05-03-07,Nigel Brown(EMBL): modified searchForString() to skip over gaps in * sequence while matching. * * 26-03-07,Nigel Brown(EMBL): suppressed error message box for name clashes; * added testUniqueNames() predicate, which compares new sequence names with * those in the alignment vector BEFORE appending them. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "Alignment.h" using namespace std; namespace clustalw { Alignment::Alignment() : gapPos1(userParameters->getGapPos1()), gapPos2(userParameters->getGapPos2()) { maxNames = 0; numSeqs = 0; maxAlignmentLength = 0; lengthLongestSequence = 0; profile1NumSeqs = 0; } // Andreas Wilm (UCD): shouldn't resetProfile1 and resetProfile2 be merged? /** remove gaps from older alignments (code = gap_pos1) */ void Alignment::resetProfile1() { register int sl; /* which have code = gap_pos2 */ int i,j; int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); bool _resetAlignNew = userParameters->getResetAlignmentsNew(); bool _resetAlignAll = userParameters->getResetAlignmentsAll(); if (userParameters->getStructPenalties1() != NONE) { sl = 0; for (j = 0; j < (int)gapPenaltyMask1.size(); ++j) { if (gapPenaltyMask1[j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if (gapPenaltyMask1[j] == _gapPos2 && (_resetAlignAll)) { continue; } gapPenaltyMask1[sl] = gapPenaltyMask1[j]; ++sl; } } if (userParameters->getStructPenalties1() == SECST) { sl = 0; for (j = 0; j < (int)secStructMask1.size(); ++j) { if (secStructMask1[j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if (secStructMask1[j] == _gapPos2 && (_resetAlignAll)) { continue; } secStructMask1[sl] = secStructMask1[j]; ++sl; } } for(i = 1; i <= profile1NumSeqs; ++i) { sl = 0; for(j = 1; j <= getSeqLength(i); ++j) { if(seqArray[i][j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if(seqArray[i][j] == _gapPos2 && (_resetAlignAll)) { continue; } ++sl; seqArray[i][sl] = seqArray[i][j]; } // Andreas Wilm (UCD): added 2008-03-07: // Remove excess bit at end of sequence int numExtraElements = seqArray[i].size() - 1 - sl; for(int k = 0; k < numExtraElements; k++) { seqArray[i].pop_back(); } } } // Andreas Wilm (UCD): shouldn't resetProfile1 and resetProfile2 be merged? void Alignment::resetProfile2() { register int sl; /* which have code = gap_pos2 */ int i, j; int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); bool _resetAlignNew = userParameters->getResetAlignmentsNew(); bool _resetAlignAll = userParameters->getResetAlignmentsAll(); int _profile1NumSeqs = profile1NumSeqs; if (userParameters->getStructPenalties2() != NONE) { sl = 0; for (j = 0; j < (int)gapPenaltyMask2.size(); ++j) { if (gapPenaltyMask2[j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if (gapPenaltyMask2[j] == _gapPos2 && (_resetAlignAll)) { continue; } gapPenaltyMask2[sl] = gapPenaltyMask2[j]; ++sl; } } if (userParameters->getStructPenalties2() == SECST) { sl = 0; for (j = 0; j < (int)secStructMask2.size(); ++j) { if (secStructMask2[j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if (secStructMask2[j] == _gapPos2 && (_resetAlignAll)) { continue; } secStructMask2[sl] = secStructMask2[j]; ++sl; } } for(i = _profile1NumSeqs + 1; i <= numSeqs; ++i) { sl = 0; for(j = 1; j <= getSeqLength(i); ++j) { if(seqArray[i][j] == _gapPos1 && (_resetAlignNew || _resetAlignAll)) { continue; } if(seqArray[i][j] == _gapPos2 && (_resetAlignAll)) { continue; } ++sl; seqArray[i][sl] = seqArray[i][j]; } // Andreas Wilm (UCD) added 2008-03-07: // Remove excess bit at end of sequence int numExtraElements = seqArray[i].size() - 1 - sl; for(int k = 0; k < numExtraElements; k++) { seqArray[i].pop_back(); } } } void Alignment::resetAllSeqWeights() { seqWeight.clear(); seqWeight.resize(numSeqs + 1, 100); } /* * The function addOutputIndex must check that the number of outputindex * Not sure what to do with this one. */ bool Alignment::addOutputIndex(vector* outputIndexToAdd) { // First need to clear the old outputIndex outputIndex.clear(); // Check if the size is correct if((int)outputIndexToAdd->size() == numSeqs) { // Add the output index outputIndex = *outputIndexToAdd; return true; } else { clearAlignment(); return false; // Could not add them } } /* * The function appendOutputIndex is used when we are appending the outputIndex * to the current one. We do this when we are adding a profile2. */ bool Alignment::appendOutputIndex(vector* outputIndexToAppend) { // Check if the size is correct if((int)(outputIndexToAppend->size() + outputIndex.size()) == numSeqs) { // Append the outputIndex vector::iterator outIndexIter = outputIndexToAppend->begin(); while(outIndexIter != outputIndexToAppend->end()) { outputIndex.push_back(*outIndexIter); outIndexIter++; } if((int)outputIndex.size() == numSeqs) { return true; } else { clearAlignment(); cerr << "There is a problem with adding the sequences\n"; return false; } } else { clearAlignment(); return false; } } /* * The function addSequences takes a vector of sequences and adds it to the Alignment. * This is used if there is nothing in memory that we need. * */ void Alignment::addSequences(vector* seqVector) { clearAlignment(); numSeqs = seqVector->size(); vector emptyVec; // NOTE push dummy sequences on first! /******************************************************** * It was decided to stay with the seqs and seqArray * * index begining at 1. This is because it is difficult * * to change in the code, so we push dummy seqs on * ********************************************************/ seqArray.push_back(emptyVec); // EMPTY sequence names.push_back(string("")); titles.push_back(string("")); sequenceIds.push_back(0); addSequencesToVector(seqVector); calculateMaxLengths(); seqWeight.resize(numSeqs + 1, 100); } /* * The function appendSequences is used when we have a profile2. * */ void Alignment::appendSequences(vector* seqVector) { numSeqs += seqVector->size(); // Add to the number we already have! addSequencesToVector(seqVector); seqWeight.clear(); seqWeight.resize(numSeqs + 1, 100); calculateMaxLengths(); } void Alignment::pasteSequencesIntoPosition(vector* seqVector, int pos, bool explicitPasteToProfile2) { SeqArray::iterator seqArrayIterator; vector::iterator namesIterator; vector::iterator titlesIterator; vector::iterator sequenceIdsIterator; int profNum = userParameters->getProfileNum(); int numSeqsToInsert = seqVector->size(); if(numSeqsToInsert == 0 || pos < 0) { return; } if(pos == numSeqs) { seqArrayIterator = seqArray.end(); namesIterator = names.end(); titlesIterator = titles.end(); sequenceIdsIterator = sequenceIds.end(); } else { seqArrayIterator = seqArray.begin() + pos + 1; namesIterator = names.begin() + pos + 1; titlesIterator = titles.begin() + pos + 1; sequenceIdsIterator = sequenceIds.begin() + pos + 1; } int prof1NumSeqs = profile1NumSeqs; for(int i = numSeqsToInsert - 1; i >= 0; i--) { seqArray.insert(seqArrayIterator, *(*seqVector)[i].getSequence()); names.insert(namesIterator, (*seqVector)[i].getName()); titles.insert(titlesIterator, (*seqVector)[i].getTitle()); sequenceIds.insert(sequenceIdsIterator, (*seqVector)[i].getIdentifier()); numSeqs++; if(profNum != 0 && !explicitPasteToProfile2 && pos <= prof1NumSeqs) { prof1NumSeqs++; } } if(profNum != 0 && pos <= prof1NumSeqs) { profile1NumSeqs = prof1NumSeqs; } resetAllSeqWeights(); setDefaultOutputIndex(); } void Alignment::debugPrintAllNames() { vector::iterator nameIter = names.begin(); while(nameIter != names.end()) { cout << *nameIter << endl; nameIter++; } } void Alignment::NameIterator::begin(Alignment *a) { //cout << "begin()\n"; if (a) { alignment = a; i = alignment->names.begin(); } } const string Alignment::NameIterator::next() { //cout << "next()\n"; if (!alignment) return string(); if (i == alignment->names.end()) return string(); return *i++; } bool Alignment::NameIterator::end() { //cout << "end()\n"; if (!alignment) return true; if (i == alignment->names.end()) return true; return false; } // 26-03-03,nige: test before appending seqVector bool Alignment::testUniqueNames(vector* seqVector, string *offendingSeq) { vector::iterator oldName; vector::iterator newName; bool unique = true; //iterate over new candidate names for (newName = seqVector->begin(); unique && newName != seqVector->end(); newName++) { //iterate over old stored names for (oldName = names.begin() + 1; unique && oldName != names.end(); oldName++) { if (*oldName == newName->getName()) { offendingSeq->assign(*oldName); unique = false; } } } return unique; } /* * The function addSequencesToVector is used to add sequences to our seqVector * It is used by both addSequences and appendSequences. This is to reduce code * duplication. */ void Alignment::addSequencesToVector(vector* seqVector) { std::vector::iterator itSeq; for(itSeq = seqVector->begin(); itSeq != seqVector->end(); ++itSeq) { seqArray.push_back(*(*itSeq).getSequence()); names.push_back((*itSeq).getName()); titles.push_back((*itSeq).getTitle()); sequenceIds.push_back((*itSeq).getIdentifier()); } if(!(((int)seqArray.size() == numSeqs + 1) && ((int)names.size() == numSeqs + 1) && ((int)titles.size() == numSeqs + 1) && ((int)sequenceIds.size() == numSeqs + 1))) { cerr << "There has been an error adding the sequences to Alignment.\n" << "Must terminate the program. EaddSequencesrror occured in addSequences.\n"; exit(1); } } void Alignment::clearAlignment() { // Erase all the elements from the vector! clearSeqArray(); names.clear(); titles.clear(); outputIndex.clear(); sequenceIds.clear(); clearSecStruct1(); clearSecStruct2(); seqWeight.clear(); maxNames = 0; numSeqs = 0; maxAlignmentLength = 0; lengthLongestSequence = 0; userParameters->setProfileNum(0); userParameters->setProfile1Empty(true); userParameters->setProfile2Empty(true); } void Alignment::clearSeqArray() { for(int i = 0; i < (int)seqArray.size(); i++) { seqArray[i].clear(); } seqArray.clear(); } void Alignment::clearSecStruct1() { gapPenaltyMask1.clear(); secStructMask1.clear(); secStructName1 = ""; } void Alignment::clearSecStruct2() { gapPenaltyMask2.clear(); secStructMask2.clear(); secStructName2 = ""; } /* * The function alignScore is used to score the alignment! * This is used by other classes to see what score the alignment has gotten. */ int Alignment::alignScore(void) { int maxRes; int seq1, seq2, res1, res2; int ngaps; int i, len1, len2; int score; int _maxAA = userParameters->getMaxAA(); float _gapOpen = userParameters->getGapOpen(); int matrix[NUMRES][NUMRES]; // // calculate an overall score for the alignment by summing the // scores for each pairwise alignment // maxRes = subMatrix->getAlnScoreMatrix(matrix); if (maxRes == 0) { utilityObject->error("Matrix for alignment scoring not found\n"); return 0; } score = 0; for (seq1 = 1; seq1 <= numSeqs; seq1++) { for (seq2 = 1; seq2 < seq1; seq2++) { len1 = seqArray[seq1].size() - 1; len2 = seqArray[seq2].size() - 1; for (i = 1; i < len1 && i < len2; i++) { res1 = seqArray[seq1][i]; res2 = seqArray[seq2][i]; if ((res1 >= 0) && (res1 <= _maxAA) && (res2 >= 0) && (res2 <= _maxAA)) { score += matrix[res1][res2]; } } ngaps = countGaps(seq1, seq2, len1); score = static_cast(score - (100 * _gapOpen * ngaps)); // Mark change 17-5-07 } } score /= 100; utilityObject->info("Alignment Score %d\n", score); return score; } int Alignment::countGaps(int seq1, int seq2, int len) { int i, g; int q, r;//, *Q, *R; vector Q, R; Q.resize(len + 2, 0); R.resize(len + 2, 0); int _maxAA = userParameters->getMaxAA(); try { Q[0] = R[0] = g = 0; for (i = 1; i < len; i++) { if (seqArray[seq1][i] > _maxAA) { q = 1; } else { q = 0; } if (seqArray[seq2][i] > _maxAA) { r = 1; } else { r = 0; } // NOTE I havent a clue what this does!!!! if (((Q[i - 1] <= R[i - 1]) && (q != 0) && (1-r != 0)) || ((Q[i - 1] >= R[i - 1]) && (1-q != 0) && (r != 0))) { g += 1; } if (q != 0) { Q[i] = Q[i - 1] + 1; } else { Q[i] = 0; } if (r != 0) { R[i] = R[i - 1] + 1; } else { R[i] = 0; } } } catch(const exception &ex) { cerr << ex.what() << endl; cerr << "Terminating program. Cannot continue. Function = countGaps\n"; exit(1); } return (g); } void Alignment::resetAlign() { /* remove gaps from older alignments (code = gap_pos1) EXCEPT for gaps that were INPUT with the seqs. which have code = gap_pos2 */ register int sl; int i, j; int _gapPos1 = userParameters->getGapPos1(); int _gapPos2 = userParameters->getGapPos2(); bool _resetAlignNew = userParameters->getResetAlignmentsNew(); bool _resetAlignAll = userParameters->getResetAlignmentsAll(); for(i = 1; i <= numSeqs;++i) { sl = 0; for(j = 1; j <= getSeqLength(i); ++j) { if(seqArray[i][j] == _gapPos1 && ( _resetAlignNew || _resetAlignAll)) { continue; } if(seqArray[i][j] == _gapPos2 && (_resetAlignAll)) { continue; } ++sl; seqArray[i][sl] = seqArray[i][j]; } // Andreas Wilm (UCD) added 2008-03-07: // Remove excess bit at end of sequence int numExtraElements = seqArray[i].size() - 1 - sl; for(int k = 0; k < numExtraElements; k++) { seqArray[i].pop_back(); } } } void Alignment::fixGaps() { int i,j; if (userParameters->getStructPenalties1() != NONE) { for (j = 0; j < getSeqLength(1); ++j) { if (gapPenaltyMask1[j] == userParameters->getGapPos1()) { gapPenaltyMask1[j] = userParameters->getGapPos2(); } } } if (userParameters->getStructPenalties1() == SECST) { for (j = 0; j < getSeqLength(1); ++j) { if (secStructMask1[j] == userParameters->getGapPos1()) { secStructMask1[j] = userParameters->getGapPos2(); } } } for(i = 1; i <= numSeqs; ++i) { for(j = 1; j <= getSeqLength(i); ++j) { if(seqArray[i][j] == userParameters->getGapPos1()) { seqArray[i][j] = userParameters->getGapPos2(); } } } } float Alignment::countid(int s1, int s2) { int c1, c2; int i; int count, total; float score; int shorterSeqLength = (getSeqLength(s1) < getSeqLength(s2)) ? getSeqLength(s1) : getSeqLength(s2); count = total = 0; for (i = 1; i <= shorterSeqLength; i++) // NOTE june29 { c1 = seqArray[s1][i]; c2 = seqArray[s2][i]; if ((c1 >= 0) && (c1 < userParameters->getMaxAA())) { total++; if (c1 == c2) { count++; } } } if (total == 0) { score = 0; } else { score = 100.0 *(float)count / (float)total; } return (score); } void Alignment::debugPrintSequences() { cout << std::endl; for(int i = 0; i < (int)seqArray.size(); i++) { for(int j = 0; j < (int)seqArray[i].size(); j++) { if(seqArray[i][j] > 9) cout << " " << seqArray[i][j]; else cout << " " << seqArray[i][j]; } cout << std::endl; } } /* * Note the max_aln_length is now called maxAlignmentLength, and it will be stored * and calculated in this class. Mostly it is used for allocating arrays. But not always. */ void Alignment::calculateMaxLengths() { maxAlignmentLength = 0; lengthLongestSequence = 0; if(seqArray.size() > 0) { SeqArray::iterator seqArrayIter = seqArray.begin(); while(seqArrayIter != seqArray.end()) { // NOTE I needed to change this to >= for a bug I had!!!!!!! if((int)(*seqArrayIter).size() - 1 >= lengthLongestSequence) { lengthLongestSequence = (*seqArrayIter).size(); } ++seqArrayIter; } if(lengthLongestSequence > 0) { maxAlignmentLength = (lengthLongestSequence * 2) - 2; lengthLongestSequence -= 1; // MADE A CHANGE HERE AS WELL!! } else { lengthLongestSequence = 0; maxAlignmentLength = 0; } } else { maxAlignmentLength = 0; } maxNames = 0; if(names.size() > 0) { vector::iterator nameVecIter = names.begin(); while(nameVecIter != names.end()) { if((int)(*nameVecIter).size() > maxNames) { maxNames = (*nameVecIter).size(); } ++nameVecIter; } if(maxNames < 10) { maxNames = 10; } } else { maxNames = 0; } } /* * This function checks to see if all names are different. It returns true if they * are all different, and false if there are 2 the same. * currently quadratic - would be nice to speed up */ bool Alignment::checkAllNamesDifferent(string *offendingSeq) { bool different = true; // NOTE I added the + 1 here because, if we had a sequence with a name as blank // this would be the same as the first one! vector::iterator namesIter1 = names.begin() + 1; vector::iterator namesIter2; int counter1 = 1; int counter2 = 2; while(namesIter1 != names.end()) { namesIter2 = namesIter1 + 1; while(namesIter2 != names.end()) { if((*namesIter1).compare(*namesIter2) == 0) // If we have 2 strings the same. { different = false; /* 23-03-2007,nige: let someone up the stack deal with this - GUI is too deeply entangled. * utilityObject->error("Multiple sequences found with same name '%s' (first %d chars are significant)\n", namesIter1->c_str(), MAXNAMES); */ offendingSeq->assign((*namesIter1)); clearAlignment(); return different; // Not all different! } namesIter2++; counter2++; } namesIter1++; counter1++; counter2 = counter1 + 1; } return different; } void Alignment::addSecStructMask1(vector* secStructMaskToAdd) { secStructMask1 = *secStructMaskToAdd; } void Alignment::addSecStructMask2(vector* secStructMaskToAdd) { secStructMask2 = *secStructMaskToAdd; } void Alignment::addGapPenaltyMask1(vector* gapPenaltyMaskToAdd) { gapPenaltyMask1 = *gapPenaltyMaskToAdd; } void Alignment::addGapPenaltyMask2(vector* gapPenaltyMaskToAdd) { gapPenaltyMask2 = *gapPenaltyMaskToAdd; } void Alignment::addSecStructName1(string nameToAdd) { secStructName1 = nameToAdd; } void Alignment::addSecStructName2(string nameToAdd) { secStructName2 = nameToAdd; } void Alignment::addSeqWeight(vector* _seqWeight) { if(seqWeight.size() == _seqWeight->size()) { int size = seqWeight.size(); for(int i = 0; i < size; i++) { seqWeight[i] = (*_seqWeight)[i]; } } } void Alignment::printSequencesAddedInfo() { if(userParameters->getDisplayInfo()) { int startSeq = userParameters->getProfile2Empty() ? 1: profile1NumSeqs + 1; string dnaFlag = userParameters->getDNAFlag() ? "bp" : "aa"; for(int i = startSeq; i <= numSeqs; i++) { cout << "Sequence " << i << ": " << std::left << setw(maxNames) << names.at(i) << std::right << setw(6) << getSequenceLength(i) << " " << dnaFlag << std::endl; } } } void Alignment::debugPrintOutAlignInfo() { for(int i = 1; i <= numSeqs; i++) { cout << "seq-no=" << i << ": name=" << std::left << setw(maxNames) << names.at(i) << " length=" << std::right << setw(6) << getSequenceLength(i) << std::endl; } } int Alignment::getSequenceLength(int index) { return seqArray.at(index).size() - 1; } int Alignment::getLengthLongestSequence() { int _lengthLongestSequence = 0; for(int i = 1; i <= numSeqs; i++) { if(getSeqLength(i) > _lengthLongestSequence) { _lengthLongestSequence = getSeqLength(i); } } return _lengthLongestSequence; } /** * This function is used to find the length of the longest sequence in the range. */ int Alignment::getLengthLongestSequence(int firstSeq, int lastSeq) { int _lengthLongestSequence = 0; if(firstSeq >= 1 && lastSeq <= numSeqs) { for(int i = firstSeq; i <= lastSeq; i++) { if(getSeqLength(i) > _lengthLongestSequence) { _lengthLongestSequence = getSeqLength(i); } } } return _lengthLongestSequence; // Will return 0 if cant check seqs } int Alignment::getMaxNames() { return maxNames; } string Alignment::getSecStructName1() { return secStructName1; } string Alignment::getSecStructName2() { return secStructName2; } vector* Alignment::getGapPenaltyMask1() { return &gapPenaltyMask1; } vector* Alignment::getGapPenaltyMask2() { return &gapPenaltyMask2; } vector* Alignment::getSecStructMask1() { return &secStructMask1; } vector* Alignment::getSecStructMask2() { return &secStructMask2; } int Alignment::getSecStructMask1Element(int index) { if(index > 0 && index < (int)secStructMask1.size()) { return secStructMask1[index]; } else { throw VectorOutOfRange(string("secStructMask1"), index, secStructMask1.size() - 1); } } int Alignment::getSecStructMask2Element(int index) { if(index > 0 && index < (int)secStructMask2.size()) { return secStructMask2[index]; } else { throw VectorOutOfRange(string("secStructMask2"), index, secStructMask2.size() - 1); } } int Alignment::getGapPenaltyMask1Element(int index) { if(index > 0 && index < (int)gapPenaltyMask1.size()) { return gapPenaltyMask1[index]; } else { throw VectorOutOfRange(string("gapPenaltyMask1"), index, gapPenaltyMask1.size() - 1); } } int Alignment::getGapPenaltyMask2Element(int index) { if(index > 0 && index < (int)gapPenaltyMask2.size()) { return gapPenaltyMask2[index]; } else { throw VectorOutOfRange(string("gapPenaltyMask2"), index, gapPenaltyMask2.size() - 1); } } string Alignment::getName(int index) { if(index > 0 && index < (int)names.size()) { return names[index]; } else { throw VectorOutOfRange(string("names"), index, names.size() - 1); } } /** * Change: * Mark 25-1-2007: This function was added to allow access to the unique id. */ unsigned long Alignment::getUniqueId(int seq) { if(seq > 0 && seq < (int)sequenceIds.size()) { return sequenceIds[seq]; } else { throw VectorOutOfRange(string("sequenceIds"), seq, sequenceIds.size() - 1); } } string Alignment::getTitle(int index) { if(index > 0 && index < (int)titles.size()) { return titles[index]; } else { throw VectorOutOfRange(string("titles"), index, titles.size() - 1); } } int Alignment::getOutputIndex(int index) { if(index >= 0 && index < (int)outputIndex.size()) { return outputIndex[index]; } else { throw VectorOutOfRange(string("outputIndex"), index, outputIndex.size() - 1); } } int Alignment::getSeqWeight(int index) const { if(index >= 0 && index < (int)seqWeight.size()) { return seqWeight[index]; } else { throw VectorOutOfRange(string("seqWeight"), index, seqWeight.size() - 1); } } /** * This function is used by Qt. It is used to calculate the histogram values for the * widget in clustalQt. The function is in here because it needs access to the SubMatrix * class. * @param matNum The number of the matrix to be used in the comparison. * @return A pointer to a vector containing the histogram values. */ vector* Alignment::QTcalcHistColumnHeights(int firstSeq, int nSeqs, Array2D* exceptionalRes) { int n, i, s, p, r, r1; int numColumns = getLengthLongestSequence(); int scoreScale = userParameters->getQTScorePlotScale();//5; // From ClustalX. int scoreCutOff = userParameters->getQTResExceptionCutOff(); bool includeGaps = false; //short *mat_xref, *matptr; float median, mean; float t, q1, q3, ul; vector seqdist, sorteddist; float diff; vector seqvector; vector freq; vector > profile; int matrix[NUMRES][NUMRES]; int _maxAA = userParameters->getMaxAA(); int _gapPos1 = userParameters->getGapPos1(); histogramColumnHeights.resize(numColumns); //panel_data data1; subMatrix->getQTMatrixForHistogram(matrix); profile.resize(numColumns + 2, vector(_maxAA + 2)); freq.resize(_maxAA + 2); for(p = 0; p < numColumns; p++) { for(r = 0; r < _maxAA; r++) { freq[r] = 0; } for(s = firstSeq; s < firstSeq + nSeqs; s++) { if(p < getSeqLength(s + 1) && seqArray[s + 1][p + 1] >= 0 && seqArray[s + 1][p + 1] < _maxAA) { freq[seqArray[s + 1][p + 1]]++; } } for(r = 0; r < _maxAA; r++) { profile[p][r] = 0; for(r1 = 0; r1 < _maxAA; r1++) { profile[p][r] += freq[r1] * matrix[r1][r]; } profile[p][r] = static_cast(profile[p][r] / static_cast(nSeqs)); // Mark change 17-5-07 } } seqvector.resize(_maxAA + 2); seqdist.resize(nSeqs + 1); sorteddist.resize(nSeqs + 1); for(p = 0; p < numColumns; p++) { for(s = firstSeq; s < firstSeq + nSeqs; s++) { if (p < getSeqLength(s + 1)) { for (r = 0; r < _maxAA; r++) { seqvector[r] = matrix[r][seqArray[s + 1][p + 1]]; } } else { for (r = 0; r < _maxAA; r++) { seqvector[r] = matrix[r][_gapPos1]; } } seqdist[s - firstSeq] = 0.0; for(r = 0; r < _maxAA; r++) { diff = profile[p][r] - seqvector[r]; diff /= 1000.0; seqdist[s - firstSeq] += diff * diff; } seqdist[s - firstSeq] = sqrt((double)seqdist[s - firstSeq]); } // calculate mean,median and rms of seq distances mean = median = 0.0; if(includeGaps) { for(s = 0; s < nSeqs; s++) { mean += seqdist[s]; } mean /= nSeqs; n = nSeqs; for(s = 0; s < nSeqs; s++) { sorteddist[s] = seqdist[s]; } } else { n = 0; for(s = firstSeq; s < firstSeq + nSeqs; s++) { if(p < getSeqLength(s + 1) && seqArray[s + 1][p + 1] >= 0 && seqArray[s + 1][p + 1] < _maxAA) { mean += seqdist[s - firstSeq]; n++; } } if(n > 0) { mean /= n; } for(s = firstSeq, i = 0; s < firstSeq + nSeqs; s++) { if(p < getSeqLength(s + 1) && seqArray[s + 1][p + 1] >= 0 && seqArray[s + 1][p + 1] < _maxAA) { sorteddist[i++] = seqdist[s - firstSeq]; } } } sortScores(&sorteddist, 0, n - 1); if(n == 0) { median = 0; } else if(n % 2 == 0) { median = (sorteddist[n / 2 - 1] + sorteddist[n / 2]) / 2.0; } else { median = sorteddist[n / 2]; } if(scoreScale <= 5) { histogramColumnHeights[p] = static_cast(exp((double)(-mean * (6 - scoreScale) / 4.0)) * 100.0 * n / nSeqs); } else { histogramColumnHeights[p] = static_cast(exp((double)(-mean / (4.0 * (scoreScale - 4)))) * 100.0 * n / nSeqs); } if(n == 0) { ul = 0; } else { t = n/4.0 + 0.5; if(t - (int)t == 0.5) { q3 = (sorteddist[(int)t] + sorteddist[(int)t + 1]) / 2.0; q1 = (sorteddist[n-(int)t] + sorteddist[n - (int)t - 1]) / 2.0; } else if(t - (int)t > 0.5) { q3 = sorteddist[(int)t + 1]; q1 = sorteddist[n - (int)t - 1]; } else { q3 = sorteddist[(int)t]; q1 = sorteddist[n - (int)t]; } if (n < 4) { ul = sorteddist[0]; } else { ul = q3 + (q3 - q1) * ((float)scoreCutOff / 2.0); } } if((exceptionalRes->getRowSize() >= nSeqs) && exceptionalRes->getColSize() >= numColumns) { for(int s = firstSeq; s < firstSeq + nSeqs; s++) { if(seqdist[s - firstSeq] > ul && p < getSeqLength(s + 1) && seqArray[s + 1][p + 1] >= 0 && seqArray[s + 1][p + 1] < userParameters->getMaxAA()) { (*exceptionalRes)[s - firstSeq][p] = 1; } else { (*exceptionalRes)[s - firstSeq][p] = 0; } } } } return &histogramColumnHeights; } void Alignment::sortScores(vector* scores, int f, int l) { int i,last; if(f >= l) return; swap(scores, f, (f + l) / 2); last = f; for(i = f + 1; i <= l; i++) { if((*scores)[i] > (*scores)[f]) { swap(scores, ++last, i); } } swap(scores, f, last); sortScores(scores, f, last - 1); sortScores(scores, last + 1, l); } void Alignment::swap(vector* scores, int s1, int s2) { float temp; temp = (*scores)[s1]; (*scores)[s1] = (*scores)[s2]; (*scores)[s2] = temp; } int Alignment::searchForString(bool* found, int seq, int beginRes, string search) { int lengthSeq = getSeqLength(seq); if(beginRes > lengthSeq) { *found = false; return beginRes; } int res = beginRes; // First need to convert search into a vector of ints! vector codedSearch; int size = search.size(); codedSearch.resize(size); int code; for(int i = 0; i < size; i++) { code = userParameters->resIndex(userParameters->getAminoAcidCodes(), search[i]); codedSearch[i] = code; } int numSame = 0; int startPos = -1; int searchSize = codedSearch.size(); // Now check for the string of ints!!!! for(; res <= lengthSeq; res++) //- nige: res starts at 1 { if(seqArray[seq][res] == codedSearch[0]) { startPos = res; //- nige for(int i = 0; i < searchSize && (i + res) <= lengthSeq; i++) //- nige: res starts at 1 { if(seqArray[seq][res + i] == codedSearch[i]) { numSame++; } //nige: hack: encoded gap character: see also AlignmentScroll.cpp else if (seqArray[seq][res + i] == 31 || seqArray[seq][res + i] == 30) { res++; i--; } else { break; // Not the same } } if(numSame == searchSize) { *found = true; return startPos; } else { numSame = 0; } } } *found = false; return startPos; // Not found!!!!!!! } void Alignment::removeGapsFromSelectedSeqs(vector* selected) { //getNumSeqs() int size = selected->size(); int lengthOfSelectedSeq = 0; int gapPos1 = userParameters->getGapPos1(); int gapPos2 = userParameters->getGapPos2(); int s1; for(int i = 1; i <= getNumSeqs() && i < size; i++) { if((*selected)[i] == 1) { // remove gaps from this seq! lengthOfSelectedSeq = getSeqLength(i); s1 = 0; for(int j = 1; j <= lengthOfSelectedSeq; j++) { if(seqArray[i][j] == gapPos1 || seqArray[i][j] == gapPos2) { continue; } ++s1; seqArray[i][s1] = seqArray[i][j]; } // Then remove the excess bit at the end of the array int numExtraElements = lengthOfSelectedSeq - s1; if((int)seqArray[i].size() > numExtraElements) { for(int k = 0; k < numExtraElements; k++) { seqArray[i].pop_back(); } } } } } void Alignment::removeGapOnlyColsFromSelectedSeqs(vector* selected) { int numGaps = 0; int NoneSelected = -1; int numColumns = 0; int sizeSelected = selected->size(); int firstSeqSelected = NoneSelected; int gapPos1 = userParameters->getGapPos1(); int gapPos2 = userParameters->getGapPos2(); int k; for(int i = 1; i < sizeSelected; i++) { if((*selected)[i] == 1) { numColumns++; if(firstSeqSelected == -1) { firstSeqSelected = i; } } } if(firstSeqSelected == NoneSelected) { cout << "No Sequences have been selected\n"; return; } for(int i = 1; i <= getSeqLength(firstSeqSelected);) { numGaps = 0; for(int j = firstSeqSelected; j < sizeSelected && (*selected)[j] == 1; j++) { if(getSeqLength(j) >= i) { if(seqArray[j][i] == gapPos1 || seqArray[j][i] == gapPos2) { numGaps++; } } } if(numGaps == numColumns) { //cout << " removing a gap column\n\n"; for(int j = firstSeqSelected; j < sizeSelected && (*selected)[j] == 1; j++) { for(k = i + 1; k <= getSeqLength(j) + 1 && (int)seqArray[j].size() > k; k++) { seqArray[j][k - 1] = seqArray[j][k]; } seqArray[j].pop_back(); // Remove the last element!! if(getSeqLength(firstSeqSelected) <= 0) { break; } } } else { i++; } } } void Alignment::removeAllGapOnlyColumns(int fSeq, int lSeq, int profileNum) { if(fSeq >= lSeq) { return; } int gapPos1 = userParameters->getGapPos1(); int gapPos2 = userParameters->getGapPos2(); int numGaps = 0; int numColumns = lSeq - fSeq + 1; int k; // We must cheack each column to see if it consists of only '-' for(int i = 1; i <= getSeqLength(fSeq);) { numGaps = 0; for(int j = fSeq; j <= lSeq; j++) { if(getSeqLength(j) >= i) { if(seqArray[j][i] == gapPos1 || seqArray[j][i] == gapPos2) { numGaps++; } } } if(numGaps == numColumns) { for(int j = fSeq; j <= lSeq; j++) { for(k = i + 1; k <= getSeqLength(j) + 1; k++) { seqArray[j][k - 1] = seqArray[j][k]; } seqArray[j].pop_back(); // Remove the last element!! if(profileNum == 1) { int lengthSecStruct = secStructMask1.size(); int lengthGapMask = gapPenaltyMask1.size(); for(k = i; k <= getSeqLength(fSeq) && k < lengthSecStruct; k++) { secStructMask1[k - 1] = secStructMask1[k]; } for(k = i; k <= getSeqLength(fSeq) && k < lengthGapMask; k++) { gapPenaltyMask1[k - 1] = gapPenaltyMask1[k]; } } if(profileNum == 2) { int lengthSecStruct = secStructMask2.size(); int lengthGapMask = gapPenaltyMask2.size(); for(k = i; k <= getSeqLength(fSeq) && k < lengthSecStruct; k++) { secStructMask2[k - 1] = secStructMask2[k]; } for(k = i; k <= getSeqLength(fSeq) && k < lengthGapMask; k++) { gapPenaltyMask2[k - 1] = gapPenaltyMask2[k]; } } if(getSeqLength(fSeq) <= 0) { break; } } } else { i++; } } } vector Alignment::cutSelectedSequencesFromAlignment(vector* selected) { vector cutSequences; int sizeOfSelected = selected->size(); SeqArray::iterator seqArrayIterator; vector::iterator namesIterator; vector::iterator titlesIterator; vector::iterator seqWeightIterator; vector::iterator sequenceIdsIterator; int newProfile1NumSeqs = profile1NumSeqs; int profNum = userParameters->getProfileNum(); int prof1NumSeqs = profile1NumSeqs; int numCutSoFar = 0; int intialNumSeqs = numSeqs; for(int i = 1; i < sizeOfSelected && i <= intialNumSeqs; i++) { if((*selected)[i] == 1) { // Cut the sequence from the alignment! seqArrayIterator = seqArray.begin() + i - numCutSoFar; namesIterator = names.begin() + i - numCutSoFar; titlesIterator = titles.begin() + i - numCutSoFar; seqWeightIterator = seqWeight.begin() + i - numCutSoFar; sequenceIdsIterator = sequenceIds.begin() + i - numCutSoFar; Sequence SeqToCut(&seqArray[i - numCutSoFar], *namesIterator, *titlesIterator, *sequenceIdsIterator); numCutSoFar++; seqArrayIterator->clear(); seqArray.erase(seqArrayIterator); names.erase(namesIterator); titles.erase(titlesIterator); seqWeight.erase(seqWeightIterator); sequenceIds.erase(sequenceIdsIterator); if(numSeqs > 0) { numSeqs--; } else { numSeqs = 0; break; } if(profNum > 0 && i <= prof1NumSeqs) { if(newProfile1NumSeqs > 0) { newProfile1NumSeqs--; } else { newProfile1NumSeqs = 0; } } cutSequences.push_back(SeqToCut); } } profile1NumSeqs = newProfile1NumSeqs; setDefaultOutputIndex(); resetAllSeqWeights(); return cutSequences; } void Alignment::setDefaultOutputIndex() { outputIndex.clear(); outputIndex.resize(numSeqs); for(int iseq = 1; iseq <= numSeqs; iseq++) { outputIndex[iseq - 1] = iseq; } } bool Alignment::removeAllOutsideRange(int beginPos, int endPos) { bool ok; if(beginPos < 0 || endPos > getLengthLongestSequence()) { return false; // cannot do it!!!! } // trim the seqArray ok = keepPortionOfSeqArray(beginPos, endPos); if(!ok) { cerr << "There was a problem removing a portion of the array\n"; return false; } // recalculate the maxLengths calculateMaxLengths(); // Clear the histogram columns histogramColumnHeights.clear(); // reset the weights resetAllSeqWeights(); return true; } bool Alignment::keepPortionOfSeqArray(int beginRangeIndex, int endRangeIndex) { SeqArray sectionToRealign; vector emptyVec; sectionToRealign.push_back(emptyVec); // EMPTY sequence SeqArray::iterator posToAddTo = sectionToRealign.begin(); // erase from all sequences the range specified here!!!!! if(beginRangeIndex < 0 || endRangeIndex < 0) { return false; } SeqArray::iterator mainBeginIt = seqArray.begin() + 1; SeqArray::iterator mainEndIt = seqArray.end(); vector::iterator begin, end, beginRange, endRange, beginCopyRange, endCopyRange; for(; mainBeginIt != mainEndIt; mainBeginIt++) { vector vecToAdd; begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); beginRange = begin + beginRangeIndex; endRange = begin + endRangeIndex + 1; beginCopyRange = beginRange; endCopyRange = endRange; // We need to copy all of this into another vector. if(endCopyRange < end && beginCopyRange < end) { vecToAdd.push_back(0); for(; beginCopyRange != endCopyRange; beginCopyRange++) { vecToAdd.push_back(*beginCopyRange); } sectionToRealign.push_back(vecToAdd); } else { return false; } if(endRange < end && beginRange < end) { mainBeginIt->erase(beginRange, endRange); } else { return false; } } clearSeqArray(); seqArray = sectionToRealign; return true; } void Alignment::debugPrintSeqArray(SeqArray* arrayToPrint) { // I need to use iterators for everything here. SeqArray::iterator mainBeginIt = arrayToPrint->begin(); SeqArray::iterator mainEndIt = arrayToPrint->end(); vector::iterator begin, end; string aaCodes = userParameters->getAminoAcidCodes(); for(; mainBeginIt != mainEndIt; mainBeginIt++) { if(mainBeginIt->size() > 0) { begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); for(; begin != end; begin++) { if(*begin < (int)aaCodes.size()) { cout << aaCodes[*begin]; } else { cout << "-"; } } cout << "\n"; } } } void Alignment::debugPrintProfile1() { cout << "************** PROFILE1 *********************\n"; SeqArray::iterator mainBeginIt = seqArray.begin() + 1; SeqArray::iterator mainEndIt = mainBeginIt + profile1NumSeqs; vector::iterator begin, end; string aaCodes = userParameters->getAminoAcidCodes(); for(; mainBeginIt != mainEndIt; mainBeginIt++) { cout << "PROFILE1 SEQ: "; if(mainBeginIt->size() > 0) { begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); for(; begin != end; begin++) { if(*begin < (int)aaCodes.size()) { cout << aaCodes[*begin]; } else { cout << "-"; } } cout << "\n"; } } } void Alignment::debugPrintProfile2() { cout << "************** PROFILE2 *********************\n"; SeqArray::iterator mainBeginIt = seqArray.begin() + 1 + profile1NumSeqs; SeqArray::iterator mainEndIt = seqArray.end(); vector::iterator begin, end; string aaCodes = userParameters->getAminoAcidCodes(); for(; mainBeginIt != mainEndIt; mainBeginIt++) { cout << "PROFILE2 SEQ: "; if(mainBeginIt->size() > 0) { begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); for(; begin != end; begin++) { if(*begin < (int)aaCodes.size()) { cout << aaCodes[*begin]; } else { cout << "-"; } } cout << "\n"; } } } bool Alignment::updateRealignedRange(SeqArray realignedSeqs, int beginPos, int endPos) { if(realignedSeqs.size() != seqArray.size()) { return false; } if(beginPos < 0 || endPos < 0) { return false; } // erase from all sequences the range specified here!!!!! SeqArray::iterator mainBeginIt = seqArray.begin() + 1; SeqArray::iterator mainEndIt = seqArray.end(); SeqArray::iterator pasteBeginIt = realignedSeqs.begin() + 1; SeqArray::iterator pasteEndIt = realignedSeqs.end(); vector::iterator begin, end, beginRange, endRange; for(; mainBeginIt != mainEndIt && pasteBeginIt != pasteEndIt; mainBeginIt++) { vector vecToAdd; begin = mainBeginIt->begin() + 1; end = mainBeginIt->end(); beginRange = begin + beginPos; endRange = begin + endPos + 1; if(endRange < end && beginRange < end) { mainBeginIt->erase(beginRange, endRange); mainBeginIt->insert(beginRange, pasteBeginIt->begin() + 1, pasteBeginIt->end()); } else { return false; } pasteBeginIt++; } return true; } bool Alignment::reloadAlignment() { if(getNumSeqs() <= 0) { return false; } if(userParameters->getOutputOrder() == INPUT) { return true; } if((int)outputIndex.size() != getNumSeqs()) { outputIndex.clear(); return false; } vector emptyVec; string emptyString = ""; SeqArray outputOrderSeqArray; outputOrderSeqArray.resize(getNumSeqs() + 1); outputOrderSeqArray[0] = emptyVec; vector outputOrderNames; outputOrderNames.resize(getNumSeqs() + 1); outputOrderNames[0] = emptyString; vector outputOrderTitles; outputOrderTitles.resize(getNumSeqs() + 1); outputOrderTitles[0] = emptyString; vector outputOrderSequenceIds; outputOrderSequenceIds.resize(getNumSeqs() + 1); outputOrderSequenceIds[0] = 0; int size = seqArray.size(); if((seqArray.size() != names.size()) || (seqArray.size() != titles.size()) || sequenceIds.size() != names.size()) { return false; } int _outIndex; // Now for each seq, for(int i = 1; i < size; i++) { if(i < (int)outputOrderSeqArray.size() && i - 1 < (int)outputIndex.size() && outputIndex[i - 1] < size) { _outIndex = outputIndex[i - 1]; outputOrderSeqArray[i] = seqArray[_outIndex]; outputOrderNames[i] = names[_outIndex]; outputOrderTitles[i] = titles[_outIndex]; outputOrderSequenceIds[i] = sequenceIds[_outIndex]; } else { return false; } } // Now we have a copy in the correct order. // Remove all the elements from the old ones and set them to be these arrays clearSeqArray(); seqArray = outputOrderSeqArray; names.clear(); names = outputOrderNames; titles.clear(); titles = outputOrderTitles; sequenceIds.clear(); sequenceIds = outputOrderSequenceIds; return true; } const vector* Alignment::getSequenceFromUniqueId(unsigned long id) { for(int i = 0; i < (int)sequenceIds.size(); i++) { if(sequenceIds[i] == id) { return getSequence(i); } } // We have not found it, throw an exception!!! throw SequenceNotFoundException(); } /** * Change: * Mark 26-1-2007: This function was added to allow access to the unique id. */ void Alignment::updateSequence(int index, const vector* seq) { if(index >= 1 && index < (int)seqArray.size()) { seqArray[index] = *seq; } } /** * Change: * Mark 17-2-2007: This function was added to check if a res is a gap or not. */ bool Alignment::isGap(int seq, int col) const { int res = seqArray[seq][col]; if(res == gapPos1 || res == gapPos2) { return true; } else { return false; } } /** * This function will be used so that we can create an alignment object from a seqArray. * This will be used for the tree iteration. */ void Alignment::addSequences(SeqArray* seqVector) { clearAlignment(); numSeqs = seqVector->size() - 1; vector emptyVec; seqArray.push_back(emptyVec); // EMPTY sequence names.push_back(string("")); titles.push_back(string("")); sequenceIds.push_back(0); cout << "\nThere are " << numSeqs << " in the alignment obj\n"; for(int i = 1; i <= numSeqs; i++) { ostringstream name; seqArray.push_back((*seqVector)[i]); titles.push_back(string("")); sequenceIds.push_back(utilityObject->getUniqueSequenceIdentifier()); name << "name" << numSeqs; names.push_back(name.str()); } calculateMaxLengths(); seqWeight.resize(numSeqs + 1, 100); } } clustalw-2.1/src/alignment/AlignmentOutput.h0000644000175000017500000000577411442167172016232 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /* * The class AlignmentOutput is used to output the Alignment in all the different * formats that have been selected. It will output all the different file types if * these have been selected from the menu or the commandline. * To use this class we must call openAlignmentOutput first. Then we call the function * createAlignmentOutput with an Alignment to be output and the first and last sequence * to be output as well. */ #ifndef ALIGNMENTOUTPUT_H #define ALIGNMENTOUTPUT_H #include #include #include #include #include #include #include #include "Alignment.h" namespace clustalw { typedef struct rangeNum { int start; int end; } rangeNum; typedef struct outputRegion { int _firstSeq; int _lastSeq; int _firstRes; int _lastRes; } outputRegion; class AlignmentOutput { public: /* Functions */ AlignmentOutput(); bool openAlignmentOutput(string path); bool QTOpenFilesForOutput(AlignmentFileNames fileNames); void createAlignmentOutput(Alignment* alignPtr, int firstSeq, int lastSeq); void printSecStructMask(int prfLength, vector* mask, vector* structMask); /* Attributes */ private: /* Functions */ void fastaOut(Alignment* alignPtr, outputRegion partToOutput); void clustalOut(Alignment* alignPtr, outputRegion partToOutput); void gcgOut(Alignment* alignPtr, outputRegion partToOutput); void nexusOut(Alignment* alignPtr, outputRegion partToOutput); void phylipOut(Alignment* alignPtr, outputRegion partToOutput); void nbrfOut(Alignment* alignPtr, outputRegion partToOutput); void gdeOut(Alignment* alignPtr, outputRegion partToOutput); string nameonly(string s); void findRangeValues(Alignment* alignPtr, rangeNum *rnum, int firstRes, int lastRes, int firstSeq); bool openExplicitFile(auto_ptr& outFile, string fileName); string openOutputFile(auto_ptr& outFile, string prompt, string path, string fileExtension); int SeqGCGCheckSum(vector* sequence, int length); void showAlign(); /* Attributes */ auto_ptr clustalOutFile; auto_ptr gcgOutFile; auto_ptr nbrfOutFile; auto_ptr phylipOutFile; auto_ptr gdeOutFile; auto_ptr nexusOutFile; auto_ptr fastaOutFile; string clustalOutName; string gcgOutName; string phylipOutName; string nbrfOutName; string gdeOutName; string nexusOutName; string fastaOutName; vector strongGroup; vector weakGroup; int clusSecStructOffset; int clusSequenceOffset; }; } #endif clustalw-2.1/src/alignment/Alignment.h0000644000175000017500000002051511442167172014777 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * The Alignment class is used to store the alignment that is being constructed. * It also contains other information such as gap penalty masks etc. * An object of this type will be passed by reference to the FileReader. This FileReader * and the FileParsers will then set it up properly from the information given in the file. * I have decided to put everything into vectors, string etc. No more array*'s, gets rid * of the memory allocation problem. * * CHANGE: * Mark Jan 16th 2007. I have changed the pasteSequencesIntoPosition function to allow * explicit pastes into profile2. * Mark 25-1-2007. I have changed the class so that each of the sequences have a unique * identifier. Several functions were changed to allow this. * * 16-02-07,Nigel Brown(EMBL): Added friend NameIterator to allow a caller to * process the name vector. * * 23-03-07,Nigel Brown(EMBL): added testUniqueNames() predicate, which * compares new sequence names with those in the alignment vector BEFORE * appending them. */ // NOTE NOTE NOTE Very important! The list of sequences begins from 1 to numSeqs. // This is because of the fact that the code was written in Fortran where arrays begin at // 1. It has become difficult to change this. Ramu has tried before and had problems // so we decided to leave it this way. #ifndef ALIGNMENT_H #define ALIGNMENT_H #include #include #include #include #include #include "Sequence.h" #include "../substitutionMatrix/globalmatrix.h" #include "../general/userparams.h" #include "../general/VectorOutOfRange.h" #include "../general/SequenceNotFoundException.h" // FIXME because this object is used for aligned and unaligned // sequences it would be nice to have a isAligned flag here (AW) using namespace std; namespace clustalw { typedef std::vector > SeqArray; class Alignment { public: /* Functions */ Alignment(); void addSequences(vector* seqVector); void addSequences(SeqArray* seqVector); void appendSequences(vector* seqVector); vector cutSelectedSequencesFromAlignment(vector* selected); void pasteSequencesIntoPosition(vector* seqVector, int pos, bool explicitPasteToProfile2 = false); void resizeSeqArray(int size){seqArray.resize(size); numSeqs = size - 1; outputIndex.resize(size - 1); names.resize(size); titles.resize(size);}; bool addOutputIndex(vector* outputIndexToAdd); bool appendOutputIndex(vector* outputIndexToAppend); void addSecStructMask1(vector* secStructMaskToAdd); void addSecStructMask2(vector* secStructMaskToAdd); void addSeqWeight(vector* _seqWeight); void addGapPenaltyMask1(vector* gapPenaltyMaskToAdd); void addGapPenaltyMask2(vector* gapPenaltyMaskToAdd); vector* getSecStructMask1(); vector* getSecStructMask2(); const vector* getOutputIndex(); vector* getGapPenaltyMask1(); vector* getGapPenaltyMask2(); void addSecStructName1(string nameToAdd); void addSecStructName2(string nameToAdd); int alignScore(void); int countGaps(int s1, int s2, int l); void resetAlign(); void fixGaps(); float countid(int s1, int s2); const vector* getSequence(int index){return &seqArray[index];}; // For Pairwise! const vector* getSequence(int index) const {return &seqArray[index];}; const vector* getSequenceFromUniqueId(unsigned long id); // For iteration const SeqArray* getSeqArray() const {return &seqArray;}; // For multiple align! SeqArray* getSeqArrayForRealloc(){return &seqArray;}; void updateSequence(int index, const vector* seq); bool checkAllNamesDifferent(string *offendingSeq); bool testUniqueNames(vector* seqVector, string *offendingSeq); void clearAlignment(); void clearSecStruct1(); void clearSecStruct2(); void printSequencesAddedInfo(); string getSecStructName1(); string getSecStructName2(); int getNumSeqs() const {return numSeqs;}; int getMaxNames(); int getMaxAlnLength(){return maxAlignmentLength;}; void setMaxAlnLength(int len){maxAlignmentLength = len;}; int getLengthLongestSequence(); int getLengthLongestSequence(int firstSeq, int lastSeq); int getSeqLength(int index) const {return seqArray[index].size() - 1;}; int getSecStructMask1Element(int index); int getSecStructMask2Element(int index); int getGapPenaltyMask1Element(int index); int getGapPenaltyMask2Element(int index); int getOutputIndex(int index); int getSeqWeight(int index) const; const vector* getSeqWeights() const{return &seqWeight;} string getName(int index); string getTitle(int index); vector* QTcalcHistColumnHeights(int firstSeq, int nSeqs, Array2D* exceptionalRes); // NOTE July 13, for Qt // NOTE the following functions are to be used when we are doing a profile // alignment. It resets the gaps from fixed. void resetProfile1(); void resetProfile2(); void resetAllSeqWeights(); int searchForString(bool* found, int seq, int beginRes, string search); void removeGapsFromSelectedSeqs(vector* selected); void removeGapOnlyColsFromSelectedSeqs(vector* selected); void removeAllGapOnlyColumns(int fSeq, int lSeq, int profileNum); void setDefaultOutputIndex(); bool removeAllOutsideRange(int beginPos, int endPos); bool updateRealignedRange(SeqArray realignedSeqs, int beginPos, int endPos); bool reloadAlignment(); int getProfile1NumSeqs(){return profile1NumSeqs;}; void setProfile1NumSeqs(int value){profile1NumSeqs = value;} bool isGap(int seq, int col) const; void calculateMaxLengths(); /** * The following functions are for the iteration output order. */ unsigned long getUniqueId(int seq); void debugPrintArray(){debugPrintSeqArray(&seqArray);} void debugPrintSeqArray(SeqArray* arrayToPrint); void debugPrintProfile1(); void debugPrintProfile2(); void debugPrintOutAlignInfo(); void debugPrintAllNames(); void debugPrintSequences(); /* Attributes */ /* Friends */ class NameIterator; friend class NameIterator; class NameIterator { private: Alignment *alignment; vector::iterator i; public: void begin(Alignment *alignment); const string next(); bool end(); }; private: /* Functions */ void addSequencesToVector(vector* seqVector); int getSequenceLength(int index); void sortScores(vector* scores, int f, int l); void swap(vector* scores, int s1, int s2); bool keepPortionOfSeqArray(int beginRangeIndex, int endRangeIndex); void clearSeqArray(); /* Attributes */ int maxNames; int maxAlignmentLength; int lengthLongestSequence; int numSeqs; vector outputIndex; vector sequenceIds; // Mark change: To help with output order vector seqWeight; SeqArray seqArray; vector names; vector titles; vector gapPenaltyMask1; vector gapPenaltyMask2; vector secStructMask1; vector secStructMask2; string secStructName1; string secStructName2; vector histogramColumnHeights; // NOTE July 13, for Qt int profile1NumSeqs; int gapPos1, gapPos2; }; } #endif clustalw-2.1/src/alignment/Sequence.cpp0000644000175000017500000001104411442167172015161 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "Sequence.h" using namespace std; namespace clustalw { /** * * @param seq * @param name * @param title * @return */ Sequence::Sequence(string& seq, string& name, string& title) { copyStringIntoVector(&_sequence, &seq); encodeSequence(); _name = name; _title = title; identifier = utilityObject->getUniqueSequenceIdentifier(); } Sequence::Sequence(std::string& seq, std::string& name, std::string& title, unsigned long id) { copyStringIntoVector(&_sequence, &seq); encodeSequence(); _name = name; _title = title; identifier = id; } /** * This is an overloaded contructor that is used to construct a seq object from an * encoded sequenced instead of a string. * @param encodedSequence * @param name * @param title * @param id The unique identifier from the previous sequence!!! * @return */ Sequence::Sequence(std::vector* encodedSequence, std::string& name, std::string& title, unsigned long id) { _encodedSequence = *encodedSequence; _name = name; _title = title; identifier = id; } /** * */ void Sequence::encodeSequence() { /* code seq as ints .. use gapPos2 for gap */ std::vector::iterator it; _encodedSequence.push_back(0); for(it = _sequence.begin(); it != _sequence.end(); ++it) { if (*it == '-') { _encodedSequence.push_back(userParameters->getGapPos2()); } else { _encodedSequence.push_back(userParameters->resIndex( userParameters->getAminoAcidCodes(), *it)); } } } /** * * @param _vectorTo * @param _stringFrom */ void Sequence::copyStringIntoVector(vector* _vectorTo, string* _stringFrom) { _vectorTo->clear(); for(int i = 0; i < (int)_stringFrom->size(); i++) { _vectorTo->push_back(_stringFrom->at(i)); } if(_vectorTo->size() != _stringFrom->size()) { std::cerr << "Error: In function copyStringIntoVector. Strings different length!\n"; exit(1); } } /** * */ void Sequence::printSequence() { std::cout << "This is the sequence and the encoded sequence " << _name << std::endl; std::vector::iterator itChar; for(itChar = _sequence.begin(); itChar != _sequence.end(); ++itChar) { cout << *itChar; } cout << std::endl; std::vector::iterator itInt; for(itInt = _encodedSequence.begin(); itInt != _encodedSequence.end(); ++itInt) { cout << " " << *itInt; } cout << std::endl; } /** * */ void Sequence::checkIntegrity() { // The sequences should be the same length. if(_sequence.size() != _encodedSequence.size()) { std::cerr << "Error: _sequence is not same size as _encodedSequence\n"; exit(1); } } /** * * @return the encoded sequence, this is what is used in the pairwise! */ std::vector* Sequence::getSequence() { return &_encodedSequence; } /** * * @return */ std::string Sequence::getName() { return _name; } /** * * @return */ std::string Sequence::getTitle() { return _title; } /** * * @return */ bool Sequence::isEmpty() { if(_sequence.size() == 0) { return true; } else { return false; } } /** * * @return */ bool Sequence::checkDNAFlag() // check if DNA or Protein // The decision is based on counting all A,C,G,T,U or N. // If >= 85% of all characters (except -) are as above => DNA { int c, numResidues, numBases; float ratio; string dna_codes = "ACGTUN"; numResidues = numBases = 0; vector::iterator seqIterator = _sequence.begin(); while (seqIterator != _sequence.end()) { if (*seqIterator != '-') { numResidues++; if (*seqIterator == 'N') { numBases++; } else { c = userParameters->resIndex(dna_codes, *seqIterator); if (c >= 0) { numBases++; } } } seqIterator++; } if ((numBases == 0) || (numResidues == 0)) { return false; } ratio = (float)numBases / (float)numResidues; if (ratio >= 0.85) { return true; } else { return false; } } } clustalw-2.1/src/pairwise/0000755000175000017500000000000011467270447012641 500000000000000clustalw-2.1/src/pairwise/FullPairwiseAlign.cpp0000644000175000017500000003461511442167171016647 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "FullPairwiseAlign.h" #include namespace clustalw { FullPairwiseAlign::FullPairwiseAlign() : _maxAlnLength(0), intScale(0), mmScore(0), printPtr(0), lastPrint(0), _gapOpen(0), _gapExtend(0), seq1(0), seq2(0), maxScore(0), sb1(0), sb2(0), se1(0), se2(0) { } void FullPairwiseAlign::pairwiseAlign(Alignment *alignPtr, DistMatrix *distMat, int iStart, int iEnd, int jStart, int jEnd) { int si, sj, i; int n, m, len1, len2; int maxRes; int _matAvgScore; int res; double _score; float gapOpenScale, gapExtendScale; try { if(distMat->getSize() != alignPtr->getNumSeqs() + 1) { cerr << "The distance matrix is not the right size!\n" << "Need to terminate program.\n"; exit(1); } if((iStart < 0) || (iEnd < iStart) || (jStart < 0) || (jEnd < jStart)) { cerr << "The range for pairwise Alignment is incorrect.\n" << "Need to terminate program.\n"; exit(1); } _maxAlnLength = alignPtr->getMaxAlnLength(); int _numSeqs = alignPtr->getNumSeqs(); if(_numSeqs == 0) { return; } int num = (2 * _maxAlnLength) + 1; bool _DNAFlag = userParameters->getDNAFlag(); float _pwGapOpen, _pwGapExtend; _pwGapOpen = userParameters->getPWGapOpen(); _pwGapExtend = userParameters->getPWGapExtend(); displ.resize(num); HH.resize(_maxAlnLength); DD.resize(_maxAlnLength); RR.resize(_maxAlnLength); SS.resize(_maxAlnLength); // Note these 2 lines replace the stuff above because it is all done in the SubMatrix PairScaleValues scaleValues; maxRes = subMatrix->getPairwiseMatrix(matrix, scaleValues, _matAvgScore); if (maxRes == 0) { cerr << "Could not get the substitution matrix\n"; return; } intScale = scaleValues.intScale; gapOpenScale = scaleValues.gapOpenScale; gapExtendScale = scaleValues.gapExtendScale; int _gapPos1, _gapPos2; _gapPos1 = userParameters->getGapPos1(); _gapPos2 = userParameters->getGapPos2(); const SeqArray* _ptrToSeqArray = alignPtr->getSeqArray(); //This is faster! for (si = utilityObject->MAX(0, iStart); si < _numSeqs && si < iEnd; si++) { n = alignPtr->getSeqLength(si + 1); len1 = 0; for (i = 1; i <= n; i++) { res = (*_ptrToSeqArray)[si + 1][i]; if ((res != _gapPos1) && (res != _gapPos2)) { len1++; } } for (sj = utilityObject->MAX(si+1, jStart+1); sj < _numSeqs && sj < jEnd; sj++) { m = alignPtr->getSeqLength(sj + 1); if (n == 0 || m == 0) { distMat->SetAt(si + 1, sj + 1, 1.0); distMat->SetAt(sj + 1, si + 1, 1.0); continue; } len2 = 0; for (i = 1; i <= m; i++) { res = (*_ptrToSeqArray)[sj + 1][i]; if ((res != _gapPos1) && (res != _gapPos2)) { len2++; } } if (_DNAFlag) { _gapOpen = static_cast(2 * _pwGapOpen * intScale * gapOpenScale); _gapExtend = static_cast(_pwGapExtend * intScale * gapExtendScale); } else { if (_matAvgScore <= 0) { _gapOpen = 2 * static_cast((_pwGapOpen + log(static_cast(utilityObject->MIN(n, m)))) * intScale); } else { _gapOpen = static_cast(2 * _matAvgScore * (_pwGapOpen + log(static_cast(utilityObject->MIN(n, m)))) * gapOpenScale); } _gapExtend = static_cast(_pwGapExtend * intScale); } // align the sequences seq1 = si + 1; seq2 = sj + 1; _ptrToSeq1 = alignPtr->getSequence(seq1); _ptrToSeq2 = alignPtr->getSequence(seq2); forwardPass(_ptrToSeq1, _ptrToSeq2, n, m); reversePass(_ptrToSeq1, _ptrToSeq2); lastPrint = 0; printPtr = 1; // use Myers and Miller to align two sequences maxScore = diff(sb1 - 1, sb2 - 1, se1 - sb1 + 1, se2 - sb2 + 1, (int)0, (int)0); // calculate percentage residue identity mmScore = tracePath(sb1, sb2); if (len1 == 0 || len2 == 0) { mmScore = 0; } else { mmScore /= (float)utilityObject->MIN(len1, len2); } _score = ((float)100.0 - mmScore) / (float)100.0; distMat->SetAt(si + 1, sj + 1, _score); distMat->SetAt(sj + 1, si + 1, _score); if(userParameters->getDisplayInfo()) { utilityObject->info("Sequences (%d:%d) Aligned. Score: %d", si+1, sj+1, (int)mmScore); } } } displ.clear(); HH.clear(); DD.clear(); RR.clear(); SS.clear(); } catch(const exception& e) { cerr << "An exception has occured in the FullPairwiseAlign class.\n" << e.what() << "\n"; exit(1); } } void FullPairwiseAlign::add(int v) { if (lastPrint < 0) { displ[printPtr - 1] = v; displ[printPtr++] = lastPrint; } else { lastPrint = displ[printPtr++] = v; } } inline int FullPairwiseAlign::calcScore(int iat, int jat, int v1, int v2) { return matrix[(*_ptrToSeq1)[v1 + iat]][(*_ptrToSeq2)[v2 + jat]]; } float FullPairwiseAlign::tracePath(int tsb1, int tsb2) { int res1, res2; int i1, i2; int i, k, pos, toDo; int count; float score; toDo = printPtr - 1; i1 = tsb1; i2 = tsb2; pos = 0; count = 0; for (i = 1; i <= toDo; ++i) { if (displ[i] == 0) { res1 = (*_ptrToSeq1)[i1]; res2 = (*_ptrToSeq2)[i2]; if ((res1 != userParameters->getGapPos1()) && (res2 != userParameters->getGapPos2()) && (res1 == res2)) { count++; } ++i1; ++i2; ++pos; } else { if ((k = displ[i]) > 0) { i2 += k; pos += k; } else { i1 -= k; pos -= k; } } } score = 100.0 *(float)count; return (score); } void FullPairwiseAlign::forwardPass(const vector* seq1, const vector* seq2, int n, int m) { int i, j; int f, hh, p, t; maxScore = 0; se1 = se2 = 0; for (i = 0; i <= m; i++) { HH[i] = 0; DD[i] = -_gapOpen; } for (i = 1; i <= n; i++) { hh = p = 0; f = -_gapOpen; for (j = 1; j <= m; j++) { f -= _gapExtend; t = hh - _gapOpen - _gapExtend; if (f < t) { f = t; } DD[j] -= _gapExtend; t = HH[j] - _gapOpen - _gapExtend; if (DD[j] < t) { DD[j] = t; } hh = p + matrix[(*seq1)[i]][(*seq2)[j]]; if (hh < f) { hh = f; } if (hh < DD[j]) { hh = DD[j]; } if (hh < 0) { hh = 0; } p = HH[j]; HH[j] = hh; if (hh > maxScore) { maxScore = hh; se1 = i; se2 = j; } } } } void FullPairwiseAlign::reversePass(const vector* seq1, const vector* seq2) { int i, j; int f, hh, p, t; int cost; cost = 0; sb1 = sb2 = 1; for (i = se2; i > 0; i--) { HH[i] = - 1; DD[i] = - 1; } for (i = se1; i > 0; i--) { hh = f = - 1; if (i == se1) { p = 0; } else { p = - 1; } for (j = se2; j > 0; j--) { f -= _gapExtend; t = hh - _gapOpen - _gapExtend; if (f < t) { f = t; } DD[j] -= _gapExtend; t = HH[j] - _gapOpen - _gapExtend; if (DD[j] < t) { DD[j] = t; } hh = p + matrix[(*seq1)[i]][(*seq2)[j]]; if (hh < f) { hh = f; } if (hh < DD[j]) { hh = DD[j]; } p = HH[j]; HH[j] = hh; if (hh > cost) { cost = hh; sb1 = i; sb2 = j; if (cost >= maxScore) { break; } } } if (cost >= maxScore) { break; } } } int FullPairwiseAlign::diff(int A, int B, int M, int N, int tb, int te) { int type; int midi, midj, i, j; int midh; static int f, hh, e, s, t; if (N <= 0) { if (M > 0) { del(M); } return ( -(int)tbgap(M, tb)); } if (M <= 1) { if (M <= 0) { add(N); return ( -(int)tbgap(N, tb)); } midh = - (tb + _gapExtend) - tegap(N, te); hh = - (te + _gapExtend) - tbgap(N, tb); if (hh > midh) { midh = hh; } midj = 0; for (j = 1; j <= N; j++) { hh = calcScore(1, j, A, B) - tegap(N - j, te) - tbgap(j - 1, tb); if (hh > midh) { midh = hh; midj = j; } } if (midj == 0) { del(1); add(N); } else { if (midj > 1) { add(midj - 1); } displ[printPtr++] = lastPrint = 0; if (midj < N) { add(N - midj); } } return midh; } // Divide: Find optimum midpoint (midi,midj) of cost midh midi = M / 2; HH[0] = 0; t = - tb; for (j = 1; j <= N; j++) { HH[j] = t = t - _gapExtend; DD[j] = t - _gapOpen; } t = - tb; for (i = 1; i <= midi; i++) { s = HH[0]; HH[0] = hh = t = t - _gapExtend; f = t - _gapOpen; for (j = 1; j <= N; j++) { if ((hh = hh - _gapOpen - _gapExtend) > (f = f - _gapExtend)) { f = hh; } if ((hh = HH[j] - _gapOpen - _gapExtend) > (e = DD[j] - _gapExtend)) { e = hh; } hh = s + calcScore(i, j, A, B); if (f > hh) { hh = f; } if (e > hh) { hh = e; } s = HH[j]; HH[j] = hh; DD[j] = e; } } DD[0] = HH[0]; RR[N] = 0; t = - te; for (j = N - 1; j >= 0; j--) { RR[j] = t = t - _gapExtend; SS[j] = t - _gapOpen; } t = - te; for (i = M - 1; i >= midi; i--) { s = RR[N]; RR[N] = hh = t = t - _gapExtend; f = t - _gapOpen; for (j = N - 1; j >= 0; j--) { if ((hh = hh - _gapOpen - _gapExtend) > (f = f - _gapExtend)) { f = hh; } if ((hh = RR[j] - _gapOpen - _gapExtend) > (e = SS[j] - _gapExtend)) { e = hh; } hh = s + calcScore(i + 1, j + 1, A, B); if (f > hh) { hh = f; } if (e > hh) { hh = e; } s = RR[j]; RR[j] = hh; SS[j] = e; } } SS[N] = RR[N]; midh = HH[0] + RR[0]; midj = 0; type = 1; for (j = 0; j <= N; j++) { hh = HH[j] + RR[j]; if (hh >= midh) if (hh > midh || (HH[j] != DD[j] && RR[j] == SS[j])) { midh = hh; midj = j; } } for (j = N; j >= 0; j--) { hh = DD[j] + SS[j] + _gapOpen; if (hh > midh) { midh = hh; midj = j; type = 2; } } // Conquer recursively around midpoint if (type == 1) { // Type 1 gaps diff(A, B, midi, midj, tb, _gapOpen); diff(A + midi, B + midj, M - midi, N - midj, _gapOpen, te); } else { diff(A, B, midi - 1, midj, tb, 0); del(2); diff(A + midi + 1, B + midj, M - midi - 1, N - midj, 0, te); } return midh; // Return the score of the best alignment } void FullPairwiseAlign::del(int k) { if (lastPrint < 0) { lastPrint = displ[printPtr - 1] -= k; } else { lastPrint = displ[printPtr++] = - (k); } } int FullPairwiseAlign::gap(int k) { if(k <= 0) { return 0; } else { return _gapOpen + _gapExtend * k; } } int FullPairwiseAlign::tbgap(int k, int tb) { if(k <= 0) { return 0; } else { return tb + _gapExtend * k; } } int FullPairwiseAlign::tegap(int k, int te) { if(k <= 0) { return 0; } else { return te + _gapExtend * k; } } } clustalw-2.1/src/pairwise/PairwiseAlignBase.h0000644000175000017500000000112711442167171016254 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef PAIRWISEALIGNBASE_H #define PAIRWISEALIGNBASE_H #include #include "../alignment/Alignment.h" namespace clustalw { class PairwiseAlignBase { public: virtual ~PairwiseAlignBase(){}; /* Functions */ virtual void pairwiseAlign(Alignment *alignPtr, DistMatrix *distMat, int iStart, int iEnd, int jStart, int jEnd) = 0; /* Attributes */ private: /* Functions */ /* Attributes */ }; } #endif clustalw-2.1/src/pairwise/FastPairwiseAlign.h0000644000175000017500000000271511442167171016303 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef FASTPAIRWISEALIGN_H #define FASTPAIRWISEALIGN_H #include "PairwiseAlignBase.h" namespace clustalw { class FastPairwiseAlign : public PairwiseAlignBase { public: /* Functions */ FastPairwiseAlign(); virtual ~FastPairwiseAlign(){}; virtual void pairwiseAlign(Alignment *alignPtr, DistMatrix *distMat, int iStart, int iEnd, int jStart, int jEnd); /* Attributes */ private: /* Functions */ void pairAlign(const vector* seq, int l1, int l2); void makePPtrs(vector& tptr, vector& pl, const vector* seq, int length); void makeNPtrs(vector& tptr, vector& pl, const vector* seq, int length); void putFrag(int fs, int v1, int v2, int flen); int fragRelPos(int a1, int b1, int a2, int b2); void desQuickSort(vector& array1, vector& array2, int arraySize); /* Attributes */ vector displ; vector zza; vector zzb; vector zzc; vector zzd; int next; int currFrag; int maxSoFar; int vatend; Array2D accum; vector diagIndex; vector slopes; int _maxAlnLength; }; } #endif clustalw-2.1/src/pairwise/FastPairwiseAlign.cpp0000644000175000017500000004137311442167171016641 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "FastPairwiseAlign.h" namespace clustalw { FastPairwiseAlign::FastPairwiseAlign() { _maxAlnLength = 0; } void FastPairwiseAlign::pairwiseAlign(Alignment *alignPtr, DistMatrix *distMat, int iStart, int iEnd, int jStart, int jEnd) { try { if(distMat->getSize() != alignPtr->getNumSeqs() + 1) { cerr << "The distance matrix is not the right size!\n" << "Need to terminate program.\n"; exit(1); } if((iStart < 0) || (iEnd < iStart) || (jStart < 0) || (jEnd < jStart)) { cout << "The range for pairwise Alignment is incorrect.\n" << "Need to terminate program.\n"; exit(1); } int i, j, dsr; double calcScore; bool _DNAFlag = userParameters->getDNAFlag(); _maxAlnLength = alignPtr->getMaxAlnLength(); int num = (2 * _maxAlnLength) + 1; accum.ResizeRect(5, num); displ.resize(num); slopes.resize(num); diagIndex.resize(num); zza.resize(_maxAlnLength + 1); zzb.resize(_maxAlnLength + 1); zzc.resize(_maxAlnLength + 1); zzd.resize(_maxAlnLength + 1); if (_DNAFlag) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } cout << "\n\n"; for (i = iStart + 1; i <= iEnd; ++i) { const vector* _seqIPtr = alignPtr->getSequence(i); int _seqILength = alignPtr->getSeqLength(i); if (_DNAFlag) { makeNPtrs(zza, zzc, _seqIPtr, _seqILength); } else { makePPtrs(zza, zzc, _seqIPtr, _seqILength); } double _score; for (j = jStart + 2 > i+1 ? jStart + 2 : i+1; j <= jEnd; ++j) { const vector* _seqJPtr = alignPtr->getSequence(j); int _seqJLength = alignPtr->getSeqLength(j); if (_DNAFlag) { makeNPtrs(zzb, zzd, _seqJPtr, _seqJLength); } else { makePPtrs(zzb, zzd, _seqJPtr, _seqJLength); } pairAlign(_seqIPtr, _seqILength, _seqJLength); if (!maxSoFar) { calcScore = 0.0; } else { calcScore = (double)accum[0][maxSoFar]; if (userParameters->getPercent()) { dsr = (_seqILength < _seqJLength) ? _seqILength : _seqJLength; calcScore = (calcScore / (double)dsr) *100.0; } } _score = (100.0 - calcScore) / 100.0; distMat->SetAt(i, j, _score); //distMat->SetAt(j, i, _score); /* distMat symmetric, FS, 2009-04-06 */ if(userParameters->getDisplayInfo()) { if (calcScore > 0.1) { utilityObject->info("Sequences (%d:%d) Aligned. Score: %lg", i, j, calcScore); } else { utilityObject->info("Sequences (%d:%d) Not Aligned", i, j); } } } } accum.clearArray(); displ.clear(); slopes.clear(); diagIndex.clear(); zza.clear(); zzb.clear(); zzc.clear(); zzd.clear(); } catch(const exception& e) { cerr << "An exception has occured in the FastPairwiseAlign class.\n" << e.what() << "\n"; exit(1); } } /* * Note: There is a problem with the treatment of DNA/RNA. * During file reading all residues are encoded as AminoAcids, * even before it has been established if they are AA or not. * This is bad and will have to be changed (later). * 'A' is assigned code 0, C is assigned 2, G = 6, T=18, U=19. * However, the fast alignment routines require that * A=0, C=1, G=2, T=U=3. In the best case the results of the * fast alignment (of DNA) will simply be meaningless, the * worst case is a core dump. * As a quick fix I implemented the following mask, that * (for DNA/RNA) translates 0->0, 2->1, 6->2, 18->3, 19->3. * This is awfull (it is not OO compliant) but it was quick, * uses (much) less memory than a second DNA array, and is * (much) faster than calling a translation function. * Ideally this will be removed, but this requires changes * to (i) the sequence encoding during file-reading AND * (ii) all the DNA substitution matrices. (Fabian, 2009-02-25) * * A B C D E F G H I K L M 0 N P Q R S * T U W X Y Z (goodmeasuregoodmeasuregood) */ int ziAA2DNA[] = {0,-1, 1,-1,-1,-1, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 3, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; const int ciMaxResID = 3; void FastPairwiseAlign::pairAlign(const vector* seq, int l1, int l2) { int pot[8], i, j, l, m, limit, pos, tl1, vn1, vn2, flen, osptr, fs; int tv1, tv2, encrypt, subt1, subt2, rmndr; bool flag; int residue; bool _DNAFlag = userParameters->getDNAFlag(); int _ktup = userParameters->getKtup(); int _maxAA = userParameters->getMaxAA(); int _windowGap = userParameters->getWindowGap(); int _window = userParameters->getWindow(); int _signif = userParameters->getSignif(); if (_DNAFlag) { for (i = 1; i <= _ktup; ++i) { pot[i] = (int)pow((double)4, (double)(i - 1)); } limit = (int)pow((double)4, (double)_ktup); } else { for (i = 1; i <= _ktup; i++) { pot[i] = (int)pow((double)(_maxAA + 1), (double)(i - 1)); } limit = (int)pow((double)(_maxAA + 1), (double)_ktup); } tl1 = (l1 + l2) - 1; for (i = 1; i <= tl1; ++i) { slopes[i] = displ[i] = 0; diagIndex[i] = i; } // increment diagonal score for each k_tuple match for (i = 1; i <= limit; ++i) { vn1 = zzc[i]; while (true) { if (!vn1) { break; } vn2 = zzd[i]; while (vn2 != 0) { osptr = vn1 - vn2 + l2; ++displ[osptr]; vn2 = zzb[vn2]; } vn1 = zza[vn1]; } } // choose the top SIGNIF diagonals desQuickSort(displ, diagIndex, tl1); j = tl1 - _signif + 1; if (j < 1) { j = 1; } // flag all diagonals within WINDOW of a top diagonal for (i = tl1; i >= j; i--) if (displ[i] > 0) { pos = diagIndex[i]; l = (1 > pos - _window) ? 1 : pos - _window; m = (tl1 < pos + _window) ? tl1 : pos + _window; for (; l <= m; l++) { slopes[l] = 1; } } for (i = 1; i <= tl1; i++) { displ[i] = 0; } currFrag = maxSoFar = 0; for (i = 1; i <= (l1 - _ktup + 1); ++i) { encrypt = flag = 0; if (_DNAFlag){ for (j = 1; j <= _ktup; ++j) { residue = ziAA2DNA[(*seq)[i + j - 1]]; if ((residue < 0) || (residue > ciMaxResID)) { flag = true; break; } encrypt += ((residue) * pot[j]); } } else { for (j = 1; j <= _ktup; ++j) { residue = (*seq)[i + j - 1]; if ((residue < 0) || (residue > _maxAA)) { flag = true; break; } encrypt += ((residue) * pot[j]); } } if (flag) { continue; } ++encrypt; vn2 = zzd[encrypt]; flag = false; while (true) { if (!vn2) { flag = true; break; } osptr = i - vn2 + l2; if (slopes[osptr] != 1) { vn2 = zzb[vn2]; continue; } flen = 0; fs = _ktup; next = maxSoFar; // A-loop while (true) { if (!next) { ++currFrag; if (currFrag >= 2 * _maxAlnLength) { utilityObject->info("(Partial alignment)"); vatend = 1; return ; } displ[osptr] = currFrag; putFrag(fs, i, vn2, flen); } else { tv1 = accum[1][next]; tv2 = accum[2][next]; if (fragRelPos(i, vn2, tv1, tv2)) { if (i - vn2 == accum[1][next] - accum[2][next]) { if (i > accum[1][next] + (_ktup - 1)) { fs = accum[0][next] + _ktup; } else { rmndr = i - accum[1][next]; fs = accum[0][next] + rmndr; } flen = next; next = 0; continue; } else { if (displ[osptr] == 0) { subt1 = _ktup; } else { if (i > accum[1][displ[osptr]] + (_ktup - 1)) { subt1 = accum[0][displ[osptr]] + _ktup; } else { rmndr = i - accum[1][displ[osptr]]; subt1 = accum[0][displ[osptr]] + rmndr; } } subt2 = accum[0][next] - _windowGap + _ktup; if (subt2 > subt1) { flen = next; fs = subt2; } else { flen = displ[osptr]; fs = subt1; } next = 0; continue; } } else { next = accum[4][next]; continue; } } break; } // End of Aloop vn2 = zzb[vn2]; } } vatend = 0; } void FastPairwiseAlign::makePPtrs(vector& tptr, vector& pl, const vector* seq, int length) { int a[10]; int i, j, limit, code; bool flag; int residue; int _ktup = userParameters->getKtup(); int _maxAA = userParameters->getMaxAA(); for (i = 1; i <= _ktup; i++) { a[i] = (int)pow((double)(_maxAA + 1), (double)(i - 1)); } limit = (int)pow((double)(_maxAA + 1), (double)_ktup); if(limit >= (int)pl.size()) { pl.resize(limit + 1); } if(length >= (int)tptr.size()) { tptr.resize(length + 1); } for (i = 1; i <= limit; ++i) { pl[i] = 0; } for (i = 1; i <= length; ++i) // NOTE changed this { tptr[i] = 0; } for (i = 1; i <= (length - _ktup + 1); ++i) { code = 0; flag = false; for (j = 1; j <= _ktup; ++j) { residue = (*seq)[i + j - 1]; if ((residue < 0) || (residue > _maxAA)) { flag = true; break; } code += ((residue) * a[j]); } if (flag) { continue; } ++code; if (pl[code] != 0) { tptr[i] = pl[code]; } pl[code] = i; //Ktuple code is at position i in sequence } } void FastPairwiseAlign::makeNPtrs(vector& tptr,vector& pl, const vector* seq, int length) { int pot[] = { 0, 1, 4, 16, 64, 256, 1024, 4096 }; int i, j, limit, code; bool flag; int residue; int _ktup = userParameters->getKtup(); limit = (int)pow((double)4, (double)_ktup); if(limit >= (int)pl.size()) { pl.resize(limit + 1); } if(length >= (int)tptr.size()) { tptr.resize(length + 1); } for (i = 1; i <= limit; ++i) { pl[i] = 0; } for (i = 1; i <= length; ++i) { tptr[i] = 0; } for (i = 1; i <= length - _ktup + 1; ++i) { code = 0; flag = false; for (j = 1; j <= _ktup; ++j) { residue = ziAA2DNA[(*seq)[i + j - 1]]; if ((residue < 0) || (residue > ciMaxResID)) { flag = true; break; } code += ((residue) * pot[j]); } if (flag) { continue; } ++code; if (pl[code] != 0) { tptr[i] = pl[code]; } pl[code] = i; } } void FastPairwiseAlign::putFrag(int fs, int v1, int v2, int flen) { int end; accum[0][currFrag] = fs; accum[1][currFrag] = v1; accum[2][currFrag] = v2; accum[3][currFrag] = flen; if (!maxSoFar) { maxSoFar = 1; accum[4][currFrag] = 0; return ; } if (fs >= accum[0][maxSoFar]) { accum[4][currFrag] = maxSoFar; maxSoFar = currFrag; return ; } else { next = maxSoFar; while (true) { end = next; next = accum[4][next]; if (fs >= accum[0][next]) { break; } } accum[4][currFrag] = next; accum[4][end] = currFrag; } } inline int FastPairwiseAlign::fragRelPos(int a1, int b1, int a2, int b2) { int ret; int _ktup = userParameters->getKtup(); ret = false; if (a1 - b1 == a2 - b2) { if (a2 < a1) { ret = true; } } else { if (a2 + _ktup - 1 < a1 && b2 + _ktup - 1 < b1) { ret = true; } } return ret; } void FastPairwiseAlign::desQuickSort(vector& array1, vector& array2, int arraySize) { // Quicksort routine, adapted from chapter 4, page 115 of software tools // by Kernighan and Plauger, (1986) // Sort the elements of array1 and sort the // elements of array2 accordingly int temp1, temp2; int p, pivlin; int i, j; int lst[50], ust[50]; // the maximum no. of elements must be // < log(base2) of 50 lst[1] = 1; ust[1] = arraySize - 1; p = 1; while (p > 0) { if (lst[p] >= ust[p]) { p--; } else { i = lst[p] - 1; j = ust[p]; pivlin = array1[j]; while (i < j) { for (i = i + 1; array1[i] < pivlin; i++) ; for (j = j - 1; j > i; j--) if (array1[j] <= pivlin) { break; } if (i < j) { temp1 = array1[i]; array1[i] = array1[j]; array1[j] = temp1; temp2 = array2[i]; array2[i] = array2[j]; array2[j] = temp2; } } j = ust[p]; temp1 = array1[i]; array1[i] = array1[j]; array1[j] = temp1; temp2 = array2[i]; array2[i] = array2[j]; array2[j] = temp2; if (i - lst[p] < ust[p] - i) { lst[p + 1] = lst[p]; ust[p + 1] = i - 1; lst[p] = i + 1; } else { lst[p + 1] = i + 1; ust[p + 1] = ust[p]; ust[p] = i - 1; } p = p + 1; } } return ; } } clustalw-2.1/src/pairwise/FullPairwiseAlign.h0000644000175000017500000000341111442167171016302 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef FULLPAIRWISEALIGN_H #define FULLPAIRWISEALIGN_H #include "PairwiseAlignBase.h" namespace clustalw { class FullPairwiseAlign : public PairwiseAlignBase { public: /* Functions */ FullPairwiseAlign(); virtual ~FullPairwiseAlign(){}; virtual void pairwiseAlign(Alignment *alignPtr, DistMatrix *distMat, int iStart, int iEnd, int jStart, int jEnd); /* Attributes */ private: /* Functions */ void add(int v); int calcScore(int iat, int jat, int v1, int v2); float tracePath(int tsb1, int tsb2); void forwardPass(const vector* seq1, const vector* seq2, int n, int m); void reversePass(const vector* ia, const vector* ib); int diff(int A, int B, int M, int N, int tb, int te); void del(int k); int gap(int k); int tbgap(int k, int tb); int tegap(int k, int te); /* Attributes */ // I have constant pointers to the data. This allows for the fastest access. const vector* _ptrToSeq1; const vector* _ptrToSeq2; int _maxAlnLength; int intScale; float mmScore; int printPtr; int lastPrint; vector displ; vector HH; vector DD; vector RR; vector SS; int _gapOpen; // scaled to be an integer, this is not a mistake int _gapExtend; // scaled to be an integer, not a mistake int seq1; int seq2; int matrix[NUMRES][NUMRES]; int maxScore; int sb1; int sb2; int se1; int se2; }; } #endif clustalw-2.1/src/interface/0000755000175000017500000000000011467270447012756 500000000000000clustalw-2.1/src/interface/InteractiveMenu.cpp0000644000175000017500000012540111442167171016477 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Mark Larkin Dec 12 2005. * This provides the implementation of the interactive menu functions. * Changes: * 15-5-07: Added changes to clustering algorithm choice in function phylogenticTreeMenu * Added iteration to the multipleAlignMenu function. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "InteractiveMenu.h" namespace clustalw { using namespace std; InteractiveMenu::InteractiveMenu() { try { clustalObj = new Clustal(); lin1 = ""; secStructOutputTxt[0] = string("Secondary Structure"); secStructOutputTxt[1] = string("Gap Penalty Mask"); secStructOutputTxt[2] = string("Structure and Penalty Mask"); secStructOutputTxt[3] = string("None"); } catch(bad_alloc) { cerr<<"The memory heap is exhausted. The program must terminate now\n"; exit(1); } /* Initialise the menu structs */ matrixMenu.noptions = 5; strcpy(matrixMenu.opt[AABLOSUM].title, "BLOSUM series"); strcpy(matrixMenu.opt[AABLOSUM].string, "blosum"); strcpy(matrixMenu.opt[AAPAM].title, "PAM series"); strcpy(matrixMenu.opt[AAPAM].string, "pam"); strcpy(matrixMenu.opt[AAGONNET].title, "Gonnet series"); strcpy(matrixMenu.opt[AAGONNET].string, "gonnet"); strcpy(matrixMenu.opt[AAIDENTITY].title, "Identity matrix"); strcpy(matrixMenu.opt[AAIDENTITY].string, "id"); strcpy(matrixMenu.opt[AAUSERDEFINED].title, "User defined"); strcpy(matrixMenu.opt[AAUSERDEFINED].string, ""); dnaMatrixMenu.noptions = 3; strcpy(dnaMatrixMenu.opt[DNAIUB].title, "IUB"); strcpy(dnaMatrixMenu.opt[DNAIUB].string, "iub"); strcpy(dnaMatrixMenu.opt[DNACLUSTALW].title, "CLUSTALW(1.6)"); strcpy(dnaMatrixMenu.opt[DNACLUSTALW].string, "clustalw"); strcpy(dnaMatrixMenu.opt[DNAUSERDEFINED].title, "User defined"); strcpy(dnaMatrixMenu.opt[DNAUSERDEFINED].string, ""); pwMatrixMenu.noptions = 5; strcpy(pwMatrixMenu.opt[PWAABLOSUM].title, "BLOSUM 30"); strcpy(pwMatrixMenu.opt[PWAABLOSUM].string, "blosum"); strcpy(pwMatrixMenu.opt[PWAAPAM].title, "PAM 350"); strcpy(pwMatrixMenu.opt[PWAAPAM].string, "pam"); strcpy(pwMatrixMenu.opt[PWAAGONNET].title, "Gonnet 250"); strcpy(pwMatrixMenu.opt[PWAAGONNET].string, "gonnet"); strcpy(pwMatrixMenu.opt[PWAAIDENTITY].title, "Identity matrix"); strcpy(pwMatrixMenu.opt[PWAAIDENTITY].string, "id"); strcpy(pwMatrixMenu.opt[PWAAUSER].title, "User defined"); strcpy(pwMatrixMenu.opt[PWAAUSER].string, ""); } InteractiveMenu::~InteractiveMenu() { delete clustalObj; } void InteractiveMenu::mainMenu() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<" **************************************************************\n"; cout<<" ******** CLUSTAL " << userParameters->getRevisionLevel() <<" Multiple Sequence Alignments ********\n"; cout<<" **************************************************************\n"; cout<<"\n\n"; cout<<" 1. Sequence Input From Disc\n"; cout<<" 2. Multiple Alignments\n"; cout<<" 3. Profile / Structure Alignments\n"; cout<<" 4. Phylogenetic trees\n\n"; cout<<" S. Execute a system command\n"; cout<<" H. HELP\n"; cout<<" X. EXIT (leave program)\n\n\n"; choice = utilityObject->getChoice(string("Your choice")); string offendingSeq; // unused here switch (toupper(choice)) { case '1': clustalObj->sequenceInput(false, &offendingSeq); break; case '2': multipleAlignMenu(); break; case '3': profileAlignMenu(); break; case '4': phylogeneticTreeMenu(); break; case 'S': doSystem(); break; case '?': case 'H': clustalObj->getHelp('1'); break; case 'Q': case 'X': exit(0); break; default: cout<<"\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::multipleAlignMenu() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<"****** MULTIPLE ALIGNMENT MENU ******\n\n\n"; cout<<" 1. Do complete multiple alignment now " <<(!userParameters->getQuickPairAlign() ? "Slow/Accurate" : "Fast/Approximate") <<"\n"; cout<<" 2. Produce guide tree file only\n"; cout<<" 3. Do alignment using old guide tree file\n\n"; cout<<" 4. Toggle Slow/Fast pairwise alignments = " <<((!userParameters->getQuickPairAlign()) ? "SLOW" : "FAST") <<"\n\n"; cout<<" 5. Pairwise alignment parameters\n"; cout<<" 6. Multiple alignment parameters\n\n"; cout<<" 7. Reset gaps before alignment?"; if (userParameters->getResetAlignmentsNew()) { cout<<" = ON\n"; } else { cout<<" = OFF\n"; } cout<<" 8. Toggle screen display = " <<((!userParameters->getShowAlign()) ? "OFF" : "ON") <<"\n"; cout<<" 9. Output format options\n"; cout<<" I. Iteration = "; if(userParameters->getDoRemoveFirstIteration() == ALIGNMENT) { cout << "ALIGNMENT\n\n"; } else if(userParameters->getDoRemoveFirstIteration() == TREE) { cout << "TREE\n\n"; } else { cout << "NONE\n\n"; } cout<<" S. Execute a system command\n"; cout<<" H. HELP\n"; cout<<" or press [RETURN] to go back to main menu\n\n\n"; choice = utilityObject->getChoice(string("Your choice")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': clustalObj->align(&phylipName); break; case '2': clustalObj->doGuideTreeOnly(&phylipName); break; case '3': clustalObj->doAlignUseOldTree(&phylipName); break; case '4': userParameters->toggleQuickPairAlign(); break; case '5': pairwiseMenu(); break; case '6': multiMenu(); break; case '7': userParameters->toggleResetAlignmentsNew(); if (userParameters->getResetAlignmentsNew() == true) { userParameters->setResetAlignmentsAll(false); } break; case '8': userParameters->toggleShowAlign(); break; case '9': formatOptionsMenu(); break; case 'I': iterationMenu(); break; case 'S': doSystem(); break; case '?': case 'H': clustalObj->getHelp('2'); break; case 'Q': case 'X': return ; default: fprintf(stdout, "\n\nUnrecognised Command\n\n"); break; } } } void InteractiveMenu::profileAlignMenu(void) { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<"****** PROFILE AND STRUCTURE ALIGNMENT MENU ******\n\n\n"; cout<<" 1. Input 1st. profile "; if (!userParameters->getProfile1Empty()) { cout<<"(loaded)"; } cout<<"\n"; cout<<" 2. Input 2nd. profile/sequences "; if (!userParameters->getProfile2Empty()) { cout<<"(loaded)"; } cout<<"\n\n"; cout<<" 3. Align 2nd. profile to 1st. profile\n"; cout<<" 4. Align sequences to 1st. profile " <<((!userParameters->getQuickPairAlign()) ? "(Slow/Accurate)\n\n" : "(Fast/Approximate)\n\n"); cout<<" 5. Toggle Slow/Fast pairwise alignments = " <<((!userParameters->getQuickPairAlign()) ? "SLOW\n\n" : "FAST\n\n"); cout<<" 6. Pairwise alignment parameters\n"; cout<<" 7. Multiple alignment parameters\n\n"; cout<<" 8. Toggle screen display = " <<((!userParameters->getShowAlign()) ? "OFF\n" : "ON\n"); cout<<" 9. Output format options\n"; cout<<" 0. Secondary structure options\n\n"; cout<<" S. Execute a system command\n"; cout<<" H. HELP\n"; cout<<" or press [RETURN] to go back to main menu\n\n\n"; choice = utilityObject->getChoice(string("Your choice")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': clustalObj->profile1Input(); break; case '2': clustalObj->profile2Input(); break; case '3': clustalObj->profileAlign(&p1TreeName, &p2TreeName); break; case '4': /* align new sequences to profile 1 */ clustalObj->sequencesAlignToProfile(&phylipName); break; case '5': userParameters->toggleQuickPairAlign(); break; case '6': pairwiseMenu(); break; case '7': multiMenu(); break; case '8': userParameters->toggleShowAlign(); break; case '9': formatOptionsMenu(); break; case '0': ssOptionsMenu(); break; case 'S': doSystem(); break; case '?': case 'H': clustalObj->getHelp('6'); break; case 'Q': case 'X': return ; default: cout<<"\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::ssOptionsMenu() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<" ********* SECONDARY STRUCTURE OPTIONS *********\n\n\n"; cout<<" 1. Use profile 1 secondary structure / penalty mask "; if (userParameters->getUseSS1()) { cout<<"= YES\n"; } else { cout<<"= NO\n"; } cout<<" 2. Use profile 2 secondary structure / penalty mask "; if (userParameters->getUseSS2()) { cout<<"= YES\n\n"; } else { cout<<"= NO\n\n"; } cout<<" 3. Output in alignment "; cout<<"= "<< secStructOutputTxt[userParameters->getOutputStructPenalties()] <<"\n\n"; cout<<" 4. Helix gap penalty : " <getHelixPenalty()<<"\n"; cout<<" 5. Strand gap penalty : " <getStrandPenalty()<<"\n"; cout<<" 6. Loop gap penalty : " <getLoopPenalty()<<"\n"; cout<<" 7. Secondary structure terminal penalty : " <getHelixEndPenalty()<<"\n"; cout<<" 8. Helix terminal positions within : " <getHelixEndMinus() <<" outside : " <getHelixEndPlus()<<"\n"; cout<<" 9. Strand terminal positions within : " <getStrandEndMinus() <<" outside : " <getStrandEndPlus()<<"\n\n\n"; cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->toggleUseSS1(); break; case '2': userParameters->toggleUseSS2(); break; case '3': userParameters->setOutputStructPenalties(secStrOutputOptions()); break; case '4': cout<<"Helix Penalty Currently: " << userParameters->getHelixPenalty()<<"\n"; userParameters->setHelixPenalty(utilityObject->getInt("Enter number", 1,9, userParameters->getHelixPenalty())); break; case '5': cout<<"Strand Gap Penalty Currently: " << userParameters->getStrandPenalty() <<"\n"; userParameters->setStrandPenalty(utilityObject->getInt("Enter number", 1,9, userParameters->getStrandPenalty())); break; case '6': cout<<"Loop Gap Penalty Currently: " << userParameters->getLoopPenalty() <<"\n"; userParameters->setLoopPenalty(utilityObject->getInt("Enter number", 1, 9, userParameters->getLoopPenalty())); break; case '7': cout<<"Secondary Structure Terminal Penalty Currently: " << userParameters->getHelixEndPenalty() <<"\n"; userParameters->setHelixEndPenalty(utilityObject->getInt("Enter number", 1, 9,userParameters->getHelixEndPenalty())); userParameters->setStrandEndPenalty(userParameters->getHelixEndPenalty()); break; case '8': cout<<"Helix Terminal Positions Currently: \n"; cout<<" within helix: " << userParameters->getHelixEndMinus() << " outside helix: " << userParameters->getHelixEndPlus() <<"\n"; userParameters->setHelixEndMinus(utilityObject->getInt( "Enter number of residues within helix", 0, 3, userParameters->getHelixEndMinus())); userParameters->setHelixEndPlus(utilityObject->getInt( "Enter number of residues outside helix", 0, 3, userParameters->getHelixEndPlus())); break; case '9': cout<<"Strand Terminal Positions Currently: \n"; cout<<" within strand: " << userParameters->getStrandEndMinus() << " outside strand: " << userParameters->getStrandEndPlus() <<"\n"; userParameters->setStrandEndMinus(utilityObject->getInt( "Enter number of residues within strand", 0, 3, userParameters->getStrandEndMinus())); userParameters->setStrandEndPlus(utilityObject->getInt( "Enter number of residues outside strand", 0, 3, userParameters->getStrandEndPlus())); break; case '?': case 'H': clustalObj->getHelp('B'); break; default: cout<<"\n\nUnrecognised Command\n\n"; break; } } } int InteractiveMenu::secStrOutputOptions() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<" ********* Secondary Structure Output Menu *********\n\n\n"; cout<<" 1. "<< secStructOutputTxt[0] <<"\n"; cout<<" 2. "<< secStructOutputTxt[1] <<"\n"; cout<<" 3. "<< secStructOutputTxt[2] <<"\n"; cout<<" 4. "<< secStructOutputTxt[3] <<"\n"; cout<<" H. HELP\n\n"; cout<<" -- Current output is " << secStructOutputTxt[userParameters->getOutputStructPenalties()]; cout<<" --\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return (userParameters->getOutputStructPenalties());; } switch (toupper(choice)) { case '1': return (OUTSECST); case '2': return (OUTGAP); case '3': return (OUTBOTH); case '4': return (OUTNONE); case '?': case 'H': clustalObj->getHelp('C'); case 'Q': case 'X': return (0); default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::phylogeneticTreeMenu() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<"****** PHYLOGENETIC TREE MENU ******\n\n\n"; cout<<" 1. Input an alignment\n"; cout<<" 2. Exclude positions with gaps? "; if (userParameters->getTossGaps()) { cout<<"= ON\n"; } else { cout<<"= OFF\n"; } cout<<" 3. Correct for multiple substitutions? "; if (userParameters->getKimura()) { cout<<"= ON\n"; } else { cout<<"= OFF\n"; } cout<<" 4. Draw tree now\n"; cout<<" 5. Bootstrap tree\n"; cout<<" 6. Output format options\n"; cout<<" 7. Clustering algorithm = "; // Mark change 15-5-2007 if(userParameters->getClusterAlgorithm() == NJ) { cout << "NJ\n\n"; } else { cout << "UPGMA\n\n"; } cout<<" S. Execute a system command\n"; cout<<" H. HELP\n"; cout<<" or press [RETURN] to go back to main menu\n\n\n"; choice = utilityObject->getChoice(string("Your choice")); if (choice == '\n') { return ; } string offendingSeq; // unused here switch (toupper(choice)) { case '1': clustalObj->sequenceInput(false, &offendingSeq); break; case '2': userParameters->toggleTossGaps(); break; case '3': userParameters->toggleKimura(); break; case '4': clustalObj->phylogeneticTree(&phylipName, &clustalName, &distName, &nexusName, "amenu.pim"); break; case '5': clustalObj->bootstrapTree(&phylipName, &clustalName, &nexusName); break; case '6': treeFormatOptionsMenu(); break; case '7': clusteringAlgorithmMenu(); break; case 'S': doSystem(); break; case '?': case 'H': clustalObj->getHelp('7'); break; case 'Q': case 'X': return ; default: cout<<"\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::treeFormatOptionsMenu() { while (true) { lin1 = ""; cout<< "\n\n\n"; cout<<" ****** Format of Phylogenetic Tree Output ******\n\n\n"; cout<<" 1. Toggle CLUSTAL format tree output = " << ((!userParameters->getOutputTreeClustal()) ? "OFF" : "ON")<<"\n"; cout<<" 2. Toggle Phylip format tree output = " << ((!userParameters->getOutputTreePhylip()) ? "OFF" : "ON")<<"\n"; cout<<" 3. Toggle Phylip distance matrix output = " << ((!userParameters->getOutputTreeDistances()) ? "OFF" : "ON")<<"\n"; cout<<" 4. Toggle Nexus format tree output = " << ((!userParameters->getOutputTreeNexus()) ? "OFF" : "ON")<<"\n\n"; cout<<" 5. Toggle Phylip bootstrap positions = " <<((userParameters->getBootstrapFormat() == BS_NODE_LABELS) ? "NODE LABELS" : "BRANCH LABELS") <<"\n\n\n"; cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->toggleOutputTreeClustal(); break; case '2': userParameters->toggleOutputTreePhylip(); break; case '3': userParameters->toggleOutputTreeDistances(); break; case '4': userParameters->toggleOutputTreeNexus(); break; case '5': userParameters->toggleBootstrapFormat(); break; case '?': case 'H': clustalObj->getHelp('0'); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::formatOptionsMenu() { while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<" ********* Format of Alignment Output *********\n\n\n"; cout<<" F. Toggle FASTA format output = " << ((!userParameters->getOutputFasta()) ? "OFF" : "ON") <<"\n\n"; cout<<" 1. Toggle CLUSTAL format output = " << ((!userParameters->getOutputClustal()) ? "OFF" : "ON") <<"\n"; cout<<" 2. Toggle NBRF/PIR format output = " << ((!userParameters->getOutputNbrf()) ? "OFF" : "ON") << "\n"; cout<<" 3. Toggle GCG/MSF format output = " << ((!userParameters->getOutputGCG()) ? "OFF" : "ON") << "\n"; cout<<" 4. Toggle PHYLIP format output = " << ((!userParameters->getOutputPhylip()) ? "OFF" : "ON") << "\n"; cout<<" 5. Toggle NEXUS format output = " << ((!userParameters->getOutputNexus()) ? "OFF" : "ON") << "\n"; cout<<" 6. Toggle GDE format output = " << ((!userParameters->getOutputGde()) ? "OFF" : "ON") << "\n\n"; cout<<" 7. Toggle GDE output case = " << ((!userParameters->getLowercase()) ? "UPPER" : "LOWER") << "\n"; cout<<" 8. Toggle CLUSTALW sequence numbers = " << ((!userParameters->getClSeqNumbers()) ? "OFF" : "ON") << "\n"; cout<<" 9. Toggle output order = " << ((userParameters->getOutputOrder() == 0) ? "INPUT FILE" : "ALIGNED") <<"\n\n"; cout<<" 0. Create alignment output file(s) now?\n\n"; cout<<" T. Toggle parameter output = " << ((!userParameters->getSaveParameters()) ? "OFF" : "ON") << "\n"; cout<<" R. Toggle sequence range numbers = " <<((!userParameters->getSeqRange()) ? "OFF" : "ON") << "\n\n"; cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->toggleOutputClustal(); break; case '2': userParameters->toggleOutputNbrf(); break; case '3': userParameters->toggleOutputGCG(); break; case '4': userParameters->toggleOutputPhylip(); break; case '5': userParameters->toggleOutputNexus(); break; case '6': userParameters->toggleOutputGde(); break; case '7': userParameters->toggleLowercase(); break; case '8': userParameters->toggleClSeqNumbers(); break; case '9': userParameters->toggleOutputOrder(); break; case 'F': userParameters->toggleOutputFasta(); break; case 'R': userParameters->toggleSeqRange(); break; case '0': clustalObj->outputNow(); break; case 'T': userParameters->toggleSaveParameters(); break; case '?': case 'H': clustalObj->getHelp('5'); break; default: cout<<"\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::pairwiseMenu() { if (userParameters->getDNAFlag()) { userParameters->setPWParamToDNA(); } else { userParameters->setPWParamToProtein(); } while (true) { lin1 = ""; cout<<"\n\n\n"; cout<<" ********* PAIRWISE ALIGNMENT PARAMETERS *********\n\n\n"; cout<<" Slow/Accurate alignments:\n\n"; cout<<" 1. Gap Open Penalty : " << fixed << setprecision(2) << userParameters->getPWGapOpen() << "\n"; cout<<" 2. Gap Extension Penalty : " << fixed << setprecision(2) << userParameters->getPWGapExtend() << "\n"; cout<< " 3. Protein weight matrix :" << matrixMenu.opt[subMatrix->getPWMatrixNum() - 1].title << "\n"; cout<<" 4. DNA weight matrix :" << dnaMatrixMenu.opt[subMatrix->getPWDNAMatrixNum() - 1].title << "\n\n"; cout<<" Fast/Approximate alignments:\n\n"; cout<<" 5. Gap penalty :" << userParameters->getWindowGap() << "\n"; cout<<" 6. K-tuple (word) size :" << userParameters->getKtup() << "\n"; cout<<" 7. No. of top diagonals :" << userParameters->getSignif() << "\n"; cout<<" 8. Window size :" << userParameters->getWindow() << "\n\n"; cout<<" 9. Toggle Slow/Fast pairwise alignments "; if (userParameters->getQuickPairAlign()) { cout<<"= FAST\n\n"; } else { cout<<"= SLOW\n\n"; } cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { if (userParameters->getDNAFlag()) { userParameters->setPWDNAParam(); } else { userParameters->setPWProteinParam(); } return ; } switch (toupper(choice)) { case '1': cout<<"Gap Open Penalty Currently: " << userParameters->getPWGapOpen() << "\n"; userParameters->setPWGapOpen( (float)utilityObject->getReal("Enter number", (double)0.0, (double)100.0, (double)userParameters->getPWGapOpen())); break; case '2': cout<<"Gap Extension Penalty Currently: " << userParameters->getPWGapExtend() << "\n"; userParameters->setPWGapExtend( (float)utilityObject->getReal("Enter number", (double)0.0, (double)10.0, (double)userParameters->getPWGapExtend())); break; case '3': readMatrix(Protein, Pairwise, pwMatrixMenu); break; case '4': readMatrix(DNA, Pairwise, dnaMatrixMenu); break; case '5': cout<<"Gap Penalty Currently: " << userParameters->getWindowGap() << "\n"; userParameters->setWindowGap( utilityObject->getInt("Enter number", 1, 500, userParameters->getWindowGap())); break; case '6': cout<<"K-tuple Currently: " << userParameters->getKtup() << "\n"; if (userParameters->getDNAFlag()) { int _ktup = utilityObject->getInt("Enter number", 1, 4, userParameters->getKtup()); userParameters->setKtup(_ktup); // see bug 185 userParameters->setDNAKtup(_ktup); userParameters->setWindowGap(_ktup + 4); userParameters->setDNAWindowGap(_ktup + 4); } else { int _ktup = utilityObject->getInt("Enter number", 1, 2, userParameters->getKtup()); userParameters->setKtup(_ktup); // see bug 185 userParameters->setAAKtup(_ktup); userParameters->setWindowGap(_ktup + 3); userParameters->setAAWindowGap(_ktup + 3); } break; case '7': cout<<"Top diagonals Currently: " << userParameters->getSignif() << "\n"; userParameters->setSignif( utilityObject->getInt("Enter number", 1, 50, userParameters->getSignif())); break; case '8': cout<<"Window size Currently: " << userParameters->getWindow() << "\n"; userParameters->setWindow( utilityObject->getInt("Enter number", 1, 50, userParameters->getWindow())); break; case '9': userParameters->toggleQuickPairAlign(); break; case '?': case 'H': clustalObj->getHelp('3'); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::multiMenu() { if (userParameters->getDNAFlag()) { userParameters->setDNAMultiGap(); } else { userParameters->setProtMultiGap(); } while (true) { lin1 = ""; cout<<"\n\n\n ********* MULTIPLE ALIGNMENT PARAMETERS *********\n\n\n"; cout<<" 1. Gap Opening Penalty :" << fixed << setprecision(2) << userParameters->getGapOpen() << "\n"; cout<<" 2. Gap Extension Penalty :" << fixed << setprecision(2) << userParameters->getGapExtend() << "\n"; cout<<" 3. Delay divergent sequences :" << userParameters->getDivergenceCutoff() << " %\n\n"; cout<<" 4. DNA Transitions Weight :" << fixed << setprecision(2) << userParameters->getTransitionWeight() << "\n\n"; cout<<" 5. Protein weight matrix :" << matrixMenu.opt[subMatrix->getMatrixNum() - 1].title << "\n"; cout<<" 6. DNA weight matrix :" << dnaMatrixMenu.opt[subMatrix->getDNAMatrixNum() - 1].title << "\n"; cout<<" 7. Use negative matrix :" << ((!userParameters->getUseNegMatrix()) ? "OFF" : "ON") << "\n\n"; cout<<" 8. Protein Gap Parameters\n\n"; cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { if (userParameters->getDNAFlag()) { //userParameters->setDNAMultiGap(); userParameters->setDNAGapOpen(userParameters->getGapOpen()); userParameters->setDNAGapExtend(userParameters->getGapExtend()); } else { //userParameters->setProtMultiGap(); userParameters->setAAGapOpen(userParameters->getGapOpen()); userParameters->setAAGapExtend(userParameters->getGapExtend()); } return ; } switch (toupper(choice)) { case '1': cout<<"Gap Opening Penalty Currently: " << userParameters->getGapOpen() << "\n"; userParameters->setGapOpen( (float)utilityObject->getReal("Enter number", (double)0.0, (double)100.0, (double)userParameters->getGapOpen())); break; case '2': cout<<"Gap Extension Penalty Currently: " << userParameters->getGapExtend() << "\n"; userParameters->setGapExtend( (float)utilityObject->getReal("Enter number", (double)0.0, (double)10.0, (double)userParameters->getGapExtend())); break; case '3': cout<<"Min Identity Currently: " << userParameters->getDivergenceCutoff() << "\n"; userParameters->setDivergenceCutoff( utilityObject->getInt("Enter number", 0, 100, userParameters->getDivergenceCutoff())); break; case '4': cout<<"Transition Weight Currently: " << userParameters->getTransitionWeight() << "\n"; userParameters->setTransitionWeight( (float)utilityObject->getReal("Enter number", (double)0.0, (double)1.0, (double)userParameters->getTransitionWeight())); break; case '5': readMatrix(Protein, MultipleAlign, matrixMenu); break; case '6': readMatrix(DNA, MultipleAlign, dnaMatrixMenu); break; case '7': userParameters->toggleUseNegMatrix(); break; case '8': gapPenaltiesMenu(); break; case '?': case 'H': //clustalObj->getHelp('4'); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::gapPenaltiesMenu() { while (true) { lin1 = ""; cout<< "\n\n\n ********* PROTEIN GAP PARAMETERS *********\n\n\n\n"; cout<<" 1. Toggle Residue-Specific Penalties :" << ((userParameters->getNoPrefPenalties()) ? "OFF" : "ON") << "\n\n"; cout<<" 2. Toggle Hydrophilic Penalties :" << ((userParameters->getNoHydPenalties()) ? "OFF" : "ON") << "\n"; cout<<" 3. Hydrophilic Residues :" << userParameters->getHydResidues() << "\n\n"; cout<<" 4. Gap Separation Distance :" << userParameters->getGapDist() << "\n"; cout<<" 5. Toggle End Gap Separation :" << ((!userParameters->getUseEndGaps()) ? "OFF" : "ON") << "\n\n"; cout<<" H. HELP\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->toggleNoPrefPenalties(); break; case '2': userParameters->toggleNoHydPenalties(); break; case '3': cout<<"Hydrophilic Residues Currently: " << userParameters->getHydResidues() << "\n"; lin1 = ""; utilityObject->getStr(string("Enter residues (or [RETURN] to quit)"), lin1); if (lin1.size() > 0) { userParameters->setHydResidues(lin1); } break; case '4': cout<<"Gap Separation Distance Currently: " << userParameters->getGapDist() << "\n"; userParameters->setGapDist( utilityObject->getInt("Enter number", 0, 100, userParameters->getGapDist())); break; case '5': userParameters->toggleUseEndGaps(); break; case '?': case 'H': clustalObj->getHelp('A'); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } /* * This function displays the menu for selecting the weight matrix to use. * It is used for both the protein and DNA menu for pairwise and Multiple alignment. * This is why it requires the MatMenu struct. */ int InteractiveMenu::readMatrix(int alignResidueType, int alignType, MatMenu menu) { static char userFile[FILENAMELEN + 1]; int i, option; char title[10]; int matn; // Used to show which is the current matrix. if(alignResidueType == Protein) { strcpy(title, "PROTEIN"); } else // DNA { strcpy(title, "DNA"); } while (true) { lin1 = ""; cout<<"\n\n\n ********* "<< title <<" WEIGHT MATRIX MENU *********\n\n\n"; // Find out what the currently selected matrix is. matn = subMatrix->getMatrixNumForMenu(alignResidueType, alignType); for (i = 0; i < menu.noptions; i++) { cout<< " " << i + 1 << ". " << menu.opt[i].title << "\n"; } cout<<" H. HELP\n\n"; cout<<" -- Current matrix is the " << menu.opt[matn -1].title << " "; if (matn == menu.noptions) { cout<<"(file = "<< userFile <<")";; } cout<<"--\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return matn; } option = toupper(choice) - '0'; // Select the matrix series to be using if (option > 0 && option < menu.noptions) { subMatrix->setCurrentNameAndNum(string(menu.opt[i - 1].string), option, alignResidueType, alignType); } else if (option == menu.noptions) // Read in a User defined matrix. { // NOTE this will be changed to deal with matrix series. if (subMatrix->getUserMatFromFile(userFile, alignResidueType, alignType)) { subMatrix->setCurrentNameAndNum(userFile, option, alignResidueType, alignType); } } else switch (toupper(choice)) { case '?': case 'H': clustalObj->getHelp('8'); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::doSystem() { lin1 = ""; utilityObject->getStr(string("\n\nEnter system command"), lin1); if (lin1.size() > 0) { system(lin1.c_str()); } cout<< "\n\n"; } void InteractiveMenu::clusteringAlgorithmMenu() { string currentAlgorithm = ""; cout<<"****** CLUSTERING ALGORITHM MENU ******\n\n\n"; while (true) { if(userParameters->getClusterAlgorithm() == NJ) { currentAlgorithm = "Neighbour Joining"; } else { currentAlgorithm = "UPGMA"; } lin1 = ""; cout<< "\n\n\n"; cout<<" ****** Clustering Algorithms ******\n\n\n"; cout<<" 1. Neighbour Joining \n"; cout<<" 2. UPGMA \n"; cout << "-- Current algorithm is "<< currentAlgorithm << " --\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->setClusterAlgorithm(NJ); break; case '2': userParameters->setClusterAlgorithm(UPGMA); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } void InteractiveMenu::iterationMenu() { string currentIteration = ""; cout<<"****** ITERATION MENU ******\n\n\n"; while (true) { if(userParameters->getDoRemoveFirstIteration() == ALIGNMENT) { currentIteration = "Alignment iteration"; } else if(userParameters->getDoRemoveFirstIteration() == TREE) { currentIteration = "Tree based iteration"; } else { currentIteration = "None"; } lin1 = ""; cout<< "\n\n\n"; cout<<" ****** Iteration Choices ******\n\n\n"; cout<<" 1. Off \n"; cout<<" 2. Tree based iteration (iterates each profile alignment step) \n"; cout<<" 3. Alignment iteration (iterates final alignment only) \n\n"; cout << "-- Current selection is "<< currentIteration << " --\n\n\n"; choice = utilityObject->getChoice(string("Enter number (or [RETURN] to exit)")); if (choice == '\n') { return ; } switch (toupper(choice)) { case '1': userParameters->setDoRemoveFirstIteration(NONE); break; case '2': userParameters->setDoRemoveFirstIteration(TREE); break; case '3': userParameters->setDoRemoveFirstIteration(ALIGNMENT); break; default: cout<< "\n\nUnrecognised Command\n\n"; break; } } } } clustalw-2.1/src/interface/CommandLineParser.cpp0000644000175000017500000024347211453074101016741 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "CommandLineParser.h" #include "../substitutionMatrix/globalmatrix.h" #include "general/Utility.h" #include "general/statsObject.h" using namespace std; namespace clustalw { CommandLineParser::CommandLineParser(StringArray* args, bool xmenus) :setOptions(-1), setHelp(-1), setFullHelp(-1), setQuiet(-1), setInteractive(-1), setBatch(-1), setGapOpen(-1), setGapExtend(-1), setPWGapOpen(-1), setPWGapExtend(-1), setOutOrder(-1), setBootLabels(-1), setPWMatrix(-1), setMatrix(-1), setPWDNAMatrix(-1), setDNAMatrix(-1), setNegative(-1), setNoWeights(-1), setOutput(-1), setOutputTree(-1), setQuickTree(-1), setType(-1), setCase(-1), setSeqNo(-1), setSeqNoRange(-1), setRange(-1), setTransWeight(-1), setSeed(-1), setScore(-1), setWindow(-1), setKtuple(-1), setKimura(-1), setTopDiags(-1), setPairGap(-1), setTossGaps(-1), setNoPGap(-1), setNoHGap(-1), setNoVGap(-1), setHGapRes(-1), setUseEndGaps(-1), setMaxDiv(-1), setGapDist(-1), setDebug(-1), setOutfile(-1), setInfile(-1), setProfile1(-1), setProfile2(-1), setAlign(-1), setConvert(-1), setNewTree(-1), setUseTree(-1), setNewTree1(-1), setUseTree1(-1), setNewTree2(-1), setUseTree2(-1), setBootstrap(-1), setTree(-1), setProfile(-1), setSequences(-1), setSecStruct1(-1), setSecStruct2(-1), setSecStructOutput(-1), setHelixGap(-1), setStrandGap(-1), setLoopGap(-1), setTerminalGap(-1), setHelixEndIn(-1), setHelixEndOut(-1), setStrandEndIn(-1), setStrandEndOut(-1), profileType(PROFILE), setDoIteration(-1), setNumIterations(-1), setTreeAlgorithm(-1), setMaxSeqLen(-1), setStatsFile(-1), setOutputPim(-1) { int ctr=0; // The rest of the variables are arrays! try { clustalObj = new Clustal(); // selecting the size prevents the resizing of the vector which is expensive. typeArg = new StringArray(3); bootLabelsArg = new StringArray(3); outOrderArg = new StringArray(3); caseArg = new StringArray(3); seqNoArg = new StringArray(3); seqNoRangeArg = new StringArray(3); scoreArg = new StringArray(3); outputArg = new StringArray(8); outputTreeArg = new StringArray(5); outputSecStrArg = new StringArray(5); cmdLineType = new StringArray(6); clusterAlgorithm = new StringArray(3); iterationArg = new StringArray(4); params = new StringArray; // Wait until I need it!!!!!!!!! paramArg = new StringArray; } catch(const exception &ex) { cerr << ex.what() << endl; cerr << "Terminating program. Cannot continue" << std::endl; exit(1); } (*typeArg)[0] = "protein"; (*typeArg)[1] = "dna"; (*typeArg)[2] = ""; (*bootLabelsArg)[0] = "node"; (*bootLabelsArg)[1] = "branch"; (*bootLabelsArg)[2] = ""; (*outOrderArg)[0] = "input"; (*outOrderArg)[1] = "aligned"; (*outOrderArg)[2] = ""; (*caseArg)[0] = "lower"; (*caseArg)[1] = "upper"; (*caseArg)[2] = ""; (*seqNoArg)[0] = "off"; (*seqNoArg)[1] = "on"; (*seqNoArg)[2] = ""; (*seqNoRangeArg)[0] = "off"; (*seqNoRangeArg)[1] = "on"; (*seqNoRangeArg)[2] = ""; (*scoreArg)[0] = "percent"; (*scoreArg)[1] = "absolute"; (*scoreArg)[2] = ""; (*outputArg)[0] = "gcg"; (*outputArg)[1] = "gde"; (*outputArg)[2] = "pir"; (*outputArg)[3] = "phylip"; (*outputArg)[4] = "nexus"; (*outputArg)[5] = "fasta"; (*outputArg)[6] = "clustal"; (*outputArg)[7] = ""; (*outputTreeArg)[0] = "nj"; (*outputTreeArg)[1] = "phylip"; (*outputTreeArg)[2] = "dist"; (*outputTreeArg)[3] = "nexus"; (*outputTreeArg)[4] = ""; (*outputSecStrArg)[0] = "structure"; (*outputSecStrArg)[1] = "mask"; (*outputSecStrArg)[2] = "both"; (*outputSecStrArg)[3] = "none"; (*outputSecStrArg)[4] = ""; (*cmdLineType)[0] = " "; (*cmdLineType)[1] = "=n "; (*cmdLineType)[2] = "=f "; (*cmdLineType)[3] = "=string "; (*cmdLineType)[4] = "=filename "; (*cmdLineType)[5] = ""; (*clusterAlgorithm)[0] = "nj"; (*clusterAlgorithm)[1] = "upgma"; (*clusterAlgorithm)[2] = ""; (*iterationArg)[0] = "tree"; (*iterationArg)[1] = "alignment"; (*iterationArg)[2] = "none"; (*iterationArg)[3] = ""; userMatrixName = ""; pwUserMatrixName = ""; DNAUserMatrixName = ""; pwDNAUserMatrixName = ""; clustalTreeName = ""; distTreeName = ""; phylipTreeName = ""; nexusTreeName = ""; p1TreeName = ""; p2TreeName = ""; pimName = ""; // NOTE there were only 3 params for the last one, so I put in NULL for the 4th. ctr=0; cmdLineFile[ctr++] = getCmdLineDataStruct("infile", &setInfile, FILARG, NULL); cmdLineFile[ctr++] = getCmdLineDataStruct("profile1", &setProfile1, FILARG, NULL); cmdLineFile[ctr++] = getCmdLineDataStruct("profile2", &setProfile2, FILARG, NULL); cmdLineFile[ctr++] = getCmdLineDataStruct("", NULL, -1, NULL); // FIXME: final ctr index is hardcoded in CommandLineParser ctr=0; cmdLineVerb[ctr++] = getCmdLineDataStruct("help", &setHelp, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("fullhelp", &setFullHelp, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("quiet", &setQuiet, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("check", &setHelp, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("options", &setOptions, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("align", &setAlign, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("newtree", &setNewTree, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("usetree", &setUseTree, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("newtree1", &setNewTree1, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("usetree1", &setUseTree1, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("newtree2", &setNewTree2, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("usetree2", &setUseTree2, FILARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("bootstrap", &setBootstrap, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("tree", &setTree, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("quicktree", &setQuickTree, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("convert", &setConvert, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("interactive", &setInteractive, NOARG, NULL); cmdLineVerb[ctr++] = getCmdLineDataStruct("batch", &setBatch, NOARG, NULL); // Mark change 16-feb-2007 I added options for doing LE and iteration cmdLineVerb[ctr++] = getCmdLineDataStruct("iteration", &setDoIteration, OPTARG, iterationArg); cmdLineVerb[ctr++] = getCmdLineDataStruct("", NULL, -1, NULL); // FIXME: final ctr index is hardcoded in CommandLineParser.h // NOTE Start back here!!!!!!!!!!!! ctr=0; cmdLinePara[ctr++] = getCmdLineDataStruct("type", &setType, OPTARG, typeArg); cmdLinePara[ctr++] = getCmdLineDataStruct("profile", &setProfile, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("sequences", &setSequences, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("matrix", &setMatrix, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("dnamatrix", &setDNAMatrix, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("negative", &setNegative, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("noweights", &setNoWeights, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("gapopen", &setGapOpen, FLTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("gapext", &setGapExtend, FLTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("endgaps", &setUseEndGaps, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("nopgap", &setNoPGap, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("nohgap", &setNoHGap, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("novgap", &setNoVGap, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("hgapresidues", &setHGapRes, STRARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("maxdiv", &setMaxDiv, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("gapdist", &setGapDist, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pwmatrix", &setPWMatrix, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pwdnamatrix", &setPWDNAMatrix, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pwgapopen", &setPWGapOpen, FLTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pwgapext", &setPWGapExtend, FLTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("ktuple", &setKtuple, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("window", &setWindow, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pairgap", &setPairGap, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("topdiags", &setTopDiags, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("score", &setScore, OPTARG, scoreArg); cmdLinePara[ctr++] = getCmdLineDataStruct("transweight", &setTransWeight, FLTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("seed", &setSeed, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("kimura", &setKimura, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("tossgaps", &setTossGaps, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("bootlabels", &setBootLabels, OPTARG, bootLabelsArg); cmdLinePara[ctr++] = getCmdLineDataStruct("debug", &setDebug, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("output", &setOutput, OPTARG, outputArg); cmdLinePara[ctr++] = getCmdLineDataStruct("outputtree", &setOutputTree, OPTARG, outputTreeArg); cmdLinePara[ctr++] = getCmdLineDataStruct("outfile", &setOutfile, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("outorder", &setOutOrder, OPTARG, outOrderArg); cmdLinePara[ctr++] = getCmdLineDataStruct("case", &setCase, OPTARG, caseArg); cmdLinePara[ctr++] = getCmdLineDataStruct("seqnos", &setSeqNo, OPTARG, seqNoArg); cmdLinePara[ctr++] = getCmdLineDataStruct("seqno_range", &setSeqNoRange, OPTARG, seqNoRangeArg); cmdLinePara[ctr++] = getCmdLineDataStruct("range", &setRange, STRARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("nosecstr1", &setSecStruct1, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("nosecstr2", &setSecStruct2, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("secstrout", &setSecStructOutput, OPTARG, outputSecStrArg); cmdLinePara[ctr++] = getCmdLineDataStruct("helixgap", &setHelixGap, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("strandgap", &setStrandGap, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("loopgap", &setLoopGap, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("terminalgap", &setTerminalGap, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("helixendin", &setHelixEndIn, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("helixendout", &setHelixEndOut, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("strandendin", &setStrandEndIn, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("strandendout",&setStrandEndOut, INTARG, NULL); // NOTE these one was added to test the new LE scoring and iterations cmdLinePara[ctr++] = getCmdLineDataStruct("numiter",&setNumIterations, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("clustering", &setTreeAlgorithm, OPTARG, clusterAlgorithm); cmdLinePara[ctr++] = getCmdLineDataStruct("maxseqlen", &setMaxSeqLen, INTARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("stats", &setStatsFile, FILARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("pim", &setOutputPim, NOARG, NULL); cmdLinePara[ctr++] = getCmdLineDataStruct("", NULL, -1, NULL); // FIXME: final ctr index is hardcoded in CommandLineParser parseParams(args, xmenus); } CommandLineParser::~CommandLineParser() { // Free up menory used here! // NOTE any dynamically allocated memory (new) must be deleted. delete clustalObj; delete typeArg; delete bootLabelsArg; delete outOrderArg; delete caseArg; delete seqNoArg; delete seqNoRangeArg; delete scoreArg; delete outputArg; delete outputTreeArg; delete outputSecStrArg; delete cmdLineType; delete params; delete paramArg; delete clusterAlgorithm; delete iterationArg; } void CommandLineParser::parseParams(StringArray* args, bool xmenus) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Parsing Command line Parameters!\n"); } #endif int i, j, temp; //int len; //static int cl_error_code = 0; //char path[FILENAMELEN]; int numparams = 0; bool doAlign, doConvert, doAlignUseOldTree, doGuideTreeOnly, doTreeFromAlign, doBootstrap, doProfileAlign, doSomething; if (!xmenus && userParameters->getDisplayInfo()) { cout << std::endl << std::endl << std::endl; cout << " CLUSTAL " << userParameters->getRevisionLevel() << " Multiple Sequence Alignments" << std::endl << std::endl << std::endl; } doAlign = doConvert = doAlignUseOldTree = doGuideTreeOnly = doTreeFromAlign = false; doBootstrap = doProfileAlign = doSomething = false; numparams = checkParam(args, params, paramArg); if (numparams < 0) { exit(1); } //********************************************************************** //*** Note: This part of the code is to print out the options with **** //*** their expected value types/ranges **** //********************************************************************** if(setHelp != -1) { userParameters->setHelpFlag(true); if (xmenus) { // gui will display help // but parse rest of args anyway and don't return } else { clustalObj->getHelp('9'); exit(1); } } if(setFullHelp != -1) { userParameters->setFullHelpFlag(true); if (xmenus) { // gui will handle this // but parse rest of args anyway and don't return } else { clustalObj->getFullHelp(); exit(1); } } if(setQuiet != -1) { userParameters->setDisplayInfo(false); utilityObject->beQuiet(true); } else { userParameters->setDisplayInfo(true); utilityObject->beQuiet(false); } // need to check maxseqlen before reading input file if (setMaxSeqLen != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting max allowed sequence length."); } #endif temp = 0; if((*paramArg)[setMaxSeqLen].length() > 0) { if (sscanf((*paramArg)[setMaxSeqLen].c_str(),"%d", &temp) != 1) { reportBadOptionAndExit("maxseqlen", "integer"); } } if(temp > 0) { userParameters->setMaxAllowedSeqLength(temp); } else { cerr << "Cannot use a negative value for maximum sequence length. Using default" << std::endl; } } if (setStatsFile != -1) { if((*paramArg)[setStatsFile].length() > 0) { statsObject->setEnabled(true); statsObject->setStatsFile((*paramArg)[setStatsFile]); } } if (setOutputPim != -1) { userParameters->setOutputPim(true); } /*if(setDoIteration != -1) { userParameters->setDoRemoveFirstIteration(true); }*/ if(setDoIteration != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting iteration parameter."); } #endif if((*paramArg)[setDoIteration].length() > 0) { temp = findMatch((*paramArg)[setDoIteration], iterationArg, 3); if(temp == 0) { userParameters->setDoRemoveFirstIteration(TREE); } else if(temp == 1) { userParameters->setDoRemoveFirstIteration(ALIGNMENT); } else if(temp == 2) { userParameters->setDoRemoveFirstIteration(NONE); } else { cerr << "Unknown option for iteration. Setting to NONE" << std::endl; userParameters->setDoRemoveFirstIteration(NONE); } } } if(setOptions != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Displaying options!\n"); } #endif cout << "clustalw option list:-" << std::endl; for (i = 0; cmdLineVerb[i].str[0] != '\0'; i++) { cout << "\t\t" << default_commandsep << cmdLineVerb[i].str << (*cmdLineType)[cmdLineVerb[i].type]; if (cmdLineVerb[i].type == OPTARG) { if (cmdLineVerb[i].arg != NULL) { cout << "=" << cmdLineVerb[i].arg->at(0); for(j = 1; j < (int)cmdLineVerb[i].arg->size() - 1; j++) { cout << " OR " << cmdLineVerb[i].arg->at(j); } } } cout << std::endl; } for (i = 0; cmdLineFile[i].str[0] != '\0'; i++) { cout<<"\t\t" << default_commandsep << cmdLineFile[i].str << (*cmdLineType)[cmdLineFile[i].type]; if (cmdLineFile[i].type == OPTARG) { if (cmdLineFile[i].arg != NULL) { cout << "=" << cmdLineFile[i].arg->at(0); for(j = 1; j < (int)cmdLineFile[i].arg->size() - 1; j++) { cout << " OR " << cmdLineFile[i].arg->at(j); } } } cout << std::endl; } for (i = 0; cmdLinePara[i].str[0] != '\0'; i++) { cout <<"\t\t" << default_commandsep << cmdLinePara[i].str << (*cmdLineType)[cmdLinePara[i].type]; if (cmdLinePara[i].type == OPTARG) { if (cmdLinePara[i].arg != NULL) { cout << "=" << cmdLinePara[i].arg->at(0); for(j = 1; j < (int)cmdLinePara[i].arg->size() - 1; j++) { cout << " OR " << cmdLinePara[i].arg->at(j); } } } cout << std::endl; } exit(1); } //***************************************************************************** // Check to see if sequence type is explicitely stated..override ************ // the automatic checking (DNA or Protein). /type=d or /type=p ************* //**************************************************************************** if(setType != -1) { string msg; if(((*paramArg)[setType].length()) > 0) { temp = findMatch((*paramArg)[setType], typeArg, 2); if(temp == 0) { userParameters->setDNAFlag(false); userParameters->setExplicitDNAFlag(true); msg = "Sequence type explicitly set to Protein"; cout << msg << std::endl; } else if(temp == 1) { msg = "Sequence type explicitly set to DNA"; cout << msg << std::endl; userParameters->setDNAFlag(true); userParameters->setExplicitDNAFlag(true); } else { msg = "Unknown sequence type " + (*paramArg)[setType]; cerr << std::endl << msg << endl; } #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(msg); } #endif } } //*************************************************************************** // check to see if 1st parameter does not start with '/' i.e. look for an * // input file as first parameter. The input file can also be specified * // by /infile=fname. * //*************************************************************************** // JULIE - moved to checkParam() // if(paramstr[0] != '/') // { // strcpy(seqName, params[0]); // } //************************************************* // Look for /infile=file.ext on the command line * //************************************************* if(setInfile != -1) { if((*paramArg)[setInfile].length() <= 0) { exitWithErrorMsg("Bad sequence file name"); } userParameters->setSeqName((*paramArg)[setInfile]); #if DEBUGFULL if(logObject && DEBUGLOG) { string msg = "Sequence file name (seqName) has been set to "; msg += userParameters->getSeqName(); logObject->logMsg(msg); } #endif } // NOTE keep an eye on this part to see if it works. if(userParameters->getSeqName() != "") { // NOTE I will need to cheack if it has been successful before setting // doSomething to true. int code; code = clustalObj->commandLineReadSeq(1); if(code == OK) { doSomething = true; } else { doSomething = false; exit(1); } } // NOTE call the other function to set the parameter values!! setOptionalParam(); //********************************************************* // Look for /profile1=file.ext AND /profile2=file2.ext * // You must give both file names OR neither. * //******************************************************** if(setProfile1 != -1) { if((*paramArg)[setProfile1].length() <= 0) { exitWithErrorMsg("Bad profile 1 file name"); } clustalObj->profile1Input((*paramArg)[setProfile1]); } if(setProfile2 != -1) { if((*paramArg)[setProfile2].length() <= 0) { exitWithErrorMsg("Bad profile 2 file name"); } if(userParameters->getProfile1Empty()) { exitWithErrorMsg("Only 1 profile file (profile 2) specified."); } clustalObj->profile2Input((*paramArg)[setProfile2]); doSomething = doProfileAlign = true; } //************************************************************************ // Look for /tree or /bootstrap or /align or /usetree ****************** //************************************************************************ if (setBatch != -1) { userParameters->setInteractive(false); } if (setInteractive != -1) { userParameters->setInteractive(true); if (setQuiet!=-1) { cout << "interactive menu: overriding " << default_commandsep << "quiet" << std::endl; userParameters->setDisplayInfo(true); utilityObject->beQuiet(false); } } if (userParameters->getInteractive()) { setTree = -1; setBootstrap = -1; setAlign = -1; setUseTree = -1; setUseTree1 = -1; setUseTree2 = -1; setNewTree = -1; setConvert = -1; } if(setTree != -1 ) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot draw tree. No input alignment file"); } else { doTreeFromAlign = true; } } if(setBootstrap != -1) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot bootstrap tree. No input alignment file"); } else { temp = 0; // Check if there is anything in the string! if((*paramArg)[setBootstrap].length() > 0) { if (sscanf((*paramArg)[setBootstrap].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("bootstrap", "integer"); } } if(temp > 0) { userParameters->setBootNumTrials(temp); } doBootstrap = true; } } if(setAlign != -1) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot align sequences. No input file"); } else { doAlign = true; } } if(setConvert != -1) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot convert sequences. No input file"); } else { doConvert = true; } } if(setUseTree != -1) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot align sequences. No input file"); } else { if((*paramArg)[setUseTree].length() == 0) { exitWithErrorMsg("Cannot align sequences. No tree file specified"); } else { phylipTreeName = (*paramArg)[setUseTree]; } userParameters->setUseTreeFile(true); doAlignUseOldTree = true; } } if(setNewTree != -1) { if(userParameters->getEmpty()) { exitWithErrorMsg("Cannot align sequences. No input file"); } else { if((*paramArg)[setNewTree].length() == 0) { exitWithErrorMsg("Cannot align sequences. No tree file specified"); } else { phylipTreeName = (*paramArg)[setNewTree]; } userParameters->setNewTreeFile(true); doGuideTreeOnly = true; } } if(setUseTree1 != -1) { if(userParameters->getProfile1Empty()) { exitWithErrorMsg("Cannot align profiles. No input file"); } else if(profileType == SEQUENCE) { reportInvalidOptionAndExit("usetree1"); } else { if((*paramArg)[setUseTree1].length() == 0) { exitWithErrorMsg("Cannot align profiles. No tree file specified"); } else { p1TreeName = (*paramArg)[setUseTree1]; } userParameters->setUseTree1File(true); doAlignUseOldTree = true; } } if(setNewTree1 != -1) { if(userParameters->getProfile1Empty()) { exitWithErrorMsg("Cannot align profiles. No input file"); } else if(profileType == SEQUENCE) { reportInvalidOptionAndExit("newtree1"); } else { if((*paramArg)[setNewTree1].length() == 0) { exitWithErrorMsg("Cannot align profiles. No tree file specified"); } else { p1TreeName = (*paramArg)[setNewTree1]; } userParameters->setNewTree1File(true); } } if(setUseTree2 != -1) { if(userParameters->getProfile2Empty()) { exitWithErrorMsg("Cannot align profiles. No input file"); } else if(profileType == SEQUENCE) { reportInvalidOptionAndExit("usetree2"); } else { if((*paramArg)[setUseTree2].length() == 0) { exitWithErrorMsg("Cannot align profiles. No tree file specified"); } else { p2TreeName = (*paramArg)[setUseTree2]; } userParameters->setUseTree2File(true); doAlignUseOldTree = true; } } if(setNewTree2 != -1) { if(userParameters->getProfile2Empty()) { exitWithErrorMsg("Cannot align profiles. No input file"); } else if(profileType == SEQUENCE) { reportInvalidOptionAndExit("newtree2"); } else { if((*paramArg)[setNewTree2].length() == 0) { exitWithErrorMsg("Cannot align profiles. No tree file specified"); } else { p2TreeName = (*paramArg)[setNewTree2]; } userParameters->setNewTree2File(true); } } if( (!doTreeFromAlign) && (!doBootstrap) && (!userParameters->getEmpty()) && (!doProfileAlign) && (!doAlignUseOldTree) && (!doGuideTreeOnly) && (!doConvert)) { doAlign = true; } //** ? /quicktree if(setQuickTree != -1) { userParameters->setQuickPairAlign(true); } // NOTE if(userParameters->getDNAFlag()) { userParameters->setDNAParams(); } else { userParameters->setProtParams(); } if(userParameters->getInteractive()) { if (!xmenus) { userParameters->setMenuFlag(true); } return; } if(!doSomething) { exitWithErrorMsg("No input file(s) specified"); } //*************************************************************************** // Now do whatever has been requested *************************************** //*************************************************************************** // NOTE This part is obviously not done yet! Functions not working in Clustal!!!! #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Now doing the requested task(s)"); } #endif if(doProfileAlign) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing profile align"); } #endif if (profileType == PROFILE) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Calling Profile_align in clustal obj!"); } #endif clustalObj->profileAlign(&p1TreeName, &p2TreeName); } else { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Calling sequencesAlignToProfile in clustal obj!"); } #endif clustalObj->sequencesAlignToProfile(&phylipTreeName); } } else if(doAlign) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing Alignment"); } #endif clustalObj->align(&phylipTreeName); } else if(doConvert) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing filetype conversion"); } #endif clustalObj->outputNow(); } else if (doAlignUseOldTree) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing Alignment only"); } #endif clustalObj->doAlignUseOldTree(&phylipTreeName); } else if(doGuideTreeOnly) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing tree only"); } #endif clustalObj->doGuideTreeOnly(&phylipTreeName); } else if(doTreeFromAlign) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing tree"); } #endif clustalObj->phylogeneticTree(&phylipTreeName, &clustalTreeName, &distTreeName, &nexusTreeName, pimName); } else if(doBootstrap) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Doing Bootstrap"); } #endif clustalObj->bootstrapTree(&phylipTreeName, &clustalTreeName, &nexusTreeName); } cout << std::endl; } int CommandLineParser::checkParam(StringArray* args, StringArray* params, StringArray* paramArg) { int len, i, j, nameFirst, num; //int k; vector match; match.resize(MAXARGS); bool name1 = false; #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Checking Parameters!"); } #endif if(args->size() == 0) // NOTE I think this will work better! { cout << "The argument list is empty\n"; return 0; } // AW: first arg is an input file if it doesnt start with commandsep if (VALID_COMMAND_SEP.find((*args)[0][0], 0) == string::npos) { name1 = true; params->push_back((*args)[0]); // Put the string at the back of this vector. paramArg->push_back(""); // Push a blank string onto the first element. } else // It is not a file name { params->push_back((*args)[0].substr(1)); } for (i = 1; i < (int)args->size(); i++) { params->push_back(""); // Empty string! for(j = 0; j < (int)(*args)[i].length() - 1; j++) { if(isprint((*args)[i][j + 1])) // Character printable? { // We start at j + 1 because each option should begin with commandsep (*params)[i].append((*args)[i].substr(j + 1, 1)); } } } num = i; // AW: // params are now setup // extract paramArgs in next step if ((int)args->size() > MAXARGS) { cerr << "Error: too many command line arguments\n"; return(-1); } /* special case - first parameter is input fileName */ nameFirst = 0; if(name1 == true) // If name of file is first argument { userParameters->setSeqName((*params)[0]); /* Andreas Wilm (UCD) 2008-03-19: conversion nowadays unnecessary and makes trouble /@ JULIE convert to lower case now @/ #ifndef UNIX if(logObject && DEBUGLOG) { logObject->logMsg("Converting seqName to lower case.\n"); } string temp = ConvertStringToLower(userParameters->getSeqName()); userParameters->setSeqName(temp); #endif */ nameFirst = 1; } // NOTE if name first we should start at the 2nd element in paramArg // This loop is used to set up the paramArg vector! for (i = nameFirst; i < num; i++) { bool has_arg=false; paramArg->push_back(""); // Push a new empty string on. len = (*params)[i].length(); for(j = 0; j < len; j++) { if((*params)[i][j] == '=') { has_arg=true; (*paramArg)[i].assign((*params)[i].substr(j + 1, len - j -1)); // Trim off the bit from the '=' to the end, and put all in lower case! (*params)[i].assign(ConvertStringToLower((*params)[i].substr(0, j))); break; } } // Andreas Wilm (UCD): 2008-03-19: // this convert nonarg params to lowercase (-QuIcKtReE etc) if (!has_arg) { (*params)[i].assign(ConvertStringToLower((*params)[i])); } } if(paramArg->size() != params->size()) { cerr << "There is something wrong with arguments. Lengths different\n"; return -1; } /* for each parameter given on the command line, first search the list of recognised optional parameters.... */ for (i = 0; i < num; i++) { if ((i == 0) && (name1 == true)) { continue; } j = 0; match[i] = -1; for(;;) { if (cmdLinePara[j].str[0] == '\0') { // Think this means we have not found it! break; } if (!(*params)[i].compare(cmdLinePara[j].str)) { match[i] = j; // Match has been found! *cmdLinePara[match[i]].flag = i; if ((cmdLinePara[match[i]].type != NOARG) && ((*paramArg)[i] == "")) { cerr << "Error: parameter required for " << default_commandsep << (*params)[i] << endl; return -1; /* Andreas Wilm (UCD) 2008-03-19: * conversion nowadays unnecessary and breaks things * * // JULIE * // convert parameters to lower case now, unless the parameter is a fileName * #ifdef UNIX * else if (cmdLinePara[match[i]].type != FILARG && (*paramArg)[i] != "") * #endif */ } else if (cmdLinePara[match[i]].type != FILARG && (*paramArg)[i] != "") { if ((*paramArg)[i] != "") { // lowercase arg if not a filename to support mixed case (*paramArg)[i].assign(ConvertStringToLower((*paramArg)[i])); } } break; } j++; } } /* ....then the list of recognised input files,.... */ for (i = 0; i < num; i++) { if ((i == 0) && (name1 == true)) { continue; } if (match[i] != -1) { continue; } j = 0; for(;;) { if (cmdLineFile[j].str[0] == '\0') { // Have not found a match! break; } if (!(*params)[i].compare(cmdLineFile[j].str)) { match[i] = j; *cmdLineFile[match[i]].flag = i; if ((cmdLineFile[match[i]].type != NOARG) && ((*paramArg)[i] == "")) { cerr << "Error: parameter required for " << default_commandsep << (*params)[i] << endl; return -1; } break; } j++; } } /* ....and finally the recognised verbs. */ for (i = 0; i < num; i++) { if ((i == 0) && (name1 == true)) { continue; } if (match[i] != -1) { continue; } j = 0; for(;;) { if (cmdLineVerb[j].str[0] == '\0') { // Havent found it! break; } if (!(*params)[i].compare(cmdLineVerb[j].str)) { match[i] = j; *cmdLineVerb[match[i]].flag = i; if ((cmdLineVerb[match[i]].type != NOARG) && ((*paramArg)[i] == "")) { cerr << "Error: parameter required for " << default_commandsep << (*params)[i] << endl; return -1; } break; } j++; } } /* check for any unrecognised parameters. */ for (i = 0; i < num; i++) { if (match[i] == -1) { cerr << "Error: unknown option " << default_commandsep << (*params)[i] << endl; return -1; } } return(num); } void CommandLineParser::setOptionalParam() { int temp; int _ktup, _windgap, _signif, _window = 0; string _matrixname; //int c, i; float ftemp; //char tstr[100]; #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("Setting optional parameters."); } #endif //**************************************************************************** //* look for parameters on command line e.g. gap penalties, k-tuple etc. * //**************************************************************************** // Mark change 16-2-2007. if(setNumIterations != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting num iterations parameter."); } #endif temp = 0; if((*paramArg)[setNumIterations].length() > 0) { if (sscanf((*paramArg)[setNumIterations].c_str(),"%d", &temp) != 1) { reportBadOptionAndExit("numiter", "int"); temp = 0; } } if(temp > 0) { userParameters->setNumIterations(temp); } else { exitWithErrorMsg("Cannot use a negative value for number of iterations."); } } //** ? /score=percent or /score=absolute * if(setScore != -1) { if((*paramArg)[setScore].length() > 0) { temp = findMatch((*paramArg)[setScore], scoreArg, 2); if(temp == 0) { userParameters->setPercent(true); #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting score parameter = percent"); } #endif } else if(temp == 1) { userParameters->setPercent(false); #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting score parameter = absolute"); } #endif } else { cerr << "\nUnknown SCORE type: " << (*paramArg)[setScore] << endl; #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" problem setting score type!!!!!"); } #endif } } } // NOTE I decided to stay with sscanf for getting the int. Options in c++ no better. //** ? /seed=n * if(setSeed != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting seed parameter."); } #endif temp = 0; if((*paramArg)[setSeed].length() > 0) { if (sscanf((*paramArg)[setSeed].c_str(),"%d",&temp) != 1) { reportBadOptionAndExit("seed", "integer"); } } if(temp > 0) { userParameters->setBootRanSeed(temp); } cout<< "\ntemp = " << temp << "; seed = " << userParameters->getBootRanSeed() << ";\n"; } if(setTreeAlgorithm != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting clustering algorithm parameter."); } #endif if((*paramArg)[setTreeAlgorithm].length() > 0) { temp = findMatch((*paramArg)[setTreeAlgorithm], clusterAlgorithm, 2); if(temp == 0) { userParameters->setClusterAlgorithm(NJ); } else if(temp == 1) { userParameters->setClusterAlgorithm(UPGMA); } else { cerr << "Unknown option for clustering algorithm. Using default\n"; userParameters->setClusterAlgorithm(NJ); } } } //** ? /output=PIR, GCG, GDE or PHYLIP * if(setOutput != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting output parameter."); } #endif if((*paramArg)[setOutput].length() > 0) { temp = findMatch((*paramArg)[setOutput], outputArg, 7); if (temp >= 0 && temp <= 6) { userParameters->setOutputClustal(false); userParameters->setOutputGCG(false); userParameters->setOutputPhylip(false); userParameters->setOutputNbrf(false); userParameters->setOutputGde(false); userParameters->setOutputNexus(false); userParameters->setOutputFasta(false); } switch (temp) { case 0: // GCG userParameters->setOutputGCG(true); break; case 1: // GDE userParameters->setOutputGde(true); break; case 2: // PIR userParameters->setOutputNbrf(true); break; case 3: // PHYLIP userParameters->setOutputPhylip(true); break; case 4: // NEXUS userParameters->setOutputNexus(true); break; case 5: // FASTA userParameters->setOutputFasta(true); break; case 6: // CLUSTAL userParameters->setOutputClustal(true); break; default: // FIXME AW: 1.83 behaves the same, but shouldnt // we exit here? exitWithErrorMsg("Unknown OUTPUT type: " + (*paramArg)[setOutput]); } } } //** ? /outputtree=NJ or PHYLIP or DIST or NEXUS if(setOutputTree != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting outputtree parameter."); } #endif if((*paramArg)[setOutputTree].length() > 0) { temp = findMatch((*paramArg)[setOutputTree], outputTreeArg, 4); switch (temp) { case 0: // NJ userParameters->setOutputTreeClustal(true); break; case 1: // PHYLIP userParameters->setOutputTreePhylip(true); break; case 2: // DIST userParameters->setOutputTreeDistances(true); break; case 3: // NEXUS userParameters->setOutputTreeNexus(true); break; default: cerr << "\nUnknown OUTPUT TREE type: " << (*paramArg)[setOutputTree] << endl; } } } //** ? /profile (sets type of second input file to profile) if(setProfile != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting profileType = PROFILE."); } #endif profileType = PROFILE; } //** ? /sequences (sets type of second input file to list of sequences) if(setSequences != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting profileType = SEQUENCE."); } #endif profileType = SEQUENCE; } //** ? /ktuple=n if(setKtuple != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting ktup parameter."); } #endif _ktup = 0; if((*paramArg)[setKtuple].length() > 0) { if (sscanf((*paramArg)[setKtuple].c_str(),"%d",&_ktup)!=1) { reportBadOptionAndExit("ktuple", "integer"); _ktup = 0; } } if(_ktup > 0) { if(userParameters->getDNAFlag()) { if(_ktup <= 4) { userParameters->setKtup(_ktup); userParameters->setDNAKtup(_ktup); userParameters->setWindowGap(_ktup + 4); userParameters->setDNAWindowGap(_ktup + 4); } else { // see comment in bug 185 cerr << "WARNING: Ignoring invalid ktuple of " << _ktup << " (must be <=4)" << std::endl; } } else { if(_ktup <= 2) { userParameters->setKtup(_ktup); userParameters->setAAKtup(_ktup); userParameters->setWindowGap(_ktup + 3); userParameters->setAAWindowGap(_ktup + 3); // AW: why set setDNAWindowGap? we are in AA mode // userParameters->setDNAWindowGap(_ktup + 4); } else { // see comment in bug 185 cerr << "WARNING: Ignoring invalid ktuple of " << _ktup << " (must be <=2)" << std::endl; } } } } //** ? /pairgap=n if(setPairGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting pairgap parameter."); } #endif _windgap = 0; if((*paramArg)[setPairGap].length() > 0) { if (sscanf((*paramArg)[setPairGap].c_str(),"%d",&_windgap)!=1) { reportBadOptionAndExit("pairgap", "integer"); _windgap = 0; } if(_windgap > 0) { if(userParameters->getDNAFlag()) { if(_windgap > userParameters->getKtup()) { userParameters->setWindowGap(_windgap); userParameters->setDNAWindowGap(_windgap); } } else { if(_windgap > userParameters->getKtup()) { userParameters->setWindowGap(_windgap); userParameters->setAAWindowGap(_windgap); } } } } } //** ? /topdiags=n if(setTopDiags != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting topdiags parameter."); } #endif _signif = 0; if((*paramArg)[setTopDiags].length() > 0) { if (sscanf((*paramArg)[setTopDiags].c_str(),"%d",&_signif)!=1) { reportBadOptionAndExit("topdiags", "integer"); } } if(_signif > 0) { if(userParameters->getDNAFlag()) { if(_signif > userParameters->getKtup()) { userParameters->setSignif(_signif); userParameters->setDNASignif(_signif); } } else { if(_signif > userParameters->getKtup()) { userParameters->setSignif(_signif); userParameters->setAASignif(_signif); } } } } //** ? /window=n if(setWindow != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting window parameter."); } #endif _window = 0; if((*paramArg)[setWindow].length() > 0) { if (sscanf((*paramArg)[setWindow].c_str(),"%d",&_window)!=1) { reportBadOptionAndExit("window", "integer"); _window = 0; } } if(_window > 0) { if(userParameters->getDNAFlag()) { if(_window > userParameters->getKtup()) { userParameters->setWindow(_window); userParameters->setDNAWindow(_window); } } else { if(_window > userParameters->getKtup()) { userParameters->setWindow(_window); userParameters->setAAWindow(_window); } } } } //** ? /kimura if(setKimura != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting kimura=true"); } #endif userParameters->setKimura(true); } //** ? /tossgaps if(setTossGaps != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting tossgaps=true"); } #endif userParameters->setTossGaps(true); } //** ? /negative if(setNegative != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting useNegMatrix=true"); } #endif userParameters->setUseNegMatrix(true); } //** ? /noweights if(setNoWeights!= -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting noweights=true"); } #endif userParameters->setNoWeights(true); } //** ? /pwmatrix=ID (user's file) if(setPWMatrix != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting pwmatrix parameter."); } #endif temp = (*paramArg)[setPWMatrix].length(); if(temp > 0) { _matrixname = ConvertStringToLower((*paramArg)[setPWMatrix]); if (_matrixname.compare("blosum") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 1, Protein, Pairwise); } else if (_matrixname.compare("pam") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 2, Protein, Pairwise); } else if (_matrixname.compare("gonnet") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 3, Protein, Pairwise); } else if (_matrixname.compare("id") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 4, Protein, Pairwise); } else { char hackTempName[FILENAMELEN + 1]; strcpy(hackTempName, (*paramArg)[setPWMatrix].c_str()); if(subMatrix->getUserMatFromFile(hackTempName, Protein, Pairwise)) { subMatrix->setCurrentNameAndNum((*paramArg)[setPWMatrix], 5, Protein, Pairwise); pwUserMatrixName = (*paramArg)[setPWMatrix]; } else exit(1); } } } //** ? /matrix=ID (user's file) if(setMatrix != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting matrix parameter."); } #endif temp = (*paramArg)[setMatrix].length(); if(temp > 0) { _matrixname = ConvertStringToLower((*paramArg)[setMatrix]); if (_matrixname.compare("blosum")==0) { subMatrix->setCurrentNameAndNum(_matrixname, 1, Protein, MultipleAlign); } else if (_matrixname.compare("pam")==0) { subMatrix->setCurrentNameAndNum(_matrixname, 2, Protein, MultipleAlign); } else if (_matrixname.compare("gonnet")==0) { subMatrix->setCurrentNameAndNum(_matrixname, 3, Protein, MultipleAlign); } else if (_matrixname.compare("id")==0) { subMatrix->setCurrentNameAndNum(_matrixname, 4, Protein, MultipleAlign); } else { char hackTempName[FILENAMELEN + 1]; strcpy(hackTempName, (*paramArg)[setMatrix].c_str()); if(subMatrix->getUserMatSeriesFromFile(hackTempName)) { subMatrix->setCurrentNameAndNum((*paramArg)[setMatrix], 4, Protein, MultipleAlign); userMatrixName = (*paramArg)[setMatrix]; } else exit(1); } } } //** ? /pwdnamatrix=ID (user's file) if(setPWDNAMatrix != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting pwdnamatrix parameter."); } #endif temp = (*paramArg)[setPWDNAMatrix].length(); if(temp > 0) { _matrixname = ConvertStringToLower((*paramArg)[setPWDNAMatrix]); if (_matrixname.compare("iub") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 1, DNA, Pairwise); } else if (_matrixname.compare("clustalw") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 2, DNA, Pairwise); } else { char hackTempName[FILENAMELEN + 1]; strcpy(hackTempName, (*paramArg)[setPWDNAMatrix].c_str()); if(subMatrix->getUserMatFromFile(hackTempName, DNA, Pairwise)) { subMatrix->setCurrentNameAndNum((*paramArg)[setPWDNAMatrix], 3, Protein, Pairwise); pwDNAUserMatrixName = (*paramArg)[setPWDNAMatrix]; } else exit(1); } } } //** ? /dnamatrix=ID (user's file) if(setDNAMatrix != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting dnamatrix parameter."); } #endif temp = (*paramArg)[setDNAMatrix].length(); if(temp > 0) { _matrixname = ConvertStringToLower((*paramArg)[setDNAMatrix]); if (_matrixname.compare("iub") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 1, DNA, MultipleAlign); } else if (_matrixname.compare("clustalw") == 0) { subMatrix->setCurrentNameAndNum(_matrixname, 2, DNA, MultipleAlign); } else { char hackTempName[FILENAMELEN + 1]; strcpy(hackTempName, (*paramArg)[setDNAMatrix].c_str()); if(subMatrix->getUserMatFromFile(hackTempName, DNA, MultipleAlign)) { subMatrix->setCurrentNameAndNum((*paramArg)[setDNAMatrix], 3, Protein, MultipleAlign); DNAUserMatrixName = (*paramArg)[setDNAMatrix]; } else exit(1); } } } //** ? /maxdiv= n if(setMaxDiv != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting maxdiv parameter."); } #endif temp = 0; if((*paramArg)[setMaxDiv].length() > 0) { if (sscanf((*paramArg)[setMaxDiv].c_str(),"%d",&temp)!=1) { reportBadOptionAndExit("maxdiv", "integer"); temp = 0; } } if (temp >= 0) { userParameters->setDivergenceCutoff(temp); } } //** ? /gapdist= n if(setGapDist != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting gapdist parameter."); } #endif temp = 0; if((*paramArg)[setGapDist].length() > 0) if (sscanf((*paramArg)[setGapDist].c_str(),"%d",&temp)!=1) { reportBadOptionAndExit("gapdist", "integer"); } if (temp >= 0) { userParameters->setGapDist(temp); } } //** ? /debug= n if(setDebug != -1) { temp = 0; if((*paramArg)[setDebug].length() > 0) if (sscanf((*paramArg)[setDebug].c_str(),"%d",&temp)!=1) { reportBadOptionAndExit("debug", "integer"); } if (temp >= 0) { userParameters->setDebug(temp); } } //** ? /outfile= (user's file) if(setOutfile != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting outfile parameter."); } #endif if((*paramArg)[setOutfile].length() > 0) { userParameters->setOutfileName((*paramArg)[setOutfile]); } } //*** ? /case= lower/upper if(setCase != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting case parameter."); } #endif if((*paramArg)[setCase].length() > 0) { temp = findMatch((*paramArg)[setCase], caseArg, 2); if(temp == 0) { userParameters->setLowercase(true); } else if(temp == 1) { userParameters->setLowercase(false); } else { cerr << "\nUnknown case " << (*paramArg)[setCase] << endl; } } } //*** ? /seqnos=off/on if(setSeqNo != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting seqnos parameter."); } #endif if((*paramArg)[setSeqNo].length() > 0) { temp = findMatch((*paramArg)[setSeqNo], seqNoArg, 2); if(temp == 0) { userParameters->setClSeqNumbers(false); } else if(temp == 1) { userParameters->setClSeqNumbers(true); } else { cerr << "\nUnknown SEQNO option " << (*paramArg)[setSeqNo] << endl; } } } if(setSeqNoRange != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting seqno range parameter."); } #endif if((*paramArg)[setSeqNoRange].length() > 0) { temp = findMatch((*paramArg)[setSeqNoRange], seqNoRangeArg, 2); cout << "\n comparing " << "\nparamArg[setSeqNoRange]= " << (*paramArg)[setSeqNoRange] << "\n comparing \n "; if(temp == 0) { userParameters->setSeqRange(false); } else if(temp == 1) { userParameters->setSeqRange(true); } else { cerr << "\nUnknown Sequence range option " << (*paramArg)[setSeqNoRange] << endl; } } } //*** ? /range=n:m if(setRange != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting range parameter."); } #endif temp = 0; if((*paramArg)[setRange].length() > 0) { // NOTE I have made a big change here! Mark march 14th 2006. This was being done // in the Alignment output functions. int iFirstRes = -1; int iLastRes = -1; char ignore; if (sscanf((*paramArg)[setRange].c_str(), "%d%[ :,-]%d", &iFirstRes, &ignore, &iLastRes) != 3) { cerr << "setRange: Syntax Error: Cannot set range, should be from:to \n"; } else { userParameters->setRangeFrom(iFirstRes); userParameters->setRangeTo(iLastRes); } } } //*** ? /gapopen=n if(setGapOpen != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting gapopen parameter."); } #endif ftemp = 0.0; if((*paramArg)[setGapOpen].length() > 0) { if (sscanf((*paramArg)[setGapOpen].c_str(),"%f",&ftemp) != 1) { reportBadOptionAndExit("gapopen", "real number"); ftemp = 0.0; } if(ftemp >= 0.0) { if( userParameters->getDNAFlag()) { userParameters->setGapOpen(ftemp); userParameters->setDNAGapOpen(ftemp); } else { userParameters->setGapOpen(ftemp); userParameters->setProteinGapOpen(ftemp); } } } } //*** ? /gapext=n if(setGapExtend != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting gap extention parameter."); } #endif ftemp = 0.0; if((*paramArg)[setGapExtend].length() > 0) { if (sscanf((*paramArg)[setGapExtend].c_str(),"%f",&ftemp) != 1) { reportBadOptionAndExit("gapext", "real number"); ftemp = 0.0; } if(ftemp >= 0) { if(userParameters->getDNAFlag()) { userParameters->setGapExtend(ftemp); userParameters->setDNAGapExtend(ftemp); } else { userParameters->setGapExtend(ftemp); userParameters->setProteinGapExtend(ftemp); } } } } //*** ? /transweight=n if(setTransWeight != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting transweight parameter."); } #endif ftemp = 0.0; if((*paramArg)[setTransWeight].length() > 0) { if (sscanf((*paramArg)[setTransWeight].c_str(), "%f", &ftemp) != 1) { reportBadOptionAndExit("transweight", "real number"); } } userParameters->setTransitionWeight(ftemp); } //*** ? /pwgapopen=n if(setPWGapOpen != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting pwgapopen parameter."); } #endif ftemp = 0.0; if((*paramArg)[setPWGapOpen].length() > 0) { if (sscanf((*paramArg)[setPWGapOpen].c_str(), "%f", &ftemp) != 1) { reportBadOptionAndExit("pwgapopen", "real number"); } } if(ftemp >= 0.0) { if(userParameters->getDNAFlag()) { userParameters->setPWGapOpen(ftemp); userParameters->setDNAPWGapOpenPenalty(ftemp); } else { userParameters->setPWGapOpen(ftemp); userParameters->setProteinPWGapOpenPenalty(ftemp); } } } //*** ? /gapext=n if(setPWGapExtend != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting pwgapext parameter."); } #endif ftemp = 0.0; if((*paramArg)[setPWGapExtend].length() > 0) { if (sscanf((*paramArg)[setPWGapExtend].c_str(), "%f", &ftemp) != 1) { reportBadOptionAndExit("pwgapext", "real number"); } } if(ftemp >= 0) { if(userParameters->getDNAFlag()) { userParameters->setPWGapExtend(ftemp); userParameters->setDNAPWGapExtendPenalty(ftemp); } else { userParameters->setPWGapExtend(ftemp); userParameters->setProteinPWGapExtendPenalty(ftemp); } } } //*** ? /outorder=n if(setOutOrder != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting outorder parameter."); } #endif if((*paramArg)[setOutOrder].length() > 0) { temp = findMatch((*paramArg)[setOutOrder],outOrderArg,2); } if(temp == 0) { userParameters->setOutputOrder(INPUT); } else if(temp == 1) { userParameters->setOutputOrder(ALIGNED); } else { cerr << "\nUnknown OUTPUT ORDER type " << (*paramArg)[setOutOrder] << endl; } } //*** ? /bootlabels=n if(setBootLabels != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting bootlabels parameter."); } #endif if((*paramArg)[setBootLabels].length() > 0) { temp = findMatch((*paramArg)[setBootLabels], bootLabelsArg, 2); } if(temp == 0) { userParameters->setBootstrapFormat(BS_NODE_LABELS); } else if(temp == 1) { userParameters->setBootstrapFormat(BS_BRANCH_LABELS); } else { cerr << "\nUnknown bootlabels type " << (*paramArg)[setBootLabels] << endl; } } //*** ? /endgaps if(setUseEndGaps != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting useendgaps=true"); } #endif userParameters->setUseEndGaps(false); } //*** ? /nopgap if(setNoPGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting noPrefPenalties=true"); } #endif userParameters->setNoPrefPenalties(true); } //*** ? /nohgap if(setNoHGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting nohgap=true"); } #endif userParameters->setNoHydPenalties(true); } //*** ? /novgap if(setNoVGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting novgap=false"); } #endif userParameters->setNoVarPenalties(false); } //*** ? /hgapresidues="string" // NOTE I have made some big changes here. It looks as if there was an error here! if(setHGapRes != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting hgapresidues parameter."); } #endif userParameters->setHydResidues((*paramArg)[setHGapRes]); } //*** ? /nosecstr1 if(setSecStruct1 != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting useSS1=false"); } #endif userParameters->setUseSS1(false); } //*** ? /nosecstr2 if(setSecStruct2 != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting useSS2=false"); } #endif userParameters->setUseSS2(false); } //*** ? /secstroutput if(setSecStructOutput != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting secstroutput parameter."); } #endif if((*paramArg)[setSecStructOutput].length() > 0) { temp = findMatch((*paramArg)[setSecStructOutput], outputSecStrArg, 4); if(temp >= 0 && temp <= 3) { userParameters->setOutputStructPenalties(temp); } else { cerr << "\nUnknown case " << (*paramArg)[setSecStructOutput] << endl; } } } //*** ? /helixgap= n if(setHelixGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting helixgap parameter."); } #endif temp = 0; if((*paramArg)[setHelixGap].length() > 0) { if (sscanf((*paramArg)[setHelixGap].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("helixgap", "integer"); } } if (temp >= 1 && temp <= 9) { userParameters->setHelixPenalty(temp); } } //*** ? /strandgap= n if(setStrandGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting strandgap parameter."); } #endif temp = 0; if((*paramArg)[setStrandGap].length() > 0) { if (sscanf((*paramArg)[setStrandGap].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("strandgap", "integer"); } } if (temp >= 1 && temp <= 9) { userParameters->setStrandPenalty(temp); } } //*** ? /loopgap= n if(setLoopGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting loopgap parameter."); } #endif temp = 0; if((*paramArg)[setLoopGap].length() > 0) { if (sscanf((*paramArg)[setLoopGap].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("loopgap", "integer"); } } if (temp >= 1 && temp <= 9) { userParameters->setLoopPenalty(temp); } } //*** ? /terminalgap= n if(setTerminalGap != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting terminalgap parameter."); } #endif temp = 0; if((*paramArg)[setTerminalGap].length() > 0) { if (sscanf((*paramArg)[setTerminalGap].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("terminalgap", "integer"); temp = 0; } } if (temp >= 1 && temp <= 9) { userParameters->setHelixEndPenalty(temp); userParameters->setStrandEndPenalty(temp); } } //*** ? /helixendin= n if(setHelixEndIn != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting helixendin parameter."); } #endif temp = 0; if((*paramArg)[setHelixEndIn].length() > 0) { if (sscanf((*paramArg)[setHelixEndIn].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("helixendin", "integer"); temp = 0; } } if (temp >= 0 && temp <= 3) { userParameters->setHelixEndMinus(temp); } } //*** ? /helixendout= n if(setHelixEndOut != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting helixendout parameter."); } #endif temp = 0; if((*paramArg)[setHelixEndOut].length() > 0) { if (sscanf((*paramArg)[setHelixEndOut].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("helixendout", "integer"); temp = 0; } } if (temp >= 0 && temp <= 3) { userParameters->setHelixEndPlus(temp); } } //*** ? /strandendin= n if(setStrandEndIn != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting strandendin parameter."); } #endif temp = 0; if((*paramArg)[setStrandEndIn].length() > 0) { if (sscanf((*paramArg)[setStrandEndIn].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("strandendin", "integer"); } } if (temp >= 0 && temp <= 3) { userParameters->setStrandEndMinus(temp); } } //*** ? /strandendout= n if(setStrandEndOut != -1) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg(" Setting strandendout parameter."); } #endif temp = 0; if((*paramArg)[setStrandEndOut].length() > 0) { if (sscanf((*paramArg)[setStrandEndOut].c_str(), "%d", &temp) != 1) { reportBadOptionAndExit("strandendout", "integer"); } } if (temp >= 0 && temp <= 3) { userParameters->setStrandEndPlus(temp); } } } int CommandLineParser::findMatch(string probe, StringArray* list, int n) { int i, j, len; int count, match=0; len = probe.length(); for (i = 0; i < len; i++) { count = 0; for (j = 0; j < n; j++) { if (probe[i] == (*list)[j][i]) { match = j; count++; } } if (count == 0) { return((int)-1); } if (count == 1) { return(match); } } return((int)-1); } /* * The function getCmdLineDataStruct is used to return a struct with the values * specified. It returns it by value. I cant return by reference or else the object will * be destroyed. */ CmdLineData CommandLineParser::getCmdLineDataStruct(const char *str, int *flag, int type, StringArray* arg) { CmdLineData tempStruct = {str, flag, type, arg}; return tempStruct; } void CommandLineParser::printCmdLineData(const CmdLineData& temp) { std::cout << "The str is: " << temp.str << std::endl; std::cout << "The int* is: " << *(temp.flag) << std::endl; std::cout << "The type is: " << temp.type << std::endl; std::cout << "The StringArray is: " << std::endl; if(temp.arg == NULL) { std::cout << " NULL" << std::endl; } else { cout << "The number of elements is " << temp.arg->size() << std::endl; for(int i = 0; i < (int)temp.arg->size(); i++) { cout << "The " << i << "th element is: " << temp.arg->at(i) << endl; } } } /* * Helper function to change string to lower case. * */ string CommandLineParser::ConvertStringToLower(string strToConvert) { for(unsigned int i=0;i #include #include "../Clustal.h" #include "../general/clustalw.h" #include "../general/userparams.h" #include "../general/utils.h" #include "../general/debuglogObject.h" #include "../general/statsObject.h" namespace clustalw { typedef std::vector StringArray; typedef struct { const char *str; int *flag; int type; StringArray* arg; } CmdLineData; class CommandLineParser { public: /* Functions */ CommandLineParser(StringArray* args, bool xmenus); ~CommandLineParser(); private: /* Functions */ /** separate argument options and values * * put all the parameters and their values in the * vectors, and also to check that all parameters that require a value * have it. * * @param args contains parameters as value and optional option pairs * @param parameters used for storing parsed arguments * @param paramArgs used for storing values of parsed arguments * @return number of parsed parameters or -1 on error */ int checkParam(StringArray* args, StringArray* params, StringArray* paramArg); /** Parse all parameters */ void parseParams(StringArray* args, bool xmenus); void setOptionalParam(); int findMatch(string probe, StringArray* list, int n); CmdLineData getCmdLineDataStruct(const char *str, int *flag, int type, StringArray* arg); void printCmdLineData(const CmdLineData& temp); string ConvertStringToLower(string strToConvert); void exitWithErrorMsg(string msg); void reportBadOptionAndExit(string option, string expectedType); void reportInvalidOptionAndExit(string option); /* Attributes */ Clustal *clustalObj; static const int MAXARGS = 100; static const int NOARG = 0; static const int INTARG = 1; static const int FLTARG = 2; static const int STRARG = 3; static const int FILARG = 4; static const int OPTARG = 5; int setOptions; int setHelp; int setFullHelp; int setQuiet; int setInteractive; int setBatch; int setGapOpen; int setGapExtend; int setPWGapOpen; int setPWGapExtend; int setOutOrder; int setBootLabels; int setPWMatrix; int setMatrix; int setPWDNAMatrix; int setDNAMatrix; int setNegative; int setNoWeights; int setOutput; int setOutputTree; int setQuickTree; int setType; int setCase; int setSeqNo; int setSeqNoRange; int setRange; int setTransWeight; int setSeed; int setScore; int setWindow; int setKtuple; int setKimura; int setTopDiags; int setPairGap; int setTossGaps; int setNoPGap; int setNoHGap; int setNoVGap; int setHGapRes; int setUseEndGaps; int setMaxDiv; int setGapDist; int setDebug; int setOutfile; int setInfile; int setProfile1; int setProfile2; int setAlign; int setConvert; int setNewTree; int setUseTree; int setNewTree1; int setUseTree1; int setNewTree2; int setUseTree2; int setBootstrap; int setTree; int setProfile; int setSequences; int setSecStruct1; int setSecStruct2; int setSecStructOutput; int setHelixGap; int setStrandGap; int setLoopGap; int setTerminalGap; int setHelixEndIn; int setHelixEndOut; int setStrandEndIn; int setStrandEndOut; int profileType; int setDoIteration; int setNumIterations; int setTreeAlgorithm; int setMaxSeqLen; int setStatsFile; int setOutputPim; string userMatrixName; string pwUserMatrixName; string DNAUserMatrixName; string pwDNAUserMatrixName; CmdLineData cmdLineFile[4]; CmdLineData cmdLineVerb[20]; CmdLineData cmdLinePara[56]; string clustalTreeName; string distTreeName; string phylipTreeName; string nexusTreeName; string p1TreeName; string p2TreeName; string pimName; StringArray* typeArg; StringArray* bootLabelsArg; StringArray* outOrderArg; StringArray* caseArg; StringArray* seqNoArg; StringArray* seqNoRangeArg; StringArray* scoreArg; StringArray* outputArg; StringArray* outputTreeArg; StringArray* outputSecStrArg; StringArray* cmdLineType; StringArray* clusterAlgorithm; StringArray* iterationArg; StringArray* params; // parameter names StringArray* paramArg; // parameter values }; } #endif clustalw-2.1/src/interface/InteractiveMenu.h0000644000175000017500000000323211442167171016141 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Mark Larkin 12 Dec 2005. * Interactive menu class. It uses the object userParameters for * all the session variables. */ #ifndef INTERACTIVEMENU_H #define INTERACTIVEMENU_H #include #include "../Clustal.h" #include "../general/clustalw.h" #include "../general/userparams.h" #include "../general/utils.h" #include "../substitutionMatrix/globalmatrix.h" namespace clustalw { using namespace std; class InteractiveMenu { public: /* Functions */ InteractiveMenu(); ~InteractiveMenu(); void mainMenu(); /* Attributes */ private: /* Functions */ void doSystem(); void multipleAlignMenu(); void profileAlignMenu(); void ssOptionsMenu(); int secStrOutputOptions(); void phylogeneticTreeMenu(); void treeFormatOptionsMenu(); void formatOptionsMenu(); void pairwiseMenu(); void multiMenu(); void gapPenaltiesMenu(); int readMatrix(int alignResidueType, int alignType, MatMenu menu); void clusteringAlgorithmMenu(); void iterationMenu(); /* Attributes */ Clustal* clustalObj; string phylipName; string clustalName; string distName; string nexusName; //string fasta_name; string p1TreeName; string p2TreeName; string secStructOutputTxt[4]; // Changed to a string array string lin1; MatMenu dnaMatrixMenu; MatMenu matrixMenu; MatMenu pwMatrixMenu; char choice; }; } #endif clustalw-2.1/src/config.h.in0000644000175000017500000000423011457312537012754 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `mhash' library (-lmhash). */ #undef HAVE_LIBMHASH /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_MHASH_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Host OS */ #undef OS_MAC /* Host OS */ #undef OS_UNIX /* Host OS */ #undef OS_WINDOWS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `unsigned int' if does not define. */ #undef size_t clustalw-2.1/src/tree/0000755000175000017500000000000011467270447011755 500000000000000clustalw-2.1/src/tree/UPGMA/0000755000175000017500000000000011467270447012626 500000000000000clustalw-2.1/src/tree/UPGMA/Node.cpp0000644000175000017500000000440611442167171014133 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "Node.h" #include "../../general/VectorUtility.h" #include "../../general/debuglogObject.h" #include "../../general/clustalw.h" #include #include namespace clustalw { Node::Node(int _seqNum, double *dists, int numDist) : next(0), left(0), right(0), size(1), seqNum(_seqNum), height(0.0), ptrToDistMatRow(dists), minDist(numeric_limits::max()), indexToMinDist(-1), numDists(numDist), order(0) { allElements.resize(1); allElements[0] = seqNum; if (ptrToDistMatRow) { findMinDist(); } } void Node::merge(Node **rightNode, double _height) { left = new Node(*this); right = *rightNode; left->ptrToDistMatRow = 0; size = left->size + right->size; seqNum = -1; height = _height; left->height = height; right->height = height; vectorutils::mergeVectors(&allElements, &(right->allElements)); right->allElements.clear(); if (next == right) { next = right->next; } else { *rightNode = right->next; } } void Node::findMinDist() { double *distIterator = ptrToDistMatRow; double *minDistSoFar = distIterator++; // We search from the end of our area of the array for(int i = numDists; --i; distIterator++) // When --i gets to zero it will stop { if ((*distIterator >= 0) && (*distIterator < *minDistSoFar)) { minDistSoFar = distIterator; } } minDist = *minDistSoFar; indexToMinDist = minDistSoFar - ptrToDistMatRow; } void Node::printElements() { for(int i = 0; i < (int)allElements.size(); i++) { cout << " " << allElements[i]; } cout << "\n"; } string Node::elementsToString() { ostringstream elems; for(int i = 0; i < (int)allElements.size(); i++) { elems << " " << allElements[i]; } return elems.str(); } void Node::makeEmpty() { makeEmpty(this); } void Node::makeEmpty(Node* t) { if(t != 0) { makeEmpty(t->left); makeEmpty(t->right); delete t; } t = 0; } } clustalw-2.1/src/tree/UPGMA/upgmadata.h0000644000175000017500000000056411442167171014657 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef UPGMADATA_H #define UPGMADATA_H struct distMatRow { distMatRow(double* p, int n) { ptrToDistMatRow = p; numDists = n; } double* ptrToDistMatRow; int numDists; }; const int BLANKDIST = -1; const int INTERNAL = -1; #endif clustalw-2.1/src/tree/UPGMA/RootedClusterTree.h0000644000175000017500000000141511442167171016326 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef ROOTEDCLUSTERTREE_H #define ROOTEDCLUSTERTREE_H #include "../ClusterTree.h" #include "RootedGuideTree.h" #include "../AlignmentSteps.h" namespace clustalw { class RootedClusterTree : private ClusterTree { public: //RootedClusterTree(); /** * NOTE these will have different signatures!!!! */ void treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr); auto_ptr treeFromDistMatrix(RootedGuideTree* phyloTree, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string& phylipName); }; } #endif clustalw-2.1/src/tree/UPGMA/Node.h0000644000175000017500000000444111442167171013577 00000000000000#ifndef _NODE_H #define _NODE_H #include #include #include #include "upgmadata.h" namespace clustalw { using namespace std; class Node { public: Node(int seqNum, double *aptrToDistMatRow, int numDists); double getDist(int index){return ptrToDistMatRow[index];} void setDist(int index, double dist){ptrToDistMatRow[index] = dist;} double* getPtrToDistMatRow(){return ptrToDistMatRow;} void setDistMatRowToNull(){ptrToDistMatRow = 0;} int getNumDists(){return numDists;} double getMinDist(){return minDist;} int getIndexToMinDist(){return indexToMinDist;} void setMinDist(int index, double d){indexToMinDist = index; minDist = d;} int getOrder(){return order;} void setOrder(int o){order = o;} int getSeqNum(){return seqNum;} void setSeqNum(int sNum){seqNum = sNum;} void printNodeInfo(); void printDistMatRow(); void printMinDist(); string elementsToString(); Node* getLeft(){return left;} Node* getRight(){return right;} void setLeft(Node* l){left = l;} void setRight(Node* r){right = r;} double getHeight(){return height;} void setHeight(double h){height = h;} vector* getPtrToElements(){return &allElements;} int getFirstElement(){return allElements[0];} void clearElements(){allElements.clear();} int getFirstElem(){return allElements[0];} bool isLeafNode() { if(left == 0 && right == 0) { return true; } else { return false; } } void merge(Node **rightNode, double _height); void findMinDist(); void printElements(); void makeEmpty(); void makeEmpty(Node* t); /* Attributes */ Node *next; // For linked list of nodes Node *left, *right; int size; int seqNum; double height; vector allElements; // THis is for the groups!!! double *ptrToDistMatRow; double minDist; // minimal distance int indexToMinDist; // index of minimal distance int numDists; int order; }; } #endif clustalw-2.1/src/tree/UPGMA/RootedTreeOutput.cpp0000644000175000017500000001054211442167171016541 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RootedTreeOutput.h" namespace clustalw { RootedTreeOutput::RootedTreeOutput(SeqInfo* seqInfo) { firstSeq = seqInfo->firstSeq; lastSeq = seqInfo->lastSeq; numSeqs = seqInfo->numSeqs; } void RootedTreeOutput::printPhylipTree(RootedGuideTree* tree, ofstream* ptrToFile, Alignment *alignPtr, DistMatrix* distMat) { if(!ptrToFile || !ptrToFile->is_open()) { return; } //cerr << "\n******************* DEBUG AW RootedTreeOutput::printPhylipTree: we only get here when using UPGMA with >2 seqs. Why?\n"; // If we have only 2 sequences, use the distances in the distMat if (lastSeq - firstSeq + 1 == 2) { (*ptrToFile) << "(" << alignPtr->getName(firstSeq) << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << "," << alignPtr->getName(firstSeq + 1) << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) ; // << ")"; // AW 2009-05-15: final ")" added here, but not tested // when is this ever used? tried // infile=test.aln -clustering=nj|upgma // on pairwise input, but this is only called for multiple // input. why? } else { // AW 2009-05-08: fixed bug 155 by removing unnecessary, extra // outer parenthesis from output phylipTraverse(ptrToFile, alignPtr, tree->getRoot()); } (*ptrToFile) << ";\n"; } void RootedTreeOutput::printNexusTree(RootedGuideTree* tree, ofstream* ptrToFile, Alignment *alignPtr, DistMatrix* distMat) { if(!ptrToFile || !ptrToFile->is_open()) { return; } (*ptrToFile) << "#NEXUS\n\n"; (*ptrToFile) << "BEGIN TREES;\n\n"; (*ptrToFile) << "\tTRANSLATE\n"; for(int j = 1; j < numSeqs; j++) { (*ptrToFile) << "\t\t" << j << "\t" << alignPtr->getName(j) <<",\n"; } (*ptrToFile) << "\t\t" << numSeqs << "\t" << alignPtr->getName(numSeqs) << "\n"; (*ptrToFile) << "\t\t;\n"; (*ptrToFile) << "\tUTREE PAUP_1= "; // IF we have only 2 seqs if (lastSeq - firstSeq + 1 == 2) { (*ptrToFile) << "(" << alignPtr->getName(firstSeq) << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << "," << alignPtr->getName(firstSeq + 1) << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1); } else { (*ptrToFile) << "("; nexusTraverse(ptrToFile, alignPtr, tree->getRoot()); } (*ptrToFile) << ");\n"; (*ptrToFile) << "\nENDBLOCK;\n"; } /** * PRIVATE FUNCTIONS */ void RootedTreeOutput::phylipTraverse(ofstream* ptrToFile, Alignment *alignPtr, Node* t) { if(!ptrToFile) { return; } if(t != 0) { if(t->isLeafNode()) { if(alignPtr) { (*ptrToFile) << alignPtr->getName(t->getSeqNum()) << ":" << t->getHeight(); } else { (*ptrToFile) << t->getSeqNum() << ":" << t->getHeight(); } } else // Internal node { (*ptrToFile) << "(\n"; phylipTraverse(ptrToFile, alignPtr, t->getLeft()); (*ptrToFile) << ",\n"; phylipTraverse(ptrToFile, alignPtr, t->getRight()); (*ptrToFile) << "):" << t->getHeight(); } } } void RootedTreeOutput::nexusTraverse(ofstream* ptrToFile, Alignment *alignPtr, Node* t) { if(t != 0) { if(!t->isLeafNode()) // Internal node { (*ptrToFile) << "("; nexusTraverse(ptrToFile, alignPtr, t->getLeft()); (*ptrToFile) << ","; nexusTraverse(ptrToFile, alignPtr, t->getRight()); (*ptrToFile) << "):" << t->getHeight(); } else // Leaf node { if(alignPtr) { (*ptrToFile) << alignPtr->getName(t->getSeqNum()) << ":" << t->getHeight(); } else { (*ptrToFile) << t->getSeqNum() << ":" << t->getHeight(); } } } } } clustalw-2.1/src/tree/UPGMA/RootedGuideTree.cpp0000644000175000017500000000712111442167171016275 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "RootedGuideTree.h" #include "../../general/userparams.h" using namespace std; namespace clustalw { RootedGuideTree::RootedGuideTree() : root(0){ } RootedGuideTree::RootedGuideTree(Node* r) : root(r) { } RootedGuideTree::~RootedGuideTree() { root->makeEmpty(); } void RootedGuideTree::setRoot(Node* r) { makeEmpty(); root = r; } void RootedGuideTree::makeEmpty() { root->makeEmpty(); } void RootedGuideTree::orderNodes() { calcOrderNode(root); } int RootedGuideTree::calcOrderNode(Node* node) { if(node != 0) { if(node->getLeft() == 0 && node->getRight() == 0) // Leaf Node { node->setOrder(1); return 1; } else // Internal node { node->setOrder(calcOrderNode(node->getLeft()) + calcOrderNode(node->getRight())); return node->getOrder(); } } return 0; } void RootedGuideTree::calcSeqWeights(int firstSeq, int lastSeq, vector* seqWeights) { if((int)seqWeights->size() < lastSeq - 1) { seqWeights->resize(lastSeq - 1); } int i = 0, _nSeqs = 0; int temp = 0, sum = 0; // // If there are more than three sequences.... // _nSeqs = lastSeq - firstSeq; if ((_nSeqs >= 2) && (userParameters->getDistanceTree() == true) && (userParameters->getNoWeights() == false)) { // // Calculate sequence weights based on Phylip tree. // orderNodes(); calcWeights(seqWeights); // // Normalise the weights, such that the sum of the weights = INT_SCALE_FACTOR // sum = 0; for (i = firstSeq; i < lastSeq; i++) { sum += (*seqWeights)[i]; } if (sum == 0) { for (i = firstSeq; i < lastSeq; i++) { (*seqWeights)[i] = 1; } sum = i; } for (i = firstSeq; i < lastSeq; i++) { (*seqWeights)[i] = ((*seqWeights)[i] * INT_SCALE_FACTOR) / sum; if ((*seqWeights)[i] < 1) { (*seqWeights)[i] = 1; } } } else { // // Otherwise, use identity weights. // temp = INT_SCALE_FACTOR / _nSeqs; // AW 2009-07-09: goes wrong if we have more than // INT_SCALE_FACTOR seqs. if so, set to 1, just as above // same as in Tree.cpp if (temp < 1) temp = 1; for (i = firstSeq; i < lastSeq; i++) { (*seqWeights)[i] = temp; } } } void RootedGuideTree::calcWeights(vector* seqWeights) { vector weights; int sizeSeqWeights = seqWeights->size(); weights.resize(sizeSeqWeights, 0.0); doWeightCalc(0.0, &weights, root); for(int i = 0; i < sizeSeqWeights; i++) { (*seqWeights)[i] = static_cast(weights[i] * 100); } } void RootedGuideTree::doWeightCalc(float weightSoFar, vector* weights, Node* t) { if(t != 0) { if(t->getLeft() == 0 && t->getRight() == 0) // Leaf Node { (*weights)[t->getSeqNum() - 1] = weightSoFar; } else // Internal node { float w = weightSoFar + (t->getHeight() / t->getOrder()); doWeightCalc(w, weights, t->getLeft()); doWeightCalc(w, weights, t->getRight()); } } } } clustalw-2.1/src/tree/UPGMA/RootedGuideTree.h0000644000175000017500000000175311442167171015747 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * mark May 8th 2007: removed makeEmpty(Node* t function), changed makeEmpty(). I also * made changes to any functions that accessed Node's data members */ #ifndef ROOTEDGUIDETREE_H #define ROOTEDGUIDETREE_H #include "Node.h" #include #include "../../alignment/Alignment.h" namespace clustalw { using namespace std; class RootedGuideTree { public: RootedGuideTree(); RootedGuideTree(Node* root); ~RootedGuideTree(); void setRoot(Node* r); void makeEmpty(); void calcSeqWeights(int firstSeq, int lastSeq, vector* seqWeights); Node* getRoot(){return root;} private: void orderNodes(); int calcOrderNode(Node* node); void calcWeights(vector* seqWeights); void doWeightCalc(float weightSoFar, vector* seqWeights, Node* t); Node* root; }; } #endif clustalw-2.1/src/tree/UPGMA/RootedClusterTree.cpp0000644000175000017500000001516611442167171016671 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RootedClusterTree.h" #include "../../general/OutputFile.h" #include "UPGMAAlgorithm.h" #include "RootedTreeOutput.h" //#include "../RandomGenerator.h" namespace clustalw { auto_ptr RootedClusterTree::treeFromDistMatrix(RootedGuideTree* phyloTree,DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string& phylipName) { OutputFile phylipPhyTreeFile; auto_ptr progSteps; try { // Test to see if the inputs are valid if(seq1 < 1 || nSeqs < 1) { cerr << "Invalid inputs into treeFromDistMatrix \n" << "seq1 = " << seq1 << " nSeqs = " << nSeqs << "\n" << "Need to end program!\n"; exit(1); return progSteps; } float dist; string path; verbose = false; firstSeq = seq1; lastSeq = firstSeq + nSeqs - 1; SeqInfo info; info.firstSeq = firstSeq; info.lastSeq = lastSeq; info.numSeqs = nSeqs; utilityObject->getPath(userParameters->getSeqName(), &path); if(nSeqs >= 2) { string name = phylipName; if(!phylipPhyTreeFile.openFile(&name, "\nEnter name for new GUIDE TREE file ", &path, "dnd", "Guide tree")) { return progSteps; } phylipName = name; } else { return progSteps; } RootedTreeOutput outputTree(&info); ofstream* ptrToFile = phylipPhyTreeFile.getPtrToFile(); if (nSeqs == 2) { dist = (*distMat)(firstSeq, firstSeq + 1) / 2.0; if(ptrToFile->is_open()) { (*ptrToFile) << "(" << alignPtr->getName(firstSeq) << ":" << setprecision(5) << dist << "," << alignPtr->getName(firstSeq + 1) << ":" << setprecision(5) << dist <<");\n"; } progSteps.reset(new AlignmentSteps); vector groups; groups.resize(nSeqs + 1, 0); groups[1] = 1; groups[2] = 2; } else { UPGMAAlgorithm clusAlgorithm; progSteps = clusAlgorithm.generateTree(phyloTree, distMat, &info, false); outputTree.printPhylipTree(phyloTree, ptrToFile, alignPtr, distMat); } return progSteps; } catch(const exception &ex) { cerr << "ERROR: Error has occured in treeFromDistMatrix. " << "Need to terminate program.\n" << ex.what(); exit(1); } catch(...) { cerr << "ERROR: Error has occured in treeFromDistMatrix. " << "Need to terminate program.\n"; exit(1); } } void RootedClusterTree::treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr) { try { OutputFile phylipPhyTreeFile; OutputFile clustalPhyTreeFile; OutputFile distancesPhyTreeFile; OutputFile nexusPhyTreeFile; OutputFile pimFile; RootedGuideTree phyloTree; string path; int j; int overspill = 0; int totalDists; numSeqs = alignPtr->getNumSeqs(); // NOTE class variable /** * Check if numSeqs is ok */ if(!checkIfConditionsMet(numSeqs, 2)) { return; } firstSeq = 1; lastSeq = numSeqs; // The SeqInfo struct is passed to reduce the number of parameters passed! SeqInfo info; info.firstSeq = firstSeq; info.lastSeq = lastSeq; info.numSeqs = numSeqs; RootedTreeOutput outputTree(&info); // No bootstrap! utilityObject->getPath(userParameters->getSeqName(), &path); /** * Open the required output files. */ if(!openFilesForTreeFromAlignment(&clustalPhyTreeFile, &phylipPhyTreeFile, &distancesPhyTreeFile, &nexusPhyTreeFile, &pimFile, treeNames, &path)) { return; // Problem opeing one of the files, cannot continue! } int _lenFirstSeq = alignPtr->getSeqLength(firstSeq); bootPositions.clear(); bootPositions.resize(_lenFirstSeq + 2); for (j = 1; j <= _lenFirstSeq; ++j) { bootPositions[j] = j; } /** * Calculate quickDist and overspill */ overspill = calcQuickDistMatForAll(clustalPhyTreeFile.getPtrToFile(), phylipPhyTreeFile.getPtrToFile(), nexusPhyTreeFile.getPtrToFile(), pimFile.getPtrToFile(), distancesPhyTreeFile.getPtrToFile(), alignPtr); // check if any distances overflowed the distance corrections if (overspill > 0) { totalDists = (numSeqs *(numSeqs - 1)) / 2; overspillMessage(overspill, totalDists); } if (userParameters->getOutputTreeClustal()) { verbose = true; } // Turn on file output if (userParameters->getOutputTreeClustal() || userParameters->getOutputTreePhylip() || userParameters->getOutputTreeNexus()) { UPGMAAlgorithm clusAlgorithm; clusAlgorithm.setVerbose(true); clusAlgorithm.generateTree(&phyloTree, quickDistMat.get(), &info, false, clustalPhyTreeFile.getPtrToFile()); clusAlgorithm.setVerbose(false); } if (userParameters->getOutputTreePhylip()) { outputTree.printPhylipTree(&phyloTree, phylipPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get()); } if (userParameters->getOutputTreeNexus()) { outputTree.printNexusTree(&phyloTree, nexusPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get()); } /** Free up resources!!!!! */ treeGaps.clear(); bootPositions.clear(); } catch(const exception& ex) { cerr << ex.what() << endl; utilityObject->error("Terminating program. Cannot continue\n"); exit(1); } } } clustalw-2.1/src/tree/UPGMA/UPGMAAlgorithm.cpp0000644000175000017500000003367711442167171016002 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "UPGMAAlgorithm.h" #include #include #include #include #include "../../general/SymMatrix.h" #include "../../general/debuglogObject.h" #include "../../general/clustalw.h" #include "upgmadata.h" namespace clustalw { UPGMAAlgorithm::UPGMAAlgorithm() : overwriteMatrix(false), numSeqs(0), verbose(false), orderNode1(0), orderNode2(0), orderNewNode(0) {} auto_ptr UPGMAAlgorithm::generateTree(RootedGuideTree* phyTree, DistMatrix* distMat, SeqInfo* seqInfo, bool overwrite, ofstream* tree) { if (tree == 0 || !tree->is_open()) { verbose = false; } if (verbose) { (*tree) << "\n\n\t\t\tUPGMA Method\n" << "\n\n This is a ROOTED tree\n" << "\n Numbers in parentheses are branch lengths\n\n"; } progSteps.reset(new AlignmentSteps); Node** clusters; Node* root; numSeqs = seqInfo->numSeqs; const int sizeDistMat = ((numSeqs + 1) * (numSeqs + 2)) / 2; double* elements = overwrite ? distMat->getDistMatrix(seqInfo->firstSeq, seqInfo->numSeqs) : (double *)memcpy(new double[sizeDistMat], distMat->getDistMatrix(seqInfo->firstSeq, seqInfo->numSeqs), sizeDistMat * sizeof(double)); clusters = initialiseNodes(elements, seqInfo->firstSeq); root = doUPGMA(clusters, tree); phyTree->setRoot(root); delete [] clusters; if(!overwrite) { delete [] elements; } distMat->clearSubArray(); return progSteps; } Node** UPGMAAlgorithm::initialiseNodes(double* distanceMatrix, int fSeq) { int firstSeq = fSeq; Node** nodes = new Node*[numSeqs]; Node** nodeIter = nodes; *nodes = new Node(firstSeq, 0, 0); distanceMatrix++; // Move to first position in distanceMatrix. for(int elementIndex = 1, e = numSeqs; elementIndex < e; distanceMatrix += ++elementIndex) { Node* newcluster = new Node(elementIndex + firstSeq, distanceMatrix, elementIndex); (*nodeIter++)->next = newcluster; *nodeIter = newcluster; } return nodes; } void UPGMAAlgorithm::printAllNodes(Node** nodes) { int numNodes = 0; for(Node* nodeIter = *nodes; nodeIter; nodeIter = nodeIter->next) { numNodes++; cout << "Node " << numNodes << "\n"; nodeIter->printElements(); cout << "\n\n"; } cout << "There are " << numNodes << " nodes\n"; } Node* UPGMAAlgorithm::doUPGMA(Node** nodes, ofstream* tree) { if (tree == 0 || !tree->is_open()) { verbose = false; } string type1, type2; int step = 0; while((*nodes)->next) // While there is more than 1 node. { step++; if (verbose) { (*tree) << "\n Cycle" << setw(4) << step << " = "; } Node** ptrNodeWithMin; /** * STEP 1 find node with min distance */ ptrNodeWithMin = getNodeWithMinDist(nodes); Node* nodeToJoin2 = *ptrNodeWithMin; const int indexToMinDist = nodeToJoin2->indexToMinDist; Node* const nodeToJoin1 = nodes[indexToMinDist]; orderNode1 = nodeToJoin1->size; orderNode2 = nodeToJoin2->size; orderNewNode = orderNode1 + orderNode2; /** * STEP 2 Recompute the dist Matrix row for nodeToJoin1 * example: Join nodes 2 and 6 * * 1 0 * 2 X 0 * 3 0 0 0 * 4 0 0 0 0 * 5 0 0 0 0 0 * 6 0 0 0 0 0 0 * 7 0 0 0 0 0 0 0 */ double* nodeToJoin2DistIter = nodeToJoin2->ptrToDistMatRow; if (indexToMinDist != 0) { recomputeNodeToJoin1DistMatRow(nodeToJoin1, &nodeToJoin2DistIter); } /** * STEP 3 Recompute all distances in column * example: Join nodes 2 and 6 * * 1 0 * 2 C 0 * 3 0 X 0 * 4 0 X 0 0 * 5 0 X 0 0 0 * 6 0 0 0 0 0 0 * 7 0 X 0 0 0 0 0 */ computeAllOtherDistsToNewNode(nodeToJoin1, nodeToJoin2, &nodeToJoin2DistIter); /** * STEP 4 Add the step to the progSteps. * This creates the multiple alignment steps. */ addAlignmentStep(&nodeToJoin1->allElements, &nodeToJoin2->allElements); double minDistance = (*ptrNodeWithMin)->minDist; double height = 0.0; height = minDistance / 2.0; if(verbose) { if(nodeToJoin1->allElements.size() > 1) { type1 = "NODE: "; } else { type1 = "SEQ: "; } if(nodeToJoin2->allElements.size() > 1) { type2 = "NODE: "; } else { type2 = "SEQ: "; } (*tree) << type1 << nodeToJoin1->allElements[0] << " (" << setw(9) << setprecision(5) << height << ") joins " << type2 << setw(4) << nodeToJoin2->allElements[0] << " (" << setw(9) << setprecision(5) << height << ")"; } /** * STEP 5 merge 2 nodes */ nodeToJoin1->merge(ptrNodeWithMin, height); } return *nodes; } /** * This function returns a Node object that has the minimum distance of * all the nodes left. */ Node** UPGMAAlgorithm::getNodeWithMinDist(Node** nodes) { Node** ptrMinNode = NULL; double minDistance = numeric_limits::max(); //Start at node 1, check see if it points to something, then move on the next one. Node** nodeIter; for(nodeIter = &((*nodes)->next); *nodeIter; nodeIter = &(*nodeIter)->next) { if ((*nodeIter)->getMinDist() < minDistance) { minDistance = (*nodeIter)->getMinDist(); ptrMinNode = nodeIter; // ptrMinNode will hold a ptr to node with sm'st dist } } return ptrMinNode; } /** * This function is used to recompute the nodeToJoin1 dist mat row. Each row in the distance * matrix has the distances to all nodes before it, not after. For example the dist mat row * for Node 3 would have the distances to nodes 1 and 2. * 1 0 * 2 0 0 * 3 X X 0 Dists to node 1 and 2. * 4 0 0 0 0 * 5 0 0 0 0 0 * 6 0 0 0 0 0 0 * 7 0 0 0 0 0 0 0 */ void UPGMAAlgorithm::recomputeNodeToJoin1DistMatRow(Node* nodeToJoin1, double** nodeToJoin2DistIter) { double* nodeToJoin1DistIter = nodeToJoin1->ptrToDistMatRow; // calculate new distance *nodeToJoin1DistIter = calcNewDist(*nodeToJoin1DistIter, **nodeToJoin2DistIter); const double* minIndex1 = nodeToJoin1DistIter; nodeToJoin1DistIter++; (*nodeToJoin2DistIter)++; int numDistToUpdate = nodeToJoin1->numDists - 1; // For each of the distances in nodeToJoin1 while(numDistToUpdate > 0) { if (*nodeToJoin1DistIter >= 0) { // Calculate the average *nodeToJoin1DistIter = calcNewDist(*nodeToJoin1DistIter, **nodeToJoin2DistIter); if (*nodeToJoin1DistIter < *minIndex1) { minIndex1 = nodeToJoin1DistIter; } } nodeToJoin1DistIter++; (*nodeToJoin2DistIter)++; numDistToUpdate--; } // We have found the minimum distance nodeToJoin1->minDist = *minIndex1; nodeToJoin1->indexToMinDist = minIndex1 - nodeToJoin1->ptrToDistMatRow; } /** * This function is used to recompute all the other distances. It does this by calling * two other functions. We first compute all the distances until we get to node 2. * Then we call another function to do the rest. This is because nodes after node 2 may * have had EITHER node1 of node2 as their min distance. */ void UPGMAAlgorithm::computeAllOtherDistsToNewNode(Node* nodeToJoin1, Node* nodeToJoin2, double** nodeToJoin2DistIter) { computeDistsUpToNodeToJoin2(nodeToJoin1, nodeToJoin2, nodeToJoin2DistIter); computeDistsForNodesAfterNode2(nodeToJoin2); } /** * STEP 3A: * This function recomputes the distances in column until we get to nodeToJoin2 * example: Join nodes 2 and 6 * * 1 0 * 2 C 0 * 3 0 X 0 * 4 0 X 0 0 * 5 0 X 0 0 0 * 6 0 0 0 0 0 0 * 7 0 0 0 0 0 0 0 * * For each node until we get to nodeToJoin2 * If newdistance is less than the old min distance, set it to this. * else if its greater than old minDist and indexTominDist is the same, recompute min * else leave the min the same as it hasnt changed. */ void UPGMAAlgorithm::computeDistsUpToNodeToJoin2(Node* nodeToJoin1, Node* nodeToJoin2, double** nodeToJoin2DistIter) { const int indexToMinDist = nodeToJoin2->indexToMinDist; movePtrPastUnusedDistances(nodeToJoin2DistIter); Node* nodeIter; // For each node until we get to the second node we are joining for(nodeIter = nodeToJoin1->next; nodeIter != nodeToJoin2; nodeIter = nodeIter->next) { (*nodeToJoin2DistIter)++; // Skip the distance to the node we are joining with movePtrPastUnusedDistances(nodeToJoin2DistIter); double distToNode = nodeIter->ptrToDistMatRow[indexToMinDist]; double newDistToNode = calcNewDist(distToNode, **nodeToJoin2DistIter); nodeIter->ptrToDistMatRow[indexToMinDist] = newDistToNode; if (newDistToNode < nodeIter->minDist) { /** new value is smaller than current min. */ nodeIter->minDist = newDistToNode; nodeIter->indexToMinDist = indexToMinDist; } else if ((newDistToNode > nodeIter->minDist) && (nodeIter->indexToMinDist == indexToMinDist)) { /** indexToMinDist was the min dist, but it is now a larger num, recompute */ nodeIter->findMinDist(); } } } /** * STEP 3B Recompute distance for nodes after nodeToJoin2 * example: Join nodes 2 and 6 * * 1 0 * 2 C 0 * 3 0 C 0 * 4 0 C 0 0 * 5 0 C 0 0 0 * 6 0 0 0 0 0 0 * 7 0 X 0 0 0 0 0 * * For each node until we get to the end. * if dist is less than minDist, set mindist to new distance, set index to index * else if dist is greater than mindist and the index was either nodetojoin1 or * nodetojoin2, recompute distance, set entry for nodetojoin2 to NOTUSED * else set the distance to unused. */ void UPGMAAlgorithm::computeDistsForNodesAfterNode2(Node* nodeToJoin2) { int indexToNode2 = nodeToJoin2->numDists; const int indexToMinDist = nodeToJoin2->indexToMinDist; Node* nodeIter; for(nodeIter = nodeToJoin2->next; nodeIter; nodeIter = nodeIter->next) { double &distUpdate = nodeIter->ptrToDistMatRow[indexToMinDist]; distUpdate = ((distUpdate * orderNode1) + (nodeIter->ptrToDistMatRow[indexToNode2] * orderNode2)) / orderNewNode; /* The comparison (distUpdate > nodeIter->minDist) is unsafe. * Specifically, we get different results for 32/64bit machines, * which leads to different branching in the if/else statement * and nasty behaviour down the line. * Using all of Pfam as a benchmark distUpdate can 'wobble' by 40 ULPs * (Unit of Least Precision) which is difficult to translate into * a maximum relative error, so we pick COMPARE_REL_EPSILON * phenomenologically: approx 2E-15 was the biggest we saw in Pfam, * but suggest 1E-14 (for good measure). * Using ULPs, eg, *(long long int*)&(distUpdate), * would be better (more elegant?) but gives problems * with aliasing and/or performance reduction. * FS, 2009-04-30 */ #define COMPARE_REL_EPSILON 1E-14 if ( (distUpdate < nodeIter->minDist) && ((nodeIter->minDist-distUpdate) / nodeIter->minDist > COMPARE_REL_EPSILON) ) { /** new distance is smaller */ nodeIter->minDist = distUpdate; nodeIter->indexToMinDist = indexToMinDist; } else if (((distUpdate > nodeIter->minDist) && ((distUpdate-nodeIter->minDist) / distUpdate > COMPARE_REL_EPSILON) && (nodeIter->indexToMinDist == indexToMinDist)) || (nodeIter->indexToMinDist == indexToNode2)) { /** if old min dist was to either nodeToJoin1 or nodeToJoin2 */ nodeIter->ptrToDistMatRow[indexToNode2] = BLANKDIST; nodeIter->findMinDist(); } else { nodeIter->ptrToDistMatRow[indexToNode2] = BLANKDIST; } } } void UPGMAAlgorithm::addAlignmentStep(vector* group1, vector* group2) { int sizeGroup1 = group1->size(); int sizeGroup2 = group2->size(); vector groups; groups.resize(numSeqs + 1, 0); int sizeGroup = groups.size(); for(int i = 0; i < sizeGroup1 && (*group1)[i] < sizeGroup; i++) { groups[(*group1)[i]] = 1; // Set to be apart of group1 } for(int i = 0; i < sizeGroup2 && (*group2)[i] < sizeGroup; i++) { groups[(*group2)[i]] = 2; // Set to be apart of group1 } progSteps->saveSet(&groups); } /** * At the moment we are only using average distance, UPGMA, but we can also use this * function to have different distance measures, min, max etc. */ double UPGMAAlgorithm::calcNewDist(double dist1, double dist2) { return ((dist1 * orderNode1) + (dist2 * orderNode2)) / orderNewNode; } } clustalw-2.1/src/tree/UPGMA/RootedTreeOutput.h0000644000175000017500000000217411442167171016210 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * mark 8-5-2007: I removed the isLeafNode function. Changed both the traversal functions * to access Node's data members via functions. */ #ifndef ROOTEDTREEOUTPUT_H #define ROOTEDTREEOUTPUT_H #include #include "RootedGuideTree.h" #include "../../general/clustalw.h" /** this is only used for upgma?! * */ namespace clustalw { class RootedTreeOutput { public: RootedTreeOutput(SeqInfo* seqInfo); void printPhylipTree(RootedGuideTree* tree, ofstream* ptrToFile, Alignment *alignPtr, DistMatrix* distMat); void printNexusTree(RootedGuideTree* tree, ofstream* ptrToFile, Alignment *alignPtr, DistMatrix* distMat); private: void phylipTraverse(ofstream* ptrToFile, Alignment *alignPtr, Node* tree); void nexusTraverse(ofstream* ptrToFile, Alignment *alignPtr, Node* tree); int firstSeq; int lastSeq; int numSeqs; }; } #endif clustalw-2.1/src/tree/UPGMA/UPGMAAlgorithm.h0000644000175000017500000000366711442167171015443 00000000000000#ifndef __UPGMAALGORITHM_H #define __UPGMAALGORITHM_H #include "Node.h" #include #include "../../general/clustalw.h" #include "../AlignmentSteps.h" #include "RootedGuideTree.h" #include #include namespace clustalw { using namespace std; class UPGMAAlgorithm { public: bool overwriteMatrix; UPGMAAlgorithm(); auto_ptr generateTree(RootedGuideTree* phyTree, DistMatrix* distMat, SeqInfo* seqInfo, bool overwrite, ofstream* tree = 0); void setVerbose(bool _verbose){verbose = _verbose;} private: Node **initialiseNodes(double *distanceMatrix, int firstSeq); Node *doUPGMA(Node **nodes, ofstream* tree); void printAllNodes(Node** nodes); void addAlignmentStep(vector* group1, vector* group2); Node** getNodeWithMinDist(Node** clusters); void recomputeNodeToJoin1DistMatRow(Node* nodeToJoin1, double** nodeToJoin2DistIter); void computeAllOtherDistsToNewNode(Node* nodeToJoin1, Node* nodeToJoin2, double** nodeToJoin2DistIter); void computeDistsUpToNodeToJoin2(Node* nToJoin1, Node* nToJoin2, double** nodeToJoin2DistIter); void computeDistsForNodesAfterNode2(Node* nToJoin2); void movePtrPastUnusedDistances(double** ptrToDist) { while(**ptrToDist < 0) { (*ptrToDist)++; } } double calcNewDist(double dist1, double dist2); //vector::iterator getIterToNodeWithMinDist(vector* nodesLeft); auto_ptr progSteps; int numSeqs; bool verbose; int orderNode1, orderNode2, orderNewNode; }; } #endif clustalw-2.1/src/tree/RandomGenerator.h0000644000175000017500000000144211442167171015126 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /* * * RandomGenerator * * -linear and additive congruential random number generators * (see R. Sedgewick, Algorithms, Chapter 35) * * Implementation: R. Fuchs, EMBL Data Library, 1991 * */ #ifndef RANDOMGENERATOR_H #define RANDOMGENERATOR_H namespace clustalw { class RandomGenerator { public: /* Functions */ RandomGenerator(unsigned long s); unsigned long addRand(unsigned long r); /* Attributes */ private: /* Functions */ unsigned long mult(unsigned long p, unsigned long q); /* Attributes */ unsigned long j; unsigned long a[55]; unsigned long m; unsigned long m1; }; } #endif clustalw-2.1/src/tree/ClusterTreeOutput.h0000644000175000017500000000272011442167171015521 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef CLUSTERTREEOUTPUT_H #define CLUSTERTREEOUTPUT_H #include #include #include "../alignment/Alignment.h" #include "../general/clustalw.h" namespace clustalw { class ClusterTreeOutput { public: ClusterTreeOutput(clustalw::SeqInfo* seqInfo, int boot); void printNexusTree(clustalw::PhyloTree* phyloTree, ofstream* tree, clustalw::Alignment *alignPtr, clustalw::DistMatrix* distMat, vector* bootTotals); void printTree(clustalw::PhyloTree* phyloTree, ofstream* tree, vector* totals); void printPhylipTree(clustalw::PhyloTree* phyloTree, ofstream* tree, clustalw::Alignment *alignPtr, clustalw::DistMatrix* distMat, vector* bootTotals); void printTreeDesc(clustalw::PhyloTree* phyloTree); private: ClusterTreeOutput(); // Dont allow contruction with default!!!! int twoWaySplit(clustalw::PhyloTree* phyloTree, ofstream* tree, int startRow, int flag, clustalw::Alignment *alignPtr, vector* bootTotals); int twoWaySplitNexus(clustalw::PhyloTree* phyloTree, ofstream* tree, int startRow, int flag, clustalw::Alignment *alignPtr, vector* bootTotals); /* Attributes! */ int firstSeq; int lastSeq; int numSeqs; int bootstrap; }; } #endif clustalw-2.1/src/tree/ClusterTree.h0000644000175000017500000000672111442167171014305 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * This is the interface class for the clustering part of the code. The 3 public functions * are the 3 things that can be done. 1) Generate a tree from alignment (treeFromAlignment), * 2) Generate a tree from a distance matrix (treeFromDistMatrix), or * 3) Bootstrap a tree (bootstrapTree). **/ #ifndef CLUSTALTREEBASE_H #define CLUSTALTREEBASE_H #include #include #include #include #include #include "../alignment/Alignment.h" #include "NJTree.h" #include "ClusterTreeOutput.h" #include "../general/OutputFile.h" #include "ClusterTreeAlgorithm.h" #include namespace clustalw { class OutputFile; class ClusterTree { public: /* Functions */ ClusterTree(); /* Attributes */ protected: // This is because we will have a derived class that needs these. /* Functions */ void overspillMessage(int overspill,int total_dists); void treeGapDelete(clustalw::Alignment *alignPtr); int dnaDistanceMatrix(ofstream* treeFile, clustalw::Alignment *alignPtr); int protDistanceMatrix(ofstream* treeFile, clustalw::Alignment *alignPtr); bool isAmbiguity(int c); void calcPercIdentity(ofstream* pfile, clustalw::Alignment *alignPtr); void compareTree(clustalw::PhyloTree* tree1, clustalw::PhyloTree* tree2, vector* hits, int n); //string getOutputFileName(const string prompt, string path, // const string fileExtension); bool transition(int base1, int base2); void distanceMatrixOutput(ofstream* outFile, clustalw::DistMatrix* matToPrint, clustalw::Alignment *alignPtr); bool openFilesForBootstrap(clustalw::OutputFile* clustalFile, clustalw::OutputFile* phylipFile, clustalw::OutputFile* nexusFile, clustalw::TreeNames* treeNames, string* path); bool openFilesForTreeFromAlignment(clustalw::OutputFile* clustalFile, clustalw::OutputFile* phylipFile, clustalw::OutputFile* distFile, clustalw::OutputFile* nexusFile, clustalw::OutputFile* pimFile, clustalw::TreeNames* treeNames, string* path); int calcQuickDistMatForAll(ofstream* clustalFile, ofstream* phylipFile, ofstream* nexusFile, ofstream* pimFile, ofstream* distFile, clustalw::Alignment* alignPtr); int calcQuickDistMatForSubSet(ofstream* clustalFile, ofstream* phylipFile, ofstream* nexusFile, clustalw::Alignment* alignPtr, bool inBootLoop = false); void printBootstrapHeaderToClustalFile(ofstream* clustalFile); void promptForBoolSeedAndNumTrials(); void printErrorMessageForBootstrap(int totalOverspill, int totalDists, int nfails); bool checkIfConditionsMet(int numSeqs, int min); /* Attributes */ ClusterTreeAlgorithm* clusAlgorithm; auto_ptr quickDistMat; vector bootTotals; vector bootPositions; bool verbose; vector treeGaps; int numSeqs; int firstSeq; int lastSeq; string bootstrapPrompt; string bootstrapFileTypeMsg; }; } #endif clustalw-2.1/src/tree/UnRootedClusterTree.h0000644000175000017500000000127711442167171015766 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef UNROOTEDCLUSTERTREE_H #define UNROOTEDCLUSTERTREE_H #include "ClusterTree.h" namespace clustalw { class UnRootedClusterTree : private ClusterTree { public: UnRootedClusterTree(); void treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr); void treeFromDistMatrix(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string& phylipName); void bootstrapTree(TreeNames* treeNames, Alignment *alignPtr); private: PhyloTree* phyloTree; ClusterTreeOutput* outputTree; }; } #endif clustalw-2.1/src/tree/ClusterTreeAlgorithm.h0000644000175000017500000000113411442167171016145 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef CLUSTERTREEALGORITHM_H #define CLUSTERTREEALGORITHM_H #include #include #include #include "../general/clustalw.h" namespace clustalw { class ClusterTreeAlgorithm { public: virtual ~ClusterTreeAlgorithm(){}; virtual void generateTree(clustalw::PhyloTree* phyTree, clustalw::DistMatrix* distMat, clustalw::SeqInfo* seqInfo, ofstream* tree = 0) = 0; virtual void setVerbose(bool choice) = 0; }; } #endif clustalw-2.1/src/tree/RandomGenerator.cpp0000644000175000017500000000213011442167171015454 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RandomGenerator.h" namespace clustalw { /** * The contructor initialises the random algorithm. * @param s * @return */ RandomGenerator::RandomGenerator(unsigned long s) : m(100000000), m1(10000) { a[0] = s; j = 0; do { ++j; a[j] = (mult(31, a[j - 1]) + 1) % m; } while (j < 54); } /** * additive congruential method. * @param r * @return unsigned long random number in the range 0 to r-1 */ unsigned long RandomGenerator::addRand(unsigned long r) { int x, y; j = (j + 1) % 55; x = (j + 23) % 55; y = (j + 54) % 55; a[j] = (a[x] + a[y]) % m; return (((a[j] / m1) *r) / m1); } /** * * @param p * @param q * @return */ unsigned long RandomGenerator::mult(unsigned long p, unsigned long q) { unsigned long p1, p0, q1, q0; p1 = p / m1; p0 = p % m1; q1 = q / m1; q0 = q % m1; return ((((p0 *q1 + p1 * q0) % m1) *m1 + p0 * q0) % m); } } clustalw-2.1/src/tree/UnRootedClusterTree.cpp0000644000175000017500000003700411442167171016316 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "UnRootedClusterTree.h" #include "../general/utils.h" #include "RandomGenerator.h" #include #include #include "../general/OutputFile.h" namespace clustalw { UnRootedClusterTree::UnRootedClusterTree() { } /* * The function treeFromAlignment is called to generate a tree from an alignment * without a distance matrix. It calculates the distance matrix from the alignment * quickly. */ // Note this function was called phylogenetic_tree before void UnRootedClusterTree::treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr) { try { OutputFile phylipPhyTreeFile; OutputFile clustalPhyTreeFile; OutputFile distancesPhyTreeFile; OutputFile nexusPhyTreeFile; OutputFile pimFile; string path; int i, j; int overspill = 0; int totalDists; numSeqs = alignPtr->getNumSeqs(); // NOTE class variable /** * Check if numSeqs is ok */ if(!checkIfConditionsMet(numSeqs, 2)) { return; } firstSeq = 1; lastSeq = numSeqs; phyloTree = new PhyloTree; // The SeqInfo struct is passed to reduce the number of parameters passed! SeqInfo info; info.firstSeq = firstSeq; info.lastSeq = lastSeq; info.numSeqs = numSeqs; outputTree = new ClusterTreeOutput(&info, 0); // No bootstrap! phyloTree->treeDesc.resize(numSeqs + 1, vector(numSeqs + 1)); TreeGroups saveTree(numSeqs + 1, vector(numSeqs + 1)); // NOTE at the moment there is only one type of clustering algorithm, but there will // be more! clusAlgorithm = new NJTree(); utilityObject->getPath(userParameters->getSeqName(), &path); /** * Open the required output files. */ if(!openFilesForTreeFromAlignment(&clustalPhyTreeFile, &phylipPhyTreeFile, &distancesPhyTreeFile, &nexusPhyTreeFile, &pimFile, treeNames, &path)) { return; // Problem opeing one of the files, cannot continue! } int _lenFirstSeq = alignPtr->getSeqLength(firstSeq); bootPositions.resize(_lenFirstSeq + 2); for (j = 1; j <= _lenFirstSeq; ++j) { bootPositions[j] = j; } /** * Calculate quickDist and overspill */ overspill = calcQuickDistMatForAll(clustalPhyTreeFile.getPtrToFile(), phylipPhyTreeFile.getPtrToFile(), nexusPhyTreeFile.getPtrToFile(), pimFile.getPtrToFile(), distancesPhyTreeFile.getPtrToFile(), alignPtr); // check if any distances overflowed the distance corrections if (overspill > 0) { totalDists = (numSeqs *(numSeqs - 1)) / 2; overspillMessage(overspill, totalDists); } if (userParameters->getOutputTreeClustal()) { verbose = true; } // Turn on file output if (userParameters->getOutputTreeClustal() || userParameters->getOutputTreePhylip() || userParameters->getOutputTreeNexus()) { clusAlgorithm->setVerbose(true); clusAlgorithm->generateTree(phyloTree, quickDistMat.get(), &info, clustalPhyTreeFile.getPtrToFile()); clusAlgorithm->setVerbose(false); } for (i = 1; i < numSeqs + 1; i++) for (j = 1; j < numSeqs + 1; j++) { saveTree[i][j] = phyloTree->treeDesc[i][j]; } if (userParameters->getOutputTreePhylip()) { outputTree->printPhylipTree(phyloTree, phylipPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get(), &bootTotals); } for (i = 1; i < numSeqs + 1; i++) for (j = 1; j < numSeqs + 1; j++) { phyloTree->treeDesc[i][j] = saveTree[i][j]; } if (userParameters->getOutputTreeNexus()) { outputTree->printNexusTree(phyloTree, nexusPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get(), &bootTotals); } /** Free up resources!!!!! */ treeGaps.clear(); bootPositions.clear(); delete clusAlgorithm; delete phyloTree; delete outputTree; } catch(const exception& ex) { cerr << ex.what() << endl; utilityObject->error("Terminating program. Cannot continue\n"); exit(1); } } /* * Routine for producing unrooted NJ trees from seperately aligned * pairwise distances. This produces the GUIDE DENDROGRAMS in * PHYLIP format. */ void UnRootedClusterTree::treeFromDistMatrix(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string& phylipName) { OutputFile phylipPhyTreeFile; try { // Test to see if the inputs are valid if(seq1 < 1 || nSeqs < 1) { cerr << "Invalid inputs into treeFromDistMatrix \n" << "seq1 = " << seq1 << " nSeqs = " << nSeqs << "\n" << "Need to end program!\n"; exit(1); return; } PhyloTree phyloTree; float dist; string path; verbose = false; firstSeq = seq1; lastSeq = firstSeq + nSeqs - 1; SeqInfo info; info.firstSeq = firstSeq; info.lastSeq = lastSeq; info.numSeqs = nSeqs; // Open up the phylipPhyTreeFile now! // NOTE that this is not exactly correct. This may cause a problem when outputing // a tree for each of the profiles. But then we can pass it in, maybe. utilityObject->getPath(userParameters->getSeqName(), &path); if(nSeqs >= 2) { string name = phylipName; if(!phylipPhyTreeFile.openFile(&name, "\nEnter name for new GUIDE TREE file ", &path, "dnd", "Guide tree")) { return; } phylipName = name; } else { return; } // Not sure about bootstrapping here! clusAlgorithm = new NJTree(); outputTree = new ClusterTreeOutput(&info, 0); ofstream* ptrToFile = phylipPhyTreeFile.getPtrToFile(); if (nSeqs == 2) { dist = (*distMat)(firstSeq, firstSeq + 1) / 2.0; if(ptrToFile->is_open()) { (*ptrToFile) << "(" << alignPtr->getName(firstSeq) << ":" << setprecision(5) << dist << "," << alignPtr->getName(firstSeq + 1) << ":" << setprecision(5) << dist <<");\n"; } } else { int dimensions = lastSeq - firstSeq + 2; phyloTree.treeDesc.resize(dimensions, vector(dimensions)); /* debugging, also used when -OUTPUTTREE is used */ #if 0 ofstream debuglog("debug.treeFromDistMatrix.txt", ios::out); clusAlgorithm->setVerbose(true); clusAlgorithm->generateTree(&phyloTree, distMat, &info, &debuglog); #else clusAlgorithm->generateTree(&phyloTree, distMat, &info); #endif outputTree->printPhylipTree(&phyloTree, ptrToFile, alignPtr, distMat, &bootTotals); } delete clusAlgorithm; delete outputTree; //phylipPhyTreeFile.close(); } catch(const exception &ex) { cerr << "ERROR: Error has occured in treeFromDistMatrix. " << "Need to terminate program.\n" << ex.what(); exit(1); } catch(...) { cerr << "ERROR: Error has occured in treeFromDistMatrix. " << "Need to terminate program.\n"; exit(1); } } /* * Note before I had this function was accepting a distance matrix. But I think it * just uses the quickly generated one. So it doesnt need it anymore. But be careful !!!! */ void UnRootedClusterTree::bootstrapTree(TreeNames* treeNames, Alignment *alignPtr) { int i, j; int ranno; string path; OutputFile clustalPhyTreeFile; ofstream* ptrToClustalFile; OutputFile phylipPhyTreeFile; OutputFile nexusPhyTreeFile; try { phyloTree = new PhyloTree; PhyloTree sampleTree; PhyloTree standardTree; PhyloTree saveTree; int totalDists, overspill = 0, totalOverspill = 0; int nfails = 0; numSeqs = alignPtr->getNumSeqs(); firstSeq = 1; lastSeq = numSeqs; clusAlgorithm = new NJTree(); SeqInfo info; info.firstSeq = firstSeq; info.lastSeq = lastSeq; info.numSeqs = numSeqs; /** * Check if numSeqs is ok */ if(!checkIfConditionsMet(numSeqs, 4)) { return; } if (!userParameters->getOutputTreeClustal() && !userParameters->getOutputTreePhylip() && !userParameters->getOutputTreeNexus()) { utilityObject->error("You must select either clustal or phylip or nexus tree output format"); return; } utilityObject->getPath(userParameters->getSeqName(), &path); if(!openFilesForBootstrap(&clustalPhyTreeFile, &phylipPhyTreeFile, &nexusPhyTreeFile, treeNames, &path)) { return; // There was a problem opening the output files. } int _lenFirstSeq = alignPtr->getSeqLength(firstSeq); bootTotals.clear(); bootTotals.resize(numSeqs + 1); bootPositions.clear(); bootPositions.resize(_lenFirstSeq + 2); for (j = 1; j <= _lenFirstSeq; ++j) // First select all positions for { bootPositions[j] = j; } // the "standard" tree overspill = calcQuickDistMatForSubSet(clustalPhyTreeFile.getPtrToFile(), phylipPhyTreeFile.getPtrToFile(), nexusPhyTreeFile.getPtrToFile(), alignPtr); // check if any distances overflowed the distance corrections if (overspill > 0) { totalDists = (numSeqs *(numSeqs - 1)) / 2; overspillMessage(overspill, totalDists); } treeGaps.clear(); if (userParameters->getOutputTreeClustal()) { verbose = true; } // Turn on screen output phyloTree->treeDesc.resize(numSeqs + 1, vector(numSeqs + 1)); // compute the standard tree if (userParameters->getOutputTreeClustal() || userParameters->getOutputTreePhylip() || userParameters->getOutputTreeNexus()) { clusAlgorithm->setVerbose(true); clusAlgorithm->generateTree(phyloTree, quickDistMat.get(), &info, clustalPhyTreeFile.getPtrToFile()); } ptrToClustalFile = clustalPhyTreeFile.getPtrToFile(); promptForBoolSeedAndNumTrials(); RandomGenerator randGenerator(userParameters->getBootRanSeed()); /** * Print bootstrap information to top of clustal bootstrap file! */ if (userParameters->getOutputTreeClustal()) { printBootstrapHeaderToClustalFile(ptrToClustalFile); } verbose = false; // Turn OFF screen output clusAlgorithm->setVerbose(false); sampleTree.treeDesc.resize(numSeqs + 1, vector(numSeqs + 1)); if (userParameters->getMenuFlag()) { cout << "\n\nEach dot represents 10 trials\n\n"; } totalOverspill = 0; nfails = 0; int lenSeq1 = alignPtr->getSeqLength(1); for (i = 1; i <= userParameters->getBootNumTrials(); ++i) { for (j = 1; j <= alignPtr->getSeqLength(firstSeq); ++j) { // select alignment positions for ranno = randGenerator.addRand((unsigned long)lenSeq1) + 1; bootPositions[j] = ranno; // bootstrap sample } overspill = calcQuickDistMatForSubSet(clustalPhyTreeFile.getPtrToFile(), phylipPhyTreeFile.getPtrToFile(), nexusPhyTreeFile.getPtrToFile(), alignPtr, true); if (overspill > 0) { totalOverspill = totalOverspill + overspill; nfails++; } treeGaps.clear(); if (userParameters->getOutputTreeClustal() || userParameters->getOutputTreePhylip() || userParameters->getOutputTreeNexus()) { // NOTE this is bad to pass in clustalPhyTreeFile clusAlgorithm->generateTree(&sampleTree, quickDistMat.get(), &info, clustalPhyTreeFile.getPtrToFile()); } sampleTree.leftBranch.clear(); sampleTree.rightBranch.clear(); compareTree(phyloTree, &sampleTree, &bootTotals, lastSeq - firstSeq + 1); if (userParameters->getMenuFlag()) { if (i % 10 == 0) { cout << "."; } if (i % 100 == 0) { cout << "\n"; } } } // check if any distances overflowed the distance corrections if (nfails > 0) { totalDists = (numSeqs *(numSeqs - 1)) / 2; printErrorMessageForBootstrap(totalOverspill, totalDists, nfails); } bootPositions.clear(); outputTree = new ClusterTreeOutput(&info, userParameters->getBootstrapFormat()); /** * Print ClustalTree with bootTotals */ if (userParameters->getOutputTreeClustal()) { outputTree->printTree(phyloTree, clustalPhyTreeFile.getPtrToFile(), &bootTotals); } /** * Print phylip tree with boottotals. */ if (userParameters->getOutputTreePhylip()) { // Save the old tree! saveTree.treeDesc.resize(numSeqs + 1, vector(numSeqs + 1)); saveTree.treeDesc.assign(phyloTree->treeDesc.begin(), phyloTree->treeDesc.end()); outputTree->printPhylipTree(phyloTree, phylipPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get(), &bootTotals); // reassign the old values! phyloTree->treeDesc.assign(saveTree.treeDesc.begin(), saveTree.treeDesc.end()); } /** * print nexus tree with boottotals */ if (userParameters->getOutputTreeNexus()) { outputTree->printNexusTree(phyloTree, nexusPhyTreeFile.getPtrToFile(), alignPtr, quickDistMat.get(), &bootTotals); } delete phyloTree; delete clusAlgorithm; delete outputTree; } catch(const exception &ex) { } } } clustalw-2.1/src/tree/Tree.h0000644000175000017500000000424011442167171012735 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef TREE_H #define TREE_H #include #include #include #include #include "../alignment/Alignment.h" #include "AlignmentSteps.h" #include namespace clustalw { class Tree { public: /* Functions */ void calcSeqWeights(int firstSeq, int lastSeq, vector* sweight); int readTree(Alignment* alignPtr, const string& treeFileName, int firstSeq, int lastSeq); auto_ptr createSets(int firstSeq, int lastSeq); int calcSimilarities(Alignment* alignPtr, DistMatrix* distMat); void clearTree(TreeNode* p); /* Attributes */ private: /* Functions */ void createTree(TreeNode* ptree, TreeNode* parent, ifstream* file); void createNode(TreeNode* pptr, TreeNode* parent); TreeNode* insertNode(TreeNode* pptr); void clearTreeNodes(TreeNode* p); TreeNode* reRoot(TreeNode* ptree, int nseqs); TreeNode* insertRoot(TreeNode* p, float diff); float calcRootMean(TreeNode* root, float *maxDist); float calcMean(TreeNode* nptr, float *maxDist, int nSeqs); void orderNodes(); int calcWeight(int leaf); void skipSpace(ifstream* file); void groupSeqs(TreeNode* p, int *nextGroups, int nSeqs, AlignmentSteps* stepsPtr); void markGroup1(TreeNode* p, int *groups, int n); void markGroup2(TreeNode* p, int *groups, int n); TreeNode* avail(); void setInfo(TreeNode* p, TreeNode* parent, int pleaf, string pname, float pdist); void debugPrintAllNodes(int nseqs); /* Attributes */ AlignmentSteps progSteps; char charFromFile; ifstream file; TreeNode** lptr; TreeNode** olptr; TreeNode** nptr; TreeNode** ptrs; int nnodes; int ntotal; bool rootedTree; TreeNode* seqTree; TreeNode* root; int* groups; int numSeq; int numSets; const static int MAXERRS = 10; }; } #endif clustalw-2.1/src/tree/NJTree.h0000644000175000017500000000227011442167171013166 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef NJTREE_H #define NJTREE_H #include #include #include "ClusterTreeAlgorithm.h" #include "../general/userparams.h" namespace clustalw { class NJTree : public ClusterTreeAlgorithm { public: NJTree(): verbose(false){}; virtual ~NJTree(){}; /** calculate an NJ tree * * @param phyTree the tree structure * @param distMat distance matrix * @param seqInfo holding sequence number info * @param log ofstream to log info to (used by -outputtree) * */ virtual void generateTree(clustalw::PhyloTree* phyTree, clustalw::DistMatrix* distMat, clustalw::SeqInfo* seqInfo, ofstream* log = 0); /** be verbose during tree generation * * if set to true, generateTree will need a log ofstream */ virtual void setVerbose(bool choice){verbose = choice;}; private: vector av; vector tkill; bool verbose; }; } #endif clustalw-2.1/src/tree/ClusterTreeOutput.cpp0000644000175000017500000003111011442167171016047 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ClusterTreeOutput.h" namespace clustalw { ClusterTreeOutput::ClusterTreeOutput(SeqInfo* seqInfo, int boot) : bootstrap(boot) { firstSeq = seqInfo->firstSeq; lastSeq = seqInfo->lastSeq; numSeqs = seqInfo->numSeqs; } void ClusterTreeOutput::printTreeDesc(PhyloTree* phyloTree) { for(int i = 1; i <= numSeqs; i++) { for(int j = 1; j <= numSeqs; j++) { cout << " " << phyloTree->treeDesc[i][j]; } cout << "\n"; } } /** * The function printPhylipTree is used to print out the unrooted clustered tree in * phylip format. * @param phyloTree A pointer to the PhyloTree struct that contains the description of the * tree. * @param tree The file to print the phylip tree to. Must be open! * @param alignPtr The alignment object. Needed for the names. * @param distMat The distance matrix that was used for the generation of the cluster. * @param bootTotals Holds the bootstrap values. Only used if the tree has been bootstrapped */ void ClusterTreeOutput::printPhylipTree(PhyloTree* phyloTree, ofstream* tree, Alignment *alignPtr, DistMatrix* distMat, vector* bootTotals) { int oldRow; if (lastSeq - firstSeq + 1 == 2) { (*tree) << "(" << alignPtr->getName(firstSeq) << ":" << fixed <getName(firstSeq + 1) << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << ");"; return ; } (*tree) << "(\n"; oldRow = twoWaySplit(phyloTree, tree, lastSeq - firstSeq + 1 - 2, 1, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq - firstSeq + 1 - 2]; if ((bootstrap == BS_BRANCH_LABELS) && (oldRow > 0) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ",\n"; oldRow = twoWaySplit(phyloTree, tree, lastSeq - firstSeq + 1 - 2, 2, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq - firstSeq + 1 - 1]; if ((bootstrap == BS_BRANCH_LABELS) && (oldRow > 0) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ",\n"; oldRow = twoWaySplit(phyloTree, tree, lastSeq - firstSeq + 1 - 2, 3, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq - firstSeq + 1]; if ((bootstrap == BS_BRANCH_LABELS) && (oldRow > 0) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ")"; if (bootstrap == BS_NODE_LABELS) { (*tree) << "TRICHOTOMY"; } (*tree) << ";\n"; } int ClusterTreeOutput::twoWaySplit(PhyloTree* phyloTree, ofstream* tree, int startRow, int flag, Alignment *alignPtr, vector* bootTotals) { int row, newRow = 0, oldRow, col, testCol = 0; bool singleSeq; if (startRow != lastSeq - firstSeq + 1-2) { (*tree) << "(\n"; } for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if (phyloTree->treeDesc[startRow][col] == flag) { testCol = col; break; } } singleSeq = true; for (row = startRow - 1; row >= 1; row--) if (phyloTree->treeDesc[row][testCol] == 1) { singleSeq = false; newRow = row; break; } if (singleSeq) { phyloTree->treeDesc[startRow][testCol] = 0; (*tree) << alignPtr->getName(testCol + firstSeq - 1); if (startRow == lastSeq - firstSeq + 1 - 2) { return (0); } (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[startRow] << ",\n"; } else { for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if ((phyloTree->treeDesc[startRow][col] == 1) && (phyloTree->treeDesc[newRow][col] == 1)) { phyloTree->treeDesc[startRow][col] = 0; } } oldRow = twoWaySplit(phyloTree, tree, newRow, 1, alignPtr, bootTotals); if (startRow == lastSeq - firstSeq + 1-2) { return (newRow); } (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[startRow]; if ((bootstrap == BS_BRANCH_LABELS) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ",\n"; } for (col = 1; col <= lastSeq - firstSeq + 1; col++) if (phyloTree->treeDesc[startRow][col] == flag) { testCol = col; break; } singleSeq = true; newRow = 0; for (row = startRow - 1; row >= 1; row--) if (phyloTree->treeDesc[row][testCol] == 1) { singleSeq = false; newRow = row; break; } if (singleSeq) { phyloTree->treeDesc[startRow][testCol] = 0; (*tree) << alignPtr->getName(testCol + firstSeq - 1); (*tree) << ":" << fixed << setprecision(5) << phyloTree->rightBranch[startRow] <<")\n"; } else { for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if ((phyloTree->treeDesc[startRow][col] == 1) && (phyloTree->treeDesc[newRow][col] == 1)) { phyloTree->treeDesc[startRow][col] = 0; } } oldRow = twoWaySplit(phyloTree, tree, newRow, 1, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->rightBranch[startRow]; if ((bootstrap == BS_BRANCH_LABELS) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ")\n"; } if ((bootstrap == BS_NODE_LABELS) && ((*bootTotals)[startRow] > 0)) { (*tree) << (*bootTotals)[startRow]; } return (startRow); } void ClusterTreeOutput::printNexusTree(PhyloTree* phyloTree, ofstream* tree, Alignment *alignPtr, DistMatrix* distMat, vector* bootTotals) { int i; int oldRow; (*tree) << "#NEXUS\n\n"; (*tree) << "BEGIN TREES;\n\n"; (*tree) << "\tTRANSLATE\n"; for(i = 1; i < numSeqs; i++) { (*tree) << "\t\t" << i << "\t" << alignPtr->getName(i) <<",\n"; } (*tree) << "\t\t" << numSeqs << "\t" << alignPtr->getName(numSeqs) <<"\n"; (*tree) << "\t\t;\n"; (*tree) << "\tUTREE PAUP_1= "; if(lastSeq - firstSeq + 1 == 2) { (*tree) << "(" << firstSeq << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << "," << firstSeq + 1 << ":" << fixed << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << ")"; } else { (*tree) << "("; oldRow = twoWaySplitNexus(phyloTree, tree, lastSeq - firstSeq + 1 - 2, 1, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq-firstSeq+1-2]; if ((bootstrap == BS_BRANCH_LABELS) && (oldRow > 0) && ((*bootTotals)[oldRow]>0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ","; oldRow = twoWaySplitNexus(phyloTree, tree, lastSeq - firstSeq + 1 - 2, 2, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq-firstSeq+1-1]; if ((bootstrap==BS_BRANCH_LABELS) && (oldRow>0) && ((*bootTotals)[oldRow]>0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ","; oldRow = twoWaySplitNexus(phyloTree, tree, lastSeq-firstSeq+1-2, 3, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[lastSeq-firstSeq+1]; if ((bootstrap==BS_BRANCH_LABELS) && (oldRow>0) && ((*bootTotals)[oldRow]>0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ")"; if (bootstrap == BS_NODE_LABELS) { (*tree) << "TRICHOTOMY"; } (*tree) << ";"; } (*tree) << "\nENDBLOCK;\n"; } int ClusterTreeOutput::twoWaySplitNexus(PhyloTree* phyloTree, ofstream* tree, int startRow, int flag, Alignment *alignPtr, vector* bootTotals) { int row, newRow = 0, oldRow, col, testCol = 0; bool singleSeq; if (startRow != lastSeq - firstSeq + 1 - 2) { (*tree) << "("; } for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if (phyloTree->treeDesc[startRow][col] == flag) { testCol = col; break; } } singleSeq = true; for (row = startRow - 1; row >= 1; row--) if (phyloTree->treeDesc[row][testCol] == 1) { singleSeq = false; newRow = row; break; } if (singleSeq) { phyloTree->treeDesc[startRow][testCol] = 0; (*tree) << testCol + firstSeq - 1;; if (startRow == lastSeq - firstSeq + 1-2) { return (0); } (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[startRow] << ","; } else { for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if ((phyloTree->treeDesc[startRow][col] == 1) && (phyloTree->treeDesc[newRow][col] == 1)) { phyloTree->treeDesc[startRow][col] = 0; } } oldRow = twoWaySplitNexus(phyloTree, tree, newRow, 1, alignPtr, bootTotals); if (startRow == lastSeq - firstSeq + 1-2) { return (newRow); } (*tree) << ":" << fixed << setprecision(5) << phyloTree->leftBranch[startRow]; if ((bootstrap == BS_BRANCH_LABELS) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ","; } for (col = 1; col <= lastSeq - firstSeq + 1; col++) if (phyloTree->treeDesc[startRow][col] == flag) { testCol = col; break; } singleSeq = true; newRow = 0; for (row = startRow - 1; row >= 1; row--) if (phyloTree->treeDesc[row][testCol] == 1) { singleSeq = false; newRow = row; break; } if (singleSeq) { phyloTree->treeDesc[startRow][testCol] = 0; (*tree) << testCol + firstSeq - 1; (*tree) << ":" << fixed << setprecision(5) << phyloTree->rightBranch[startRow] << ")"; } else { for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if ((phyloTree->treeDesc[startRow][col] == 1) && (phyloTree->treeDesc[newRow][col] == 1)) { phyloTree->treeDesc[startRow][col] = 0; } } oldRow = twoWaySplitNexus(phyloTree, tree, newRow, 1, alignPtr, bootTotals); (*tree) << ":" << fixed << setprecision(5) << phyloTree->rightBranch[startRow]; if ((bootstrap == BS_BRANCH_LABELS) && ((*bootTotals)[oldRow] > 0)) { (*tree) << "[" << (*bootTotals)[oldRow] << "]"; } (*tree) << ")"; } if ((bootstrap == BS_NODE_LABELS) && ((*bootTotals)[startRow] > 0)) { (*tree) << (*bootTotals)[startRow]; } return (startRow); } void ClusterTreeOutput::printTree(PhyloTree* phyloTree, ofstream* tree, vector* totals) { int row, col; (*tree) << "\n"; for (row = 1; row <= lastSeq - firstSeq + 1 - 3; row++) { (*tree) << " \n"; for (col = 1; col <= lastSeq - firstSeq + 1; col++) { if (phyloTree->treeDesc[row][col] == 0) { (*tree) << "*"; } else { (*tree) << "."; } } if ((*totals)[row] > 0) { (*tree) << setw(7) << (*totals)[row]; } } (*tree) << " \n"; for (col = 1; col <= lastSeq - firstSeq + 1; col++) { (*tree) << setw(1) << phyloTree->treeDesc[lastSeq - firstSeq + 1 -2][col]; } (*tree) << "\n"; } } clustalw-2.1/src/tree/NJTree.cpp0000644000175000017500000006253611442167171013534 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "NJTree.h" namespace clustalw { /**************************************************************************** * [ Improvement ideas in fast_nj_tree() ] by DDBJ & FUJITSU Limited. * written by Tadashi Koike * (takoike@genes.nig.ac.jp) ******************* * : Store the value of sum of the score to temporary array, * and use again and again. * * In the main cycle, these are calculated again and again : * diq = sum of distMat[n][ii] (n:1 to lastSeq-firstSeq+1), * djq = sum of distMat[n][jj] (n:1 to lastSeq-firstSeq+1), * dio = sum of distMat[n][mini] (n:1 to lastSeq-firstSeq+1), * djq = sum of distMat[n][minj] (n:1 to lastSeq-firstSeq+1) * // 'lastSeq' and 'firstSeq' are both constant values // * and the result of above calculations is always same until * a best pair of neighbour nodes is joined. * * So, we change the logic to calculate the sum[i] (=sum of distMat[n][i] * (n:1 to lastSeq-firstSeq+1)) and store it to array, before * beginning to find a best pair of neighbour nodes, and after that * we use them again and again. * * tmat[i][j] * 1 2 3 4 5 * +---+---+---+---+---+ * 1 | | | | | | * +---+---+---+---+---+ * 2 | | | | | | 1) calculate sum of distMat[n][i] * +---+---+---+---+---+ (n: 1 to lastSeq-firstSeq+1) * 3 | | | | | | 2) store that sum value to sum[i] * +---+---+---+---+---+ * 4 | | | | | | 3) use sum[i] during finding a best * +---+---+---+---+---+ pair of neibour nodes. * 5 | | | | | | * +---+---+---+---+---+ * | | | | | * V V V V V Calculate sum , and store it to sum[i] * +---+---+---+---+---+ * sum[i] | | | | | | * +---+---+---+---+---+ * * At this time, we thought that we use upper triangle of the matrix * because distMat[i][j] is equal to distMat[j][i] and distMat[i][i] is equal * to zero. Therefore, we prepared sum_rows[i] and sum_cols[i] instead * of sum[i] for storing the sum value. * * distMat[i][j] * 1 2 3 4 5 sum_cols[i] * +---+---+---+---+---+ +---+ * 1 | # | # | # | # | --> | | ... sum of distMat[1][2..5] * + - +---+---+---+---+ +---+ * 2 | # | # | # | --> | | ... sum of distMat[2][3..5] * + - + - +---+---+---+ +---+ * 3 | # | # | --> | | ... sum of distMat[3][4..5] * + - + - + - +---+---+ +---+ * 4 | # | --> | | ... sum of distMat[4][5] * + - + - + - + - +---+ +---+ * 5 | --> | | ... zero * + - + - + - + - + - + +---+ * | | | | | * V V V V V Calculate sum , sotre to sum[i] * +---+---+---+---+---+ * sum_rows[i] | | | | | | * +---+---+---+---+---+ * | | | | | * | | | | +----- sum of distMat[1..4][5] * | | | +--------- sum of distMat[1..3][4] * | | +------------- sum of distMat[1..2][3] * | +----------------- sum of distMat[1][2] * +--------------------- zero * * And we use (sum_rows[i] + sum_cols[i]) instead of sum[i]. * ******************* * : We manage valid nodes with chain list, instead of * tkill[i] flag array. * * In original logic, invalid(killed?) nodes after nodes-joining * are managed with tkill[i] flag array (set to 1 when killed). * By this method, it is conspicuous to try next node but skip it * at the latter of finding a best pair of neighbor nodes. * * So, we thought that we managed valid nodes by using a chain list * as below: * * 1) declare the list structure. * struct { * sint n; // entry number of node. * void *prev; // pointer to previous entry. * void *next; // pointer to next entry. * } * 2) construct a valid node list. * * +-----+ +-----+ +-----+ +-----+ +-----+ * NULL<-|prev |<---|prev |<---|prev |<---|prev |<- - - -|prev | * | 0 | | 1 | | 2 | | 3 | | n | * | next|--->| next|--->| next|--->| next|- - - ->| next|->NULL * +-----+ +-----+ +-----+ +-----+ +-----+ * * 3) when finding a best pair of neighbor nodes, we use * this chain list as loop counter. * * 4) If an entry was killed by node-joining, this chain list is * modified to remove that entry. * * EX) remove the entry No 2. * +-----+ +-----+ +-----+ +-----+ * NULL<-|prev |<---|prev |<--------------|prev |<- - - -|prev | * | 0 | | 1 | | 3 | | n | * | next|--->| next|-------------->| next|- - - ->| next|->NULL * +-----+ +-----+ +-----+ +-----+ * +-----+ * NULL<-|prev | * | 2 | * | next|->NULL * +-----+ * * By this method, speed is up at the latter of finding a best pair of * neighbor nodes. * ******************* * : Cut the frequency of division. * * At comparison between 'total' and 'tmin' in the main cycle, total is * divided by (2.0*fnseqs2) before comparison. If N nodes are available, * that division happen (N*(N-1))/2 order. * * We thought that the comparison relation between tmin and total/(2.0*fnseqs2) * is equal to the comparison relation between (tmin*2.0*fnseqs2) and total. * Calculation of (tmin*2.0*fnseqs2) is only one time. so we stop dividing * a total value and multiply tmin and (tmin*2.0*fnseqs2) instead. * ******************* * : some transformation of the equation (to cut operations). * * We transform an equation of calculating 'total' in the main cycle. * */ void NJTree::generateTree(clustalw::PhyloTree* phyTree, clustalw::DistMatrix* distMat, clustalw::SeqInfo* seqInfo, ofstream* log) { if (log == NULL) { verbose = false; } register int i; int l[4], nude, k; int nc, mini, minj, j, ii, jj; double fnseqs, fnseqs2 = 0, sumd; double diq, djq, dij, dio, djo, da; double tmin, total, dmin; double bi, bj, b1, b2, b3, branch[4]; int typei, typej; /* 0 = node; 1 = OTU */ int firstSeq = seqInfo->firstSeq; int lastSeq = seqInfo->lastSeq; int numSeqs = seqInfo->numSeqs; /* IMPROVEMENT 1, STEP 0 : declare variables */ double *sumCols, *sumRows, *join; sumCols = new double[numSeqs + 1]; sumRows = new double[numSeqs + 1]; join = new double[numSeqs + 1]; /* IMPROVEMENT 2, STEP 0 : declare variables */ int loop_limit; typedef struct _ValidNodeID { int n; struct _ValidNodeID *prev; struct _ValidNodeID *next; } ValidNodeID; ValidNodeID *tvalid, *lpi, *lpj, *lpii, *lpjj, *lp_prev, *lp_next; /* * correspondence of the loop counter variables. * i .. lpi->n, ii .. lpii->n * j .. lpj->n, jj .. lpjj->n */ fnseqs = (double)lastSeq - firstSeq + 1; /*********************** First initialisation ***************************/ if (verbose) { (*log) << "\n\n\t\t\tNeighbor-joining Method\n" << "\n Saitou, N. and Nei, M. (1987)" << " The Neighbor-joining Method:" << "\n A New Method for Reconstructing Phylogenetic Trees." << "\n Mol. Biol. Evol., 4(4), 406-425\n" << "\n\n This is an UNROOTED tree\n" << "\n Numbers in parentheses are branch lengths\n\n"; } if (fnseqs == 2) { if (verbose) { (*log) << "Cycle 1 = SEQ: 1 (" << setw(9) << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << ") joins SEQ: 2 (" << setw(9) << setprecision(5) << (*distMat)(firstSeq, firstSeq + 1) << ")"; } return ; } mini = minj = 0; /* IMPROVEMENT 1, STEP 1 : Allocate memory */ /* IMPROVEMENT 1, STEP 2 : Initialize arrays to 0 */ phyTree->leftBranch.resize(numSeqs + 2, 0.0); phyTree->rightBranch.resize(numSeqs + 2, 0.0); tkill.resize(numSeqs + 1, 0); av.resize(numSeqs + 1, 0.0); /* IMPROVEMENT 2, STEP 1 : Allocate memory */ tvalid = new ValidNodeID[numSeqs + 1]; /* tvalid[0] is special entry in array. it points a header of valid entry list */ tvalid[0].n = 0; tvalid[0].prev = NULL; tvalid[0].next = &tvalid[1]; /* IMPROVEMENT 2, STEP 2 : Construct and initialize the entry chain list */ for (i = 1, loop_limit = lastSeq - firstSeq + 1, lpi = &tvalid[1], lp_prev = &tvalid[0], lp_next = &tvalid[2]; i <= loop_limit; ++i, ++lpi, ++lp_prev, ++lp_next) { (*distMat)(i, i) = av[i] = 0.0; tkill[i] = 0; lpi->n = i; lpi->prev = lp_prev; lpi->next = lp_next; } tvalid[loop_limit].next = NULL; /* * IMPROVEMENT 1, STEP 3 : Calculate the sum of score value that * is sequence[i] to others. */ double matValue; sumd = 0.0; for (lpj = tvalid[0].next; lpj != NULL; lpj = lpj->next) { double tmp_sum = 0.0; j = lpj->n; /* calculate sumRows[j] */ for (lpi = tvalid[0].next; lpi->n < j; lpi = lpi->next) { i = lpi->n; matValue = (*distMat)(i, j); tmp_sum = tmp_sum + matValue; } sumRows[j] = tmp_sum; tmp_sum = 0.0; /* Set lpi to that lpi->n is greater than j */ if ((lpi != NULL) && (lpi->n == j)) { lpi = lpi->next; } /* calculate sumCols[j] */ for (; lpi != NULL; lpi = lpi->next) { i = lpi->n; tmp_sum += (*distMat)(j, i); } sumCols[j] = tmp_sum; } /*********************** Enter The Main Cycle ***************************/ for (nc = 1, loop_limit = (lastSeq - firstSeq + 1-3); nc <= loop_limit; ++nc) { sumd = 0.0; /* IMPROVEMENT 1, STEP 4 : use sum value */ for (lpj = tvalid[0].next; lpj != NULL; lpj = lpj->next) { sumd += sumCols[lpj->n]; } /* IMPROVEMENT 3, STEP 0 : multiply tmin and 2*fnseqs2 */ fnseqs2 = fnseqs - 2.0; /* Set fnseqs2 at this point. */ tmin = 99999.0 * 2.0 * fnseqs2; /*.................compute SMATij values and find the smallest one ........*/ mini = minj = 0; /* jj must starts at least 2 */ if ((tvalid[0].next != NULL) && (tvalid[0].next->n == 1)) { lpjj = tvalid[0].next->next; } else { lpjj = tvalid[0].next; } for (; lpjj != NULL; lpjj = lpjj->next) { jj = lpjj->n; for (lpii = tvalid[0].next; lpii->n < jj; lpii = lpii->next) { ii = lpii->n; diq = djq = 0.0; /* IMPROVEMENT 1, STEP 4 : use sum value */ diq = sumCols[ii] + sumRows[ii]; djq = sumCols[jj] + sumRows[jj]; /* * always ii < jj in this point. Use upper * triangle of score matrix. */ dij = (*distMat)(ii, jj); /* * IMPROVEMENT 3, STEP 1 : fnseqs2 is * already calculated. */ /* fnseqs2 = fnseqs - 2.0 */ /* IMPROVEMENT 4 : transform the equation */ /*-------------------------------------------------------------------* * OPTIMIZE of expression 'total = d2r + fnseqs2*dij + dr*2.0' * * total = d2r + fnseq2*dij + 2.0*dr * * = d2r + fnseq2*dij + 2(sumd - dij - d2r) * * = d2r + fnseq2*dij + 2*sumd - 2*dij - 2*d2r * * = fnseq2*dij + 2*sumd - 2*dij - 2*d2r + d2r * * = fnseq2*dij + 2*sumd - 2*dij - d2r * * = fnseq2*dij + 2*sumd - 2*dij - (diq + djq - 2*dij) * * = fnseq2*dij + 2*sumd - 2*dij - diq - djq + 2*dij * * = fnseq2*dij + 2*sumd - 2*dij + 2*dij - diq - djq * * = fnseq2*dij + 2*sumd - diq - djq * *-------------------------------------------------------------------*/ total = fnseqs2 * dij + 2.0 * sumd - diq - djq; /* * IMPROVEMENT 3, STEP 2 : abbrevlate * the division on comparison between * total and tmin. */ /* total = total / (2.0*fnseqs2); */ if (total < tmin) { tmin = total; mini = ii; minj = jj; } } } /* MEMO: always ii < jj in avobe loop, so mini < minj */ /*.................compute branch lengths and print the results ........*/ dio = djo = 0.0; /* IMPROVEMENT 1, STEP 4 : use sum value */ dio = sumCols[mini] + sumRows[mini]; djo = sumCols[minj] + sumRows[minj]; dmin = (*distMat)(mini, minj); dio = (dio - dmin) / fnseqs2; djo = (djo - dmin) / fnseqs2; bi = (dmin + dio - djo) *0.5; bj = dmin - bi; bi = bi - av[mini]; bj = bj - av[minj]; #if 0 (*log) << endl << "*** cycle " << nc << endl; (*log) << "dmin = " << setw(9) << right << setprecision(9) << dmin << endl; (*log) << "dio = " << setw(9) << right << setprecision(9) << dio << endl; (*log) << "djo = " << setw(9) << right << setprecision(9) << djo << endl; (*log) << "bi = " << setw(9) << right << setprecision(9) << bi << endl; (*log) << "bj = " << setw(9) << right << setprecision(9) << bj << endl; (*log) << "mini = " << setw(9) << mini << endl; (*log) << "minj = " << setw(9) << minj << endl; (*log) << "av[minj] = " << setw(9) << right << setprecision(9) << av[minj] << endl; (*log) << "av[minj] = " << setw(9) << right << setprecision(9) << av[minj] << endl; #endif if (av[mini] > 0.0) { typei = 0; } else { typei = 1; } if (av[minj] > 0.0) { typej = 0; } else { typej = 1; } if (verbose) { (*log) << "\n Cycle" << setw(4) << nc << " = "; } /* set (tiny? (AW&FS)) negative branch lengths to zero. Also set any tiny positive branch lengths to zero. */ if (fabs(bi) < 0.0001) { bi = 0.0; } if (fabs(bj) < 0.0001) { bj = 0.0; } if (verbose) { if (typei == 0) { (*log) << "Node:" << setw(4) << mini << " (" << setw(9) << setprecision(5) << bi << ") joins "; } else { (*log) << " SEQ:" << setw(4) << mini << " (" << setw(9) << setprecision(5) << bi << ") joins "; } if (typej == 0) { (*log) << "Node:" << setw(4) << minj << " (" << setw(9) << setprecision(5) << bj << ")"; } else { (*log) << " SEQ:" << setw(4) << minj << " (" << setw(9) << setprecision(5) << bj << ")"; } (*log) << "\n"; } phyTree->leftBranch[nc] = bi; phyTree->rightBranch[nc] = bj; for (i = 1; i <= lastSeq - firstSeq + 1; i++) { phyTree->treeDesc[nc][i] = 0; } if (typei == 0) { for (i = nc - 1; i >= 1; i--) if (phyTree->treeDesc[i][mini] == 1) { for (j = 1; j <= lastSeq - firstSeq + 1; j++) if (phyTree->treeDesc[i][j] == 1) { phyTree->treeDesc[nc][j] = 1; } break; } } else { phyTree->treeDesc[nc][mini] = 1; } if (typej == 0) { for (i = nc - 1; i >= 1; i--) if (phyTree->treeDesc[i][minj] == 1) { for (j = 1; j <= lastSeq - firstSeq + 1; j++) if (phyTree->treeDesc[i][j] == 1) { phyTree->treeDesc[nc][j] = 1; } break; } } else { phyTree->treeDesc[nc][minj] = 1; } /* Here is where the -0.00005 branch lengths come from for 3 or more identical seqs. */ /* if(dmin <= 0.0) dmin = 0.0001; */ if (dmin <= 0.0) { dmin = 0.000001; } av[mini] = dmin * 0.5; /*........................Re-initialisation................................*/ fnseqs = fnseqs - 1.0; tkill[minj] = 1; /* IMPROVEMENT 2, STEP 3 : Remove tvalid[minj] from chain list. */ /* [ Before ] * +---------+ +---------+ +---------+ * |prev |<-------|prev |<-------|prev |<--- * | n | | n(=minj)| | n | * | next|------->| next|------->| next|---- * +---------+ +---------+ +---------+ * * [ After ] * +---------+ +---------+ * |prev |<--------------------------|prev |<--- * | n | | n | * | next|-------------------------->| next|---- * +---------+ +---------+ * +---------+ * NULL---|prev | * | n(=minj)| * | next|---NULL * +---------+ */ (tvalid[minj].prev)->next = tvalid[minj].next; if (tvalid[minj].next != NULL) { (tvalid[minj].next)->prev = tvalid[minj].prev; } tvalid[minj].prev = tvalid[minj].next = NULL; /* IMPROVEMENT 1, STEP 5 : re-calculate sum values. */ for (lpj = tvalid[0].next; lpj != NULL; lpj = lpj->next) { double tmp_di = 0.0; double tmp_dj = 0.0; j = lpj->n; /* * subtrace a score value related with 'minj' from * sum arrays . */ if (j < minj) { tmp_dj = (*distMat)(j, minj); sumCols[j] -= tmp_dj; } else if (j > minj) { tmp_dj = (*distMat)(minj, j); sumRows[j] -= tmp_dj; } /* nothing to do when j is equal to minj. */ /* * subtrace a score value related with 'mini' from * sum arrays . */ if (j < mini) { tmp_di = (*distMat)(j, mini); sumCols[j] -= tmp_di; } else if (j > mini) { tmp_di = (*distMat)(mini, j); sumRows[j] -= tmp_di; } /* nothing to do when j is equal to mini. */ /* * calculate a score value of the new inner node. * then, store it temporary to join[] array. */ join[j] = (tmp_dj + tmp_di) *0.5; } /* * 1) * Set the score values (stored in join[]) into the matrix, * row/column position is 'mini'. * 2) * Add a score value of the new inner node to sum arrays. */ for (lpj = tvalid[0].next; lpj != NULL; lpj = lpj->next) { j = lpj->n; if (j < mini) { distMat->SetAt(j, mini, join[j]); sumCols[j] += join[j]; } else if (j > mini) { distMat->SetAt(mini, j, join[j]); sumRows[j] += join[j]; } /* nothing to do when j is equal to mini. */ } /* Re-calculate sumRows[mini],sumCols[mini]. */ sumCols[mini] = sumRows[mini] = 0.0; /* calculate sumRows[mini] */ da = 0.0; for (lpj = tvalid[0].next; lpj->n < mini; lpj = lpj->next) { da = da + join[lpj->n]; } sumRows[mini] = da; /* skip if 'lpj->n' is equal to 'mini' */ if ((lpj != NULL) && (lpj->n == mini)) { lpj = lpj->next; } /* calculate sumCols[mini] */ da = 0.0; for (; lpj != NULL; lpj = lpj->next) { da = da + join[lpj->n]; } sumCols[mini] = da; /* * Clean up sumRows[minj], sumCols[minj] and score matrix * related with 'minj'. */ sumCols[minj] = sumRows[minj] = 0.0; for (j = 1; j <= lastSeq - firstSeq + 1; ++j) { distMat->SetAt(minj, j, 0.0); distMat->SetAt(j, minj, 0.0); join[j] = 0.0; } } /** end main cycle **/ /******************************Last Cycle (3 Seqs. left)********************/ nude = 1; for (lpi = tvalid[0].next; lpi != NULL; lpi = lpi->next) { l[nude] = lpi->n; ++nude; } b1 = ((*distMat)(l[1], l[2]) + (*distMat)(l[1], l[3]) - (*distMat)(l[2], l[3])) *0.5; b2 = (*distMat)(l[1], l[2]) - b1; b3 = (*distMat)(l[1], l[3]) - b1; branch[1] = b1 - av[l[1]]; branch[2] = b2 - av[l[2]]; branch[3] = b3 - av[l[3]]; /* Reset tiny negative and positive branch lengths to zero */ if (fabs(branch[1]) < 0.0001) { branch[1] = 0.0; } if (fabs(branch[2]) < 0.0001) { branch[2] = 0.0; } if (fabs(branch[3]) < 0.0001) { branch[3] = 0.0; } phyTree->leftBranch[lastSeq - firstSeq + 1-2] = branch[1]; phyTree->leftBranch[lastSeq - firstSeq + 1-1] = branch[2]; phyTree->leftBranch[lastSeq - firstSeq + 1] = branch[3]; for (i = 1; i <= lastSeq - firstSeq + 1; i++) { phyTree->treeDesc[lastSeq - firstSeq + 1-2][i] = 0; } if (verbose) { (*log) << "\n Cycle" << setw(4) << nc << " (Last cycle, trichotomy):\n"; } for (i = 1; i <= 3; ++i) { if (av[l[i]] > 0.0) { if (verbose) { (*log) << "\n\t\t Node:" << setw(4) << l[i] <<" (" << setw(9) << setprecision(5) << branch[i] << ") "; } for (k = lastSeq - firstSeq + 1-3; k >= 1; k--) if (phyTree->treeDesc[k][l[i]] == 1) { for (j = 1; j <= lastSeq - firstSeq + 1; j++) if (phyTree->treeDesc[k][j] == 1) { phyTree->treeDesc[lastSeq - firstSeq + 1-2][j] = i; } break; } } else { if (verbose) { (*log) << "\n\t\t SEQ:" << setw(4) << l[i] << " (" << setw(9) << setprecision(5) << branch[i] << ") "; } phyTree->treeDesc[lastSeq - firstSeq + 1-2][l[i]] = i; } if (i < 3) { if (verbose) { (*log) << "joins"; } } } if (verbose) { (*log) << "\n"; } /* IMPROVEMENT 2, STEP 4 : release memory area */ delete [] tvalid; delete [] sumCols; delete [] sumRows; delete [] join; } } clustalw-2.1/src/tree/TreeInterface.h0000644000175000017500000002001611442167171014555 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * Mark 10-5-2007: Bug fix # 42. Added getWeightsForQtLowScore function. * * */ #ifndef TREEINTERFACE_H #define TREEINTERFACE_H #include #include #include #include "AlignmentSteps.h" #include "../alignment/Alignment.h" #include "../general/clustalw.h" namespace clustalw { using namespace std; class Tree; class RootedGuideTree; class TreeInterface { public: /** * This function will be used to generate the phylogenetic tree from the distMat using * either UPGMA or NJ. It will then calculate the seqWeights and the steps. * Note the Distmat * will be in similarity form after this. It will no longer be distances!!!!! */ auto_ptr getWeightsAndStepsFromDistMat(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); /** * This will be called by sequencesAlignToProfile and QTcalcWeightsForLowScoreSeg */ void getWeightsFromDistMat(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); void getWeightsForQtLowScore(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); /** * This function will be called from doAlignUseOldTree */ auto_ptr getWeightsAndStepsFromTree(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int numSeqs, bool* success); /** * This function will be called from sequencesAlignToProfile, it doesnt calc the * steps. */ int getWeightsFromGuideTree(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success); /** * This function is used to generate 2 guide trees for the profile align part. * IT must be done on its own. It calls calcPairwiseForProfileAlign in MSA. * It is called by profileAlign and removeFirstIterate. */ void getWeightsForProfileAlign(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success); /** * This function is used to generate the guide tree from the distance matrix. * It doesnt return * any seqWeights or AlignmentSteps. It will be used by doGuideTreeOnly */ void generateTreeFromDistMat(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); /** * This function is to simply to call either the UPGMA or NJ version of * this function, and print out all the trees. It will be called * from phylogeneticTree in the clustal class. */ void treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr); /** * This function will be used to bootstrap the tree and output the results. * It will use either * UPGMA or NJ for the bootstrapping, depending on what is selected. */ void bootstrapTree(TreeNames* treeNames, Alignment *alignPtr); private: auto_ptr getWeightsAndStepsFromDistMatNJ(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); auto_ptr getWeightsAndStepsUseOldGuideTreeNJ(DistMatrix* distMat, Alignment *alignPtr, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success); int readTreeAndCalcWeightsNJ(Tree* groupTree, Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs); int getWeightsFromGuideTreeNJ(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success); void getWeightsFromDistMatNJ(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); void getWeightsForProfileAlignNJ(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success); void generateTreeFromDistMatNJ(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); auto_ptr getWeightsAndStepsFromTreeNJ(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int numSeqs, bool* success); /** UPGMA functions */ auto_ptr getWeightsAndStepsFromDistMatUPGMA(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); auto_ptr generateTreeFromDistMatUPGMA(RootedGuideTree* guideTree, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); void getWeightsFromDistMatUPGMA(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success); void getWeightsForProfileAlignUPGMA(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success); }; } #endif clustalw-2.1/src/tree/TreeInterface.cpp0000644000175000017500000005205311442167171015116 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * Changes: * Mark 10-5-2007: Bug fix # 42. Added getWeightsForQtLowScore function. * Mark 22-5-2007: Made a change to getWeightsForQtLowScore * Mark 23-5-2007: Made a change to getWeightsForQtLowScore */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "TreeInterface.h" #include #include "UnRootedClusterTree.h" #include "Tree.h" #include "../multipleAlign/MSA.h" #include "../general/userparams.h" #include "../general/debuglogObject.h" #include "UPGMA/RootedGuideTree.h" #include "UPGMA/RootedClusterTree.h" namespace clustalw { /** * This will be called by align! * */ auto_ptr TreeInterface::getWeightsAndStepsFromDistMat(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { #if DEBUGFULL if(logObject && DEBUGLOG) { logObject->logMsg("In getWeightsAndStepsFromDistMat\n"); } #endif if(userParameters->getClusterAlgorithm() == UPGMA) { return getWeightsAndStepsFromDistMatUPGMA(seqWeights, distMat, alignPtr, seq1, nSeqs, phylipName, success); } else { return getWeightsAndStepsFromDistMatNJ(seqWeights, distMat, alignPtr, seq1, nSeqs, phylipName, success); } } /** * This will be called by sequencesAlignToProfile. This function will put the distMat into * a similarity matrix. */ void TreeInterface::getWeightsFromDistMat(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { if(userParameters->getClusterAlgorithm() == UPGMA) { getWeightsFromDistMatUPGMA(seqWeights, distMat, alignPtr, seq1, nSeqs, phylipName, success); } else { getWeightsFromDistMatNJ(seqWeights, distMat, alignPtr, seq1, nSeqs, phylipName, success); } } /** * This function will be called by profileAlign */ void TreeInterface::getWeightsForProfileAlign(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success) { if(userParameters->getClusterAlgorithm() == UPGMA) { getWeightsForProfileAlignUPGMA(alignPtr, distMat, p1TreeName, p1Weights, p2TreeName, p2Weights, numSeqs, profile1NumSeqs, useTree1, useTree2, success); } else { getWeightsForProfileAlignNJ(alignPtr, distMat, p1TreeName, p1Weights, p2TreeName, p2Weights, numSeqs, profile1NumSeqs, useTree1, useTree2, success); } } /** * This function will be called by doAlignUseOldGuideTree * */ auto_ptr TreeInterface::getWeightsAndStepsFromTree(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int numSeqs, bool* success) { /** * This will only use the NJ. It will not use UPGMA */ return getWeightsAndStepsFromTreeNJ(alignPtr, distMat, treeName, seqWeights, fSeq, numSeqs, success); } /** * Called by sequencesAlignToProfile */ int TreeInterface::getWeightsFromGuideTree(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success) { /** * This will only use the NJ. It will not use UPGMA */ return getWeightsFromGuideTreeNJ(alignPtr, distMat, treeName, seqWeights, fSeq, nSeqs, success); } /** * This will be called by doGuideTreeOnly. This does not put the distMat into similarity. * */ void TreeInterface::generateTreeFromDistMat(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { /** * This function does not put distMat into similarities */ if(userParameters->getClusterAlgorithm() == UPGMA) { RootedGuideTree guideTree; generateTreeFromDistMatUPGMA(&guideTree, distMat, alignPtr, seq1, nSeqs, phylipName, success); } else { generateTreeFromDistMatNJ(distMat, alignPtr, seq1, nSeqs, phylipName, success); } } void TreeInterface::treeFromAlignment(TreeNames* treeNames, Alignment *alignPtr) { if(userParameters->getClusterAlgorithm() == UPGMA) { RootedClusterTree clusterTree; clusterTree.treeFromAlignment(treeNames, alignPtr); } else { UnRootedClusterTree clusterTree; clusterTree.treeFromAlignment(treeNames, alignPtr); } } void TreeInterface::bootstrapTree(TreeNames* treeNames, Alignment *alignPtr) { /** * NOTE We only do bootstrapping on the NJ tree. */ UnRootedClusterTree clusterTree; clusterTree.bootstrapTree(treeNames, alignPtr); } /** * Private functions!!!! * */ /** ******************* * * Neighbour joining functions */ /** * Note: After this function has been called the distance matrix will all be in similarities. * */ auto_ptr TreeInterface::getWeightsAndStepsFromDistMatNJ(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { auto_ptr progSteps; generateTreeFromDistMatNJ(distMat, alignPtr, seq1, nSeqs, phylipName, success); progSteps = getWeightsAndStepsUseOldGuideTreeNJ(distMat, alignPtr, phylipName, seqWeights, seq1, nSeqs, success); return progSteps; } auto_ptr TreeInterface::getWeightsAndStepsUseOldGuideTreeNJ(DistMatrix* distMat, Alignment *alignPtr, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success) { Tree groupTree; auto_ptr progSteps; if(nSeqs == 1) { utilityObject->info("Only 1 sequence, cannot do multiple alignment\n"); *success = false; return progSteps; } int status = 0; status = readTreeAndCalcWeightsNJ(&groupTree, alignPtr, distMat, treeName, seqWeights, fSeq, nSeqs); if(status == 0) { *success = false; return progSteps; } progSteps = groupTree.createSets(0, nSeqs); int _numSteps = progSteps->getNumSteps(); utilityObject->info("There are %d groups", _numSteps); // clear the memory used for the phylogenetic tree if (nSeqs >= 2) { groupTree.clearTree(NULL); } *success = true; return progSteps; } /** * The function readTreeAndCalcWeightsNJ is used to read in the tree given the treeName. * It then calls the appropriate functions to calc the seqWeights and make sure the matrix * is in similarity mode. */ int TreeInterface::readTreeAndCalcWeightsNJ(Tree* groupTree, Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs) { int status = 0; if (nSeqs >= 2) { status = groupTree->readTree(alignPtr, treeName->c_str(), fSeq - 1, nSeqs); if (status == 0) { return status; } } groupTree->calcSeqWeights(fSeq - 1, nSeqs, seqWeights); status = groupTree->calcSimilarities(alignPtr, distMat); return status; } int TreeInterface::getWeightsFromGuideTreeNJ(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int nSeqs, bool* success) { Tree groupTree; int status = readTreeAndCalcWeightsNJ(&groupTree, alignPtr, distMat, treeName, seqWeights, fSeq, nSeqs); if(status == 0) { *success = false; } else { *success = true; } return status; } void TreeInterface::getWeightsFromDistMatNJ(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int _nSeqs, string* phylipName, bool* success) { string copyOfPhylipName = string(*phylipName); int nSeqs = _nSeqs; int status = 0; generateTreeFromDistMatNJ(distMat, alignPtr, seq1, nSeqs, phylipName, success); Tree groupTree; status = readTreeAndCalcWeightsNJ(&groupTree, alignPtr, distMat, phylipName, seqWeights, seq1, nSeqs); if(status == 0) { *success = false; } else { *success = true; } } void TreeInterface::getWeightsForProfileAlignNJ(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success) { if(!useTree1) { if (profile1NumSeqs >= 2) { generateTreeFromDistMatNJ(distMat, alignPtr, 1, profile1NumSeqs, p1TreeName, success); } } if(!useTree2) { if(numSeqs - profile1NumSeqs >= 2) { generateTreeFromDistMatNJ(distMat, alignPtr, profile1NumSeqs + 1, numSeqs - profile1NumSeqs, p2TreeName, success); } } if (userParameters->getNewTree1File() || userParameters->getNewTree2File()) { *success = false; return; } // MSA->CALCPAIRWISE MSA* msaObj = new MSA(); int count = msaObj->calcPairwiseForProfileAlign(alignPtr, distMat); if (count == 0) { *success = false; return; } Tree groupTree1, groupTree2; int status = 0; if (profile1NumSeqs >= 2) { status = groupTree1.readTree(alignPtr, p1TreeName->c_str(), 0, profile1NumSeqs); if (status == 0) { *success = false; return; } } groupTree1.calcSeqWeights(0, profile1NumSeqs, p1Weights); if (profile1NumSeqs >= 2) { groupTree1.clearTree(NULL); } if (numSeqs - profile1NumSeqs >= 2) { status = groupTree2.readTree(alignPtr, p2TreeName->c_str(), profile1NumSeqs, numSeqs); if (status == 0) { *success = false; return; } } groupTree2.calcSeqWeights(profile1NumSeqs, numSeqs, p2Weights); /* clear the memory for the phylogenetic tree */ if (numSeqs - profile1NumSeqs >= 2) { groupTree2.clearTree(NULL); } /** * Convert distances to similarities!!!!!! */ for (int i = 1; i < numSeqs; i++) { for (int j = i + 1; j <= numSeqs; j++) { (*distMat)(i, j) = 100.0 - (*distMat)(i, j) * 100.0; (*distMat)(j, i) = (*distMat)(i, j); } } *success = true; } void TreeInterface::generateTreeFromDistMatNJ(DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { string copyOfPhylipName = string(*phylipName); if (nSeqs >= 2) { UnRootedClusterTree* clusterTree = new UnRootedClusterTree; clusterTree->treeFromDistMatrix(distMat, alignPtr, seq1, nSeqs, copyOfPhylipName); *phylipName = copyOfPhylipName; // AW: message outputted by OutputFile function // utilityObject->info("Guide tree file created: [%s]", // phylipName->c_str()); delete clusterTree; } *success = true; } auto_ptr TreeInterface::getWeightsAndStepsFromTreeNJ(Alignment* alignPtr, DistMatrix* distMat, string* treeName, vector* seqWeights, int fSeq, int numSeqs, bool* success) { auto_ptr progSteps; Tree groupTree; if(numSeqs == 1) { utilityObject->info("Only 1 sequence, cannot do multiple alignment\n"); *success = false; return progSteps; } int status; status = readTreeAndCalcWeightsNJ(&groupTree, alignPtr, distMat, treeName, seqWeights, fSeq, numSeqs); if (status == 0) { *success = false; return progSteps; } progSteps = groupTree.createSets(0, numSeqs); int _numSteps = progSteps->getNumSteps(); utilityObject->info("There are %d groups", _numSteps); // clear the memory used for the phylogenetic tree if (numSeqs >= 2) { groupTree.clearTree(NULL); } *success = true; return progSteps; } /** * UPGMA functions * */ auto_ptr TreeInterface::getWeightsAndStepsFromDistMatUPGMA(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { auto_ptr progSteps; RootedGuideTree guideTree; progSteps = generateTreeFromDistMatUPGMA(&guideTree, distMat, alignPtr, seq1, nSeqs, phylipName, success); guideTree.calcSeqWeights(0, nSeqs, seqWeights); distMat->makeSimilarityMatrix(); return progSteps; } auto_ptr TreeInterface::generateTreeFromDistMatUPGMA(RootedGuideTree* guideTree, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { auto_ptr progSteps; string copyOfPhylipName = string(*phylipName); if (nSeqs >= 2) { RootedClusterTree clusterTree; progSteps = clusterTree.treeFromDistMatrix(guideTree, distMat, alignPtr, seq1, nSeqs, copyOfPhylipName); *phylipName = copyOfPhylipName; // AW: message outputted by OutputFile function // utilityObject->info("Guide tree file created: [%s]", // phylipName->c_str()); } *success = true; return progSteps; } void TreeInterface::getWeightsFromDistMatUPGMA(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { getWeightsAndStepsFromDistMatUPGMA(seqWeights, distMat, alignPtr, seq1, nSeqs, phylipName, success); } /** * The function getWeightsForProfileAlignUPGMA is used to generate the sequence weights * that will be used in a profile alignment. It also recalculates the distance matrix, and * then returns it as a similarity matrix. This function uses the NJ code to read in a tree * from a file if we are using a previous tree. This is because that part of the code is able * to do the finding of the root etc. */ void TreeInterface::getWeightsForProfileAlignUPGMA(Alignment* alignPtr, DistMatrix* distMat, string* p1TreeName, vector* p1Weights, string* p2TreeName, vector* p2Weights, int numSeqs, int profile1NumSeqs, bool useTree1, bool useTree2, bool* success) { int status = 0; if(useTree1) { // Use the code to read in the tree and get the seqWeights Tree groupTree1; if (profile1NumSeqs >= 2) { status = groupTree1.readTree(alignPtr, p1TreeName->c_str(), 0, profile1NumSeqs); if (status == 0) { *success = false; return; } } groupTree1.calcSeqWeights(0, profile1NumSeqs, p1Weights); if (profile1NumSeqs >= 2) { groupTree1.clearTree(NULL); } } else { if (profile1NumSeqs >= 2) { RootedGuideTree guideTree; generateTreeFromDistMatUPGMA(&guideTree, distMat, alignPtr, 1, profile1NumSeqs, p1TreeName, success); guideTree.calcSeqWeights(0, profile1NumSeqs, p1Weights); } } if(useTree2) { Tree groupTree2; if (numSeqs - profile1NumSeqs >= 2) { status = groupTree2.readTree(alignPtr, p2TreeName->c_str(), profile1NumSeqs, numSeqs); if (status == 0) { *success = false; return; } } groupTree2.calcSeqWeights(profile1NumSeqs, numSeqs, p2Weights); if (numSeqs - profile1NumSeqs >= 2) { groupTree2.clearTree(NULL); } } else { if(numSeqs - profile1NumSeqs >= 2) { RootedGuideTree guideTree; generateTreeFromDistMatUPGMA(&guideTree, distMat, alignPtr, profile1NumSeqs + 1, numSeqs - profile1NumSeqs, p2TreeName, success); guideTree.calcSeqWeights(profile1NumSeqs, numSeqs, p2Weights); } } if (userParameters->getNewTree1File() || userParameters->getNewTree2File()) { *success = false; return; } MSA* msaObj = new MSA(); int count = msaObj->calcPairwiseForProfileAlign(alignPtr, distMat); delete msaObj; if (count == 0) { *success = false; return; } /** * Convert distances to similarities!!!!!! */ distMat->makeSimilarityMatrix(); *success = true; } /** * Mark 10-5-2007: Bug fix # 42 * The following function is to be used only for calculating the weights for the Qt * low scoring segments. */ void TreeInterface::getWeightsForQtLowScore(vector* seqWeights, DistMatrix* distMat, Alignment *alignPtr, int seq1, int nSeqs, string* phylipName, bool* success) { string copyOfPhylipName = string(*phylipName); int _nSeqs = nSeqs; int status = 0; generateTreeFromDistMatNJ(distMat, alignPtr, seq1, _nSeqs, phylipName, success); Tree groupTree; status = 0; if (_nSeqs >= 2) { status = groupTree.readTree(alignPtr, phylipName->c_str(), seq1 - 1, seq1 + _nSeqs-1); // mark 22-5-07 if(status == 0) { *success = false; return; } else { *success = true; } } groupTree.calcSeqWeights(seq1 - 1, seq1 + _nSeqs - 1, seqWeights); // mark 23-5-07 } } clustalw-2.1/src/tree/AlignmentSteps.h0000644000175000017500000000231411442167171014773 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /** * The AlignmentSteps class is used to hold the progressive alignment steps that have * been calculated from the guide tree. * * Note: I have pushed an empty vector onto steps, so that the steps will match up * with the old sets array. * ***************************************************************************************/ #ifndef ALIGNMENTSTEPS_H #define ALIGNMENTSTEPS_H #include #include #include using namespace std; namespace clustalw { class AlignmentSteps { public: /* Functions */ AlignmentSteps() : numSteps(0){steps.push_back(vector());}; // Empty vector void saveSet(int n, int *groups); void saveSet(vector* groups); int getNumSteps(); string getNextStep(); void printAlignSteps(); const vector >* getSteps(){return &steps;}; vector* getStep(int i){return &steps[i];}; void clear(); /* Attributes */ private: /* Functions */ /* Attributes */ vector > steps; int numSteps; }; } #endif clustalw-2.1/src/tree/Tree.cpp0000644000175000017500000006535111453342513013277 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "Tree.h" namespace clustalw { /** * * @param firstSeq * @param lastSeq * @param sweight */ void Tree::calcSeqWeights(int firstSeq, int lastSeq, vector* sweight) { if((int)sweight->size() < lastSeq - 1) { sweight->resize(lastSeq - 1); } int i, _nSeqs; int temp, sum; int *weight; /* * If there are more than three sequences.... */ _nSeqs = lastSeq - firstSeq; if ((_nSeqs >= 2) && (clustalw::userParameters->getDistanceTree() == true) && (clustalw::userParameters->getNoWeights() == false)) { /* * Calculate sequence weights based on Phylip tree. */ weight = new int[lastSeq + 1]; for (i = firstSeq; i < lastSeq; i++) { weight[i] = calcWeight(i); } /* * Normalise the weights, such that the sum of the weights = INT_SCALE_FACTOR */ sum = 0; for (i = firstSeq; i < lastSeq; i++) { sum += weight[i]; } if (sum == 0) { for (i = firstSeq; i < lastSeq; i++) { weight[i] = 1; } sum = i; } for (i = firstSeq; i < lastSeq; i++) { (*sweight)[i] = (weight[i] * INT_SCALE_FACTOR) / sum; if ((*sweight)[i] < 1) { (*sweight)[i] = 1; } } delete []weight; weight = NULL; } else { /* * Otherwise, use identity weights. */ temp = INT_SCALE_FACTOR / _nSeqs; // AW 2009-05-28: goes wrong if we have more than // INT_SCALE_FACTOR seqs. if so, set to 1, just as above if (temp < 1) temp = 1; for (i = firstSeq; i < lastSeq; i++) { (*sweight)[i] = temp; } } } /** * * @param alignPtr * @param treeFileName * @param firstSeq * @param lastSeq * @return */ int Tree::readTree(clustalw::Alignment* alignPtr, const string& treeFileName, int firstSeq, int lastSeq) { if(alignPtr == NULL || firstSeq < 0 || lastSeq < 1) { return 0; } char c; string name1 = "", name2 = ""; int i, j, k; bool found; numSeq = 0; nnodes = 0; ntotal = 0; rootedTree = true; // Need to check what happens if I try to open a file that doesnt exist! if(treeFileName.empty()) { return 0; // Cannot open, empty string! } else { file.open(treeFileName.c_str(), ifstream::in); if(!file.is_open()) { clustalw::utilityObject->error("Cannot open output file [%s]\n", treeFileName.c_str()); } } skipSpace(&file); charFromFile = file.get(); if (charFromFile != '(') { clustalw::utilityObject->error("Wrong format in tree file %s\n", treeFileName.c_str()); return 0; } file.seekg(0, ios::beg); // Put get pointer back to the begining! clustalw::userParameters->setDistanceTree(true); // Allocate memory for tree // Allocate memory. nptr = new TreeNode*[3 * (lastSeq - firstSeq + 1)]; ptrs = new TreeNode*[3 * (lastSeq - firstSeq + 1)]; lptr = new TreeNode*[lastSeq - firstSeq + 1]; olptr = new TreeNode*[lastSeq + 1]; seqTree = avail(); setInfo(seqTree, NULL, 0, string(""), 0.0); createTree(seqTree, NULL, &file); file.close(); if (numSeq != lastSeq - firstSeq) { stringstream ss; ss << "tree not compatible with alignment\n(" << lastSeq - firstSeq << " sequences in alignment and "<< numSeq <<" in tree\n"; string errorMes; ss >> errorMes; clustalw::utilityObject->error(errorMes.c_str()); return 0; } // If the tree is unrooted, reroot the tree - ie. minimise the difference // between the mean root->leaf distances for the left and right branches of // the tree. if (clustalw::userParameters->getDistanceTree() == false) { if (rootedTree == false) { clustalw::utilityObject->error("input tree is unrooted and has no distances.\nCannot align sequences"); return 0; } } if (rootedTree == false) { root = reRoot(seqTree, lastSeq - firstSeq + 1); } else { root = seqTree; } // calculate the 'order' of each node. int nameLength; string nameSeq; orderNodes(); if (numSeq >= 2) { // If there are more than three sequences.... // assign the sequence nodes (in the same order as in the alignment file) for (i = firstSeq; i < lastSeq; i++) { nameLength = alignPtr->getName(i + 1).length(); nameSeq = alignPtr->getName(i + 1); name1 = ""; name2 = ""; if (nameLength > clustalw::MAXNAMES) { stringstream ss; ss << "name " << nameSeq << " is too long for PHYLIP tree format (max " << clustalw::MAXNAMES << " chars)"; string msg; ss >> msg; clustalw::utilityObject->warning(msg.c_str());// Mark change 17-5-07 } for (k = 0; k < nameLength && k < clustalw::MAXNAMES; k++) { c = nameSeq[k]; if ((c > 0x40) && (c < 0x5b)) { c = c | 0x20; } if (c == ' ') { c = '_'; } name2 += c; } found = false; for (j = 0; j < numSeq; j++) { name1 = ""; for (k = 0; k < (int)lptr[j]->name.length() && k < clustalw::MAXNAMES; k++) { c = lptr[j]->name[k]; if ((c > 0x40) && (c < 0x5b)) { c = c | 0x20; } name1 += c; } if (name1.compare(name2) == 0) { olptr[i] = lptr[j]; found = true; } } if (found == false) { utilityObject->error("tree not compatible with alignment:\n %s not found\n", name2.c_str()); return 0; } } } return (1); } /** * * @param firstSeq * @param lastSeq * @return */ auto_ptr Tree::createSets(int firstSeq, int lastSeq) { auto_ptr progAlignSteps; progAlignSteps.reset(new AlignmentSteps); int i, j, _nSeqs; numSets = 0; _nSeqs = lastSeq - firstSeq; if (_nSeqs >= 2) { // If there are more than three sequences.... groups = new int[_nSeqs + 1]; groupSeqs(root, groups, _nSeqs, progAlignSteps.get()); delete []groups; groups = NULL; } else { groups = new int[_nSeqs + 1]; for (i = 0; i < _nSeqs - 1; i++) { for (j = 0; j < _nSeqs; j++) if (j <= i) { groups[j] = 1; } else if (j == i + 1) { groups[j] = 2; } else { groups[j] = 0; } progAlignSteps->saveSet(_nSeqs, groups); } delete []groups; groups = NULL; } return progAlignSteps; } /** * calcSimilarities changes the distMat. * @param alignPtr * @param distMat * @return */ int Tree::calcSimilarities(clustalw::Alignment* alignPtr, clustalw::DistMatrix* distMat) { int depth = 0, i, j, k, n; bool found; int nerrs, seq1[MAXERRS], seq2[MAXERRS]; TreeNode *p, **pathToRoot; float dist; float *distToNode, badDist[MAXERRS]; double **dmat; ostringstream err1; char reply; int nSeqs = alignPtr->getNumSeqs(); pathToRoot = new TreeNode*[nSeqs]; distToNode = new float[nSeqs]; dmat = new double*[nSeqs]; for (i = 0; i < nSeqs; i++) { dmat[i] = new double[nSeqs]; } if (nSeqs >= 2) { /* * for each leaf, determine all nodes between the leaf and the root; */ for (i = 0; i < nSeqs; i++) { depth = 0;dist = 0.0; p = olptr[i]; while (p != NULL) { pathToRoot[depth] = p; dist += p->dist; distToNode[depth] = dist; p = p->parent; depth++; } /* * for each pair.... */ for (j = 0; j < i; j++) { p = olptr[j]; dist = 0.0; /* * find the common ancestor. */ found = false; n = 0; while ((found == false) && (p->parent != NULL)) { for (k = 0; k < depth; k++) if (p->parent == pathToRoot[k]) { found = true; n = k; } dist += p->dist; p = p->parent; } dmat[i][j] = dist + distToNode[n - 1]; } } nerrs = 0; for (i = 0; i < nSeqs; i++) { dmat[i][i] = 0.0; for (j = 0; j < i; j++) { if (dmat[i][j] < 0.01) { dmat[i][j] = 0.01; } if (dmat[i][j] > 1.0) { if (dmat[i][j] > 1.1 && nerrs < MAXERRS) { seq1[nerrs] = i; seq2[nerrs] = j; badDist[nerrs] = dmat[i][j]; nerrs++; } dmat[i][j] = 1.0; } } } if (nerrs > 0 && !userParameters->getGui()) { string errMess = "The following sequences are too divergent to be aligned:\n"; for (i = 0; i < nerrs && i < 5; i++) { err1 << " " << alignPtr->getName(seq1[i] + 1) << " and " << alignPtr->getName(seq2[i] + 1) << " (distance " << setprecision(3) << badDist[i] << ")\n"; } errMess += err1.str(); errMess += "(All distances should be between 0.0 and 1.0)\n"; errMess += "This may not be fatal but you have been warned!\n"; errMess += "SUGGESTION: Remove one or more problem sequences and try again"; if (clustalw::userParameters->getInteractive()) { reply = clustalw::utilityObject->promptForYesNo(errMess.c_str(), "Continue "); } else { reply = 'y'; } if ((reply != 'y') && (reply != 'Y')) { return 0; } } } else { for (i = 0; i < nSeqs; i++) { for (j = 0; j < i; j++) { dmat[i][j] = (*distMat)(i + 1, j + 1); } } } delete []pathToRoot; delete []distToNode; double value; for (i = 0; i < nSeqs; i++) { distMat->SetAt(i + 1, i + 1, 0.0); for (j = 0; j < i; j++) { value = 100.0 - (dmat[i][j]) * 100.0; distMat->SetAt(i + 1, j + 1, value); distMat->SetAt(j + 1, i + 1, value); } } for (i = 0; i < nSeqs; i++) { delete [] dmat[i]; } delete []dmat; return 1; } /** ************************************************************************* * Private functions!!!!!!!!!!!!!!! * ****************************************************************************/ /** * * @param ptree * @param parent * @param file */ void Tree::createTree(clustalw::TreeNode* ptree, clustalw::TreeNode* parent, ifstream* file) { TreeNode* p; int i, type; float dist; string name; // is this a node or a leaf ? skipSpace(file); charFromFile = file->get(); if (charFromFile == '(') { // this must be a node.... type = NODE; name = ""; ptrs[ntotal] = nptr[nnodes] = ptree; nnodes++; ntotal++; createNode(ptree, parent); p = ptree->left; createTree(p, ptree, file); if (charFromFile == ',') { p = ptree->right; createTree(p, ptree, file); if (charFromFile == ',') { ptree = insertNode(ptree); ptrs[ntotal] = nptr[nnodes] = ptree; nnodes++; ntotal++; p = ptree->right; createTree(p, ptree, file); rootedTree = false; } } skipSpace(file); charFromFile = file->get(); } // ...otherwise, this is a leaf else { type = LEAF; ptrs[ntotal++] = lptr[numSeq++] = ptree; // get the sequence name name = ""; name += charFromFile; charFromFile = file->get(); i = 1; while ((charFromFile != ':') && (charFromFile != ',') && (charFromFile != ')')) { if (i < MAXNAMES) { name += charFromFile; i++; } charFromFile = file->get(); } if (charFromFile != ':') { clustalw::userParameters->setDistanceTree(false); dist = 0.0; } } // get the distance information dist = 0.0; if (charFromFile == ':') { skipSpace(file); (*file) >> dist; skipSpace(file); charFromFile = file->get(); } setInfo(ptree, parent, type, name, dist); } /** * * @param pptr * @param parent */ void Tree::createNode(TreeNode* pptr, TreeNode* parent) { TreeNode* t; pptr->parent = parent; t = avail(); pptr->left = t; t = avail(); pptr->right = t; } /** * * @param pptr * @return */ TreeNode* Tree::insertNode(TreeNode* pptr) { TreeNode* newnode; newnode = avail(); createNode(newnode, pptr->parent); newnode->left = pptr; pptr->parent = newnode; setInfo(newnode, pptr->parent, NODE, "", 0.0); return newnode; } /** * * @param p */ void Tree::clearTree(clustalw::TreeNode* p) { clearTreeNodes(p); delete [] nptr; nptr = NULL; delete [] ptrs; ptrs = NULL; delete [] lptr; lptr = NULL; delete [] olptr; olptr = NULL; } /** * * @param p */ void Tree::clearTreeNodes(clustalw::TreeNode* p) { if (p == NULL) { p = root; } if (p->left != NULL) { clearTreeNodes(p->left); } if (p->right != NULL) { clearTreeNodes(p->right); } p->left = NULL; p->right = NULL; delete p; p = NULL; } /** * * @param * @param * @return */ void Tree::debugPrintAllNodes(int nseqs) { clustalw::TreeNode *p; int i; float diff, maxDist; cerr << "\nDEBUG: reportAllNodes\n"; for (i = 0; i < ntotal; i++) { p = ptrs[i]; // ios::sync_with_stdio(); // same design as TreeNode if (p->parent == NULL) diff = calcRootMean(p, &maxDist); else diff = calcMean(p, &maxDist, nseqs); fprintf(stdout, "i=%d p=%p: parent=%p left=%p right=%p dist=%f diff=%f\n", i, (void*)p, (void*)p->parent, (void*)p->left, (void*)p->right, p->dist, diff); } } /** * * @param ptree * @param nseqs * @return */ clustalw::TreeNode* Tree::reRoot(clustalw::TreeNode* ptree, int nseqs) { clustalw::TreeNode *p, *rootNode, *rootPtr; float diff, minDiff = 0.0, minDepth = 1.0, maxDist; int i; bool first = true; // find the difference between the means of leaf->node // distances on the left and on the right of each node rootPtr = ptree; for (i = 0; i < ntotal; i++) { p = ptrs[i]; if (p->parent == NULL) { /* AW Bug 94: p->parent must be chosen as rootNode (non-optimized executables (-O0) never do), otherwise insertRoot fails. Is p->parent == NULL valid at all? Simplest thing for now is to continue here. Tree code needs serious dismantling anyway. See debugPrintAllNodes */ continue; //diff = calcRootMean(p, &maxDist); } else { diff = calcMean(p, &maxDist, nseqs); } if ((diff == 0) || ((diff > 0) && (diff < 2 *p->dist))) { if ((maxDist < minDepth) || (first == true)) { first = false; rootPtr = p; minDepth = maxDist; minDiff = diff; } } } // insert a new node as the ancestor of the node which produces the shallowest // tree. /* AW Bug 94: could also be prevented here */ if (rootPtr == ptree) { minDiff = rootPtr->left->dist + rootPtr->right->dist; rootPtr = rootPtr->right; } rootNode = insertRoot(rootPtr, minDiff); diff = calcRootMean(rootNode, &maxDist); return rootNode; } /** * * @param p * @param diff * @return */ clustalw::TreeNode* Tree::insertRoot(clustalw::TreeNode* p, float diff) { clustalw::TreeNode *newp, *prev, *q, *t; float dist, prevDist, td; newp = avail(); if (p->parent==NULL) { // AW bug 94: question remains if access here should be handled differently cerr << "\n\n*** INTERNAL ERROR: Tree::insertRoot: TreeNode p->parent is NULL\n"; cerr << "To help us fix this bug, please send sequence file and used options to clustalw@ucd.ie\n"; exit(1); } t = p->parent; prevDist = t->dist; p->parent = newp; dist = p->dist; p->dist = diff / 2; if (p->dist < 0.0) { p->dist = 0.0; } if (p->dist > dist) { p->dist = dist; } t->dist = dist - p->dist; newp->left = t; newp->right = p; newp->parent = NULL; newp->dist = 0.0; newp->leaf = NODE; if (t->left == p) { t->left = t->parent; } else { t->right = t->parent; } prev = t; q = t->parent; t->parent = newp; while (q != NULL) { if (q->left == prev) { q->left = q->parent; q->parent = prev; td = q->dist; q->dist = prevDist; prevDist = td; prev = q; q = q->left; } else { q->right = q->parent; q->parent = prev; td = q->dist; q->dist = prevDist; prevDist = td; prev = q; q = q->right; } } /* * remove the old root node */ q = prev; if (q->left == NULL) { dist = q->dist; q = q->right; q->dist += dist; q->parent = prev->parent; if (prev->parent->left == prev) { prev->parent->left = q; } else { prev->parent->right = q; } prev->right = NULL; } else { dist = q->dist; q = q->left; q->dist += dist; q->parent = prev->parent; if (prev->parent->left == prev) { prev->parent->left = q; } else { prev->parent->right = q; } prev->left = NULL; } return (newp); } /** * * @param root * @param maxDist * @return */ float Tree::calcRootMean(clustalw::TreeNode* root, float *maxDist) { float dist, leftSum = 0.0, rightSum = 0.0, leftMean, rightMean, diff; clustalw::TreeNode* p; int i; int numLeft, numRight; int direction; // for each leaf, determine whether the leaf is left or right of the root. dist = (*maxDist) = 0; numLeft = numRight = 0; for (i = 0; i < numSeq; i++) { p = lptr[i]; dist = 0.0; while (p->parent != root) { dist += p->dist; p = p->parent; } if (p == root->left) { direction = LEFT; } else { direction = RIGHT; } dist += p->dist; if (direction == LEFT) { leftSum += dist; numLeft++; } else { rightSum += dist; numRight++; } if (dist > (*maxDist)) { *maxDist = dist; } } leftMean = leftSum / numLeft; rightMean = rightSum / numRight; diff = leftMean - rightMean; return diff; } /** * * @param nptr * @param maxDist * @param nSeqs * @return */ float Tree::calcMean(clustalw::TreeNode* nptr, float *maxDist, int nSeqs) { float dist, leftSum = 0.0, rightSum = 0.0, leftMean, rightMean, diff; clustalw::TreeNode* p; clustalw::TreeNode** pathToRoot; float *distToNode; int depth = 0, i, j, n = 0; int numLeft, numRight; int direction; bool found; pathToRoot = new clustalw::TreeNode*[nSeqs]; distToNode = new float[nSeqs]; // determine all nodes between the selected node and the root; depth = 0; (*maxDist) = dist = 0.0; numLeft = numRight = 0; p = nptr; while (p != NULL) { pathToRoot[depth] = p; dist += p->dist; distToNode[depth] = dist; p = p->parent; depth++; } // for each leaf, determine whether the leaf is left or right of the node. // (RIGHT = descendant, LEFT = not descendant) for (i = 0; i < numSeq; i++) { p = lptr[i]; if (p == nptr) { direction = RIGHT; dist = 0.0; } else { direction = LEFT; dist = 0.0; // find the common ancestor. found = false; n = 0; while ((found == false) && (p->parent != NULL)) { for (j = 0; j < depth; j++) if (p->parent == pathToRoot[j]) { found = true; n = j; } dist += p->dist; p = p->parent; } if (p == nptr) { direction = RIGHT; } } if (direction == LEFT) { leftSum += dist; leftSum += distToNode[n - 1]; numLeft++; } else { rightSum += dist; numRight++; } if (dist > (*maxDist)) { *maxDist = dist; } } delete [] distToNode; distToNode = NULL; delete [] pathToRoot; pathToRoot = NULL; leftMean = leftSum / numLeft; rightMean = rightSum / numRight; diff = leftMean - rightMean; return (diff); } /** * */ void Tree::orderNodes() { int i; clustalw::TreeNode* p; for (i = 0; i < numSeq; i++) { p = lptr[i]; while (p != NULL) { p->order++; p = p->parent; } } } /** * * @param leaf * @return */ int Tree::calcWeight(int leaf) { clustalw::TreeNode* p; float weight = 0.0; p = olptr[leaf]; while (p->parent != NULL) { weight += p->dist / p->order; p = p->parent; } weight *= 100.0; return ((int)weight); } /** * skipSpace is used to skip all the spaces at the begining of a file. The next read * will give a character other than a space. * @param file */ void Tree::skipSpace(ifstream* file) { char c; do { c = file->get(); } while (isspace(c)); file->putback(c); } /** * * @param p * @param nextGroups * @param nSeqs * @param stepsPtr */ void Tree::groupSeqs(clustalw::TreeNode* p, int *nextGroups, int nSeqs, AlignmentSteps* stepsPtr) { int i; int *tmpGroups; tmpGroups = new int[nSeqs + 1]; for (i = 0; i < nSeqs; i++) { tmpGroups[i] = 0; } if (p->left != NULL) { if (p->left->leaf == NODE) { groupSeqs(p->left, nextGroups, nSeqs, stepsPtr); for (i = 0; i < nSeqs; i++) if (nextGroups[i] != 0) { tmpGroups[i] = 1; } } else { markGroup1(p->left, tmpGroups, nSeqs); } } if (p->right != NULL) { if (p->right->leaf == NODE) { groupSeqs(p->right, nextGroups, nSeqs, stepsPtr); for (i = 0; i < nSeqs; i++) if (nextGroups[i] != 0) { tmpGroups[i] = 2; } } else { markGroup2(p->right, tmpGroups, nSeqs); } stepsPtr->saveSet(nSeqs, tmpGroups); } for (i = 0; i < nSeqs; i++) { nextGroups[i] = tmpGroups[i]; } delete [] tmpGroups; tmpGroups = NULL; } /** * * @param p * @param groups * @param n */ void Tree::markGroup1(clustalw::TreeNode* p, int *groups, int n) { int i; for (i = 0; i < n; i++) { if (olptr[i] == p) { groups[i] = 1; } else { groups[i] = 0; } } } /** * * @param p * @param groups * @param n */ void Tree::markGroup2(clustalw::TreeNode* p, int *groups, int n) { int i; for (i = 0; i < n; i++) { if (olptr[i] == p) { groups[i] = 2; } else if (groups[i] != 0) { groups[i] = 1; } } } /** * * @return */ clustalw::TreeNode* Tree::avail() { clustalw::TreeNode* p; p = new TreeNode; p->left = NULL; p->right = NULL; p->parent = NULL; p->dist = 0.0; p->leaf = 0; p->order = 0; return (p); } /** * * @param p * @param parent * @param pleaf * @param pname * @param pdist */ void Tree::setInfo(TreeNode* p, TreeNode* parent, int pleaf, string pname, float pdist) { p->parent = parent; p->leaf = pleaf; p->dist = pdist; p->order = 0; p->name = pname; if (p->leaf == true) { p->left = NULL; p->right = NULL; } } } clustalw-2.1/src/tree/dayhoff.h0000644000175000017500000000545611442167171013470 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifndef DAYHOFFPAMS2_H #define DAYHOFFPAMS2_H /* Mark tidy up Nov 2005 */ /* DAYHOFF.H Table of estimated PAMS (actual no. of substitutions per 100 residues) for a range of observed amino acid distances from 75.0% (the first entry in the array), in 0.1% increments, up to 93.0%. These values are used to correct for multiple hits in protein alignments. The values below are for observed distances above 74.9%. For values above 93%, an arbitrary value of 1000 PAMS (1000% substitution) is used. These values are derived from a Dayhoff model (1978) of amino acid substitution and assume average amino acid composition and that amino acids replace each other at the same rate as in the original Dayhoff model. Up to 75% observed distance, use Kimura's emprical formula to derive the correction. For 75% or greater, use this table. Kimura's formula is accurate up to about 75% and fails completely above 85%. */ namespace clustalw { int dayhoff_pams[]={ 195, /* 75.0% observed d; 195 PAMs estimated = 195% estimated d */ 196, /* 75.1% observed d; 196 PAMs estimated */ 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 226, 227, 228, 229, 230, 231, 232, 233, 234, 236, 237, 238, 239, 240, 241, 243, 244, 245, 246, 248, 249, 250, /* 250 PAMs = 80.3% observed d */ 252, 253, 254, 255, 257, 258, 260, 261, 262, 264, 265, 267, 268, 270, 271, 273, 274, 276, 277, 279, 281, 282, 284, 285, 287, 289, 291, 292, 294, 296, 298, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323, 325, 328, 330, 332, 335, 337, 339, 342, 344, 347, 349, 352, 354, 357, 360, 362, 365, 368, 371, 374, 377, 380, 383, 386, 389, 393, 396, 399, 403, 407, 410, 414, 418, 422, 426, 430, 434, 438, 442, 447, 451, 456, 461, 466, 471, 476, 482, 487, 493, 498, 504, 511, 517, 524, 531, 538, 545, 553, 560, 569, 577, 586, 595, 605, 615, 626, 637, 649, 661, 675, 688, 703, 719, 736, 754, 775, 796, 819, 845, 874, 907, 945, /* 92.9% observed; 945 PAMs */ 988 /* 93.0% observed; 988 PAMs */ }; } #endif clustalw-2.1/src/tree/AlignmentSteps.cpp0000644000175000017500000000212511442167171015326 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "AlignmentSteps.h" namespace clustalw { void AlignmentSteps::saveSet(int n, int *groups) { vector tempVec; tempVec.resize(n + 1); tempVec[0] = 0; for(int i = 1; i < n + 1; i++) { tempVec[i] = groups[i - 1]; } steps.push_back(tempVec); numSteps++; } void AlignmentSteps::saveSet(vector* groups) { steps.push_back(*groups); numSteps++; } int AlignmentSteps::getNumSteps() { return numSteps; } void AlignmentSteps::printAlignSteps() { int rows = steps.size(); for(int i = 1; i < rows; i++) { for(int j = 1; j < (int)steps[i].size(); j++) { cout << " " << steps[i][j]; } cout << "\n"; } cout << "\n\n"; } void AlignmentSteps::clear() { int size = steps.size(); for(int i = 0; i < size; i++) { steps[i].clear(); } steps.clear(); steps.push_back(vector()); numSteps = 0; } } clustalw-2.1/src/tree/ClusterTree.cpp0000644000175000017500000010121611442167171014633 00000000000000/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ClusterTree.h" #include "../general/utils.h" #include "dayhoff.h" #include "RandomGenerator.h" #include #include #include "../general/OutputFile.h" namespace clustalw { ClusterTree::ClusterTree() : numSeqs(0), firstSeq(0), lastSeq(0) { bootstrapPrompt = "\nEnter name for bootstrap output file "; bootstrapFileTypeMsg = "Bootstrap output"; } /** **************************************************************************************** * The rest are private functions. * * * * * * * *******************************************************************************************/ void ClusterTree::distanceMatrixOutput(ofstream* outFile, clustalw::DistMatrix* matToPrint, clustalw::Alignment *alignPtr) { if(outFile == NULL || !outFile->is_open()) { clustalw::utilityObject->error("Cannot output the distance matrix, file is not open\n"); return; } int i, j; int _maxNames = alignPtr->getMaxNames(); (*outFile) << setw(6) << lastSeq - firstSeq + 1; for (i = 1; i <= lastSeq - firstSeq + 1; i++) { (*outFile) << "\n" << left << setw(_maxNames) << alignPtr->getName(i) << " "; for (j = 1; j <= lastSeq - firstSeq + 1; j++) { (*outFile) << " " << setw(6) << setprecision(3) << fixed << (*matToPrint)(i, j); if (j % 8 == 0) { if (j != lastSeq - firstSeq + 1) { (*outFile) << "\n"; } if (j != lastSeq - firstSeq + 1) { (*outFile) << " "; } } } } } void ClusterTree::overspillMessage(int overspill,int totalDists) { std::ostringstream ssOverSpill; std::ostringstream ssTotalDists; string message; ssOverSpill << overspill; message += ssOverSpill.str(); message += " of the distances out of a total of "; ssTotalDists << totalDists; message += ssTotalDists.str(); message += "\n were out of range for the distance correction.\n" "\n SUGGESTIONS: 1) remove the most distant sequences" "\n or 2) use the PHYLIP package" "\n or 3) turn off the correction." "\n Note: Use option 3 with caution! With this degree" "\n of divergence you will have great difficulty" "\n getting robust and reliable trees.\n\n"; clustalw::utilityObject->warning(message.c_str()); } /* * The function treeGapDelete flags all the positions that have a gap in any sequence. * */ // NOTE there is something wrong with using _lenFirstSeq. But this is what old clustal does. void ClusterTree::treeGapDelete(clustalw::Alignment *alignPtr) { int seqn; int posn; int _maxAlnLength = alignPtr->getMaxAlnLength(); int _lenFirstSeq = alignPtr->getSeqLength(firstSeq); int _gapPos1 = clustalw::userParameters->getGapPos1(); int _gapPos2 = clustalw::userParameters->getGapPos2(); treeGaps.resize(_maxAlnLength + 1); for (posn = 1; posn <= _lenFirstSeq; ++posn) { treeGaps[posn] = 0; for (seqn = 1; seqn <= lastSeq - firstSeq + 1; ++seqn) { const vector* _seqM = alignPtr->getSequence(seqn + firstSeq - 1); if(posn > alignPtr->getSeqLength(seqn + firstSeq - 1)) { break; // Dont read locations that cannot be read! } if (((*_seqM)[posn] == _gapPos1) || ((*_seqM)[posn] == _gapPos2)) { treeGaps[posn] = 1; break; } } } } int ClusterTree::dnaDistanceMatrix(ofstream* treeFile, clustalw::Alignment *alignPtr) { int m, n; int j, i; int res1, res2; int overspill = 0; double p, q, e, a, b, k; treeGapDelete(alignPtr); // flag positions with gaps (tree_gaps[i] = 1 ) if (verbose) { (*treeFile) << "\n"; (*treeFile) << "\n DIST = percentage divergence (/100)"; (*treeFile) << "\n p = rate of transition (A <-> G; C <-> T)"; (*treeFile) << "\n q = rate of transversion"; (*treeFile) << "\n Length = number of sites used in comparison"; (*treeFile) << "\n"; if (clustalw::userParameters->getTossGaps()) { (*treeFile) << "\n All sites with gaps (in any sequence) deleted!"; (*treeFile) << "\n"; } if (clustalw::userParameters->getKimura()) { (*treeFile) << "\n Distances corrected by Kimura's 2 parameter model:"; (*treeFile) << "\n\n Kimura, M. (1980)"; (*treeFile) << " A simple method for estimating evolutionary "; (*treeFile) << "rates of base"; (*treeFile) << "\n substitutions through comparative studies of "; (*treeFile) << "nucleotide sequences."; (*treeFile) << "\n J. Mol. Evol., 16, 111-120."; (*treeFile) << "\n\n"; } } int _numSeqs = alignPtr->getNumSeqs(); quickDistMat.reset(new clustalw::DistMatrix(_numSeqs + 1)); int _lenFirstSeq = alignPtr->getSeqLength(firstSeq); int _gapPos1 = clustalw::userParameters->getGapPos1(); int _gapPos2 = clustalw::userParameters->getGapPos2(); int lenSeqM, lenSeqN; // for every pair of sequence for (m = 1; m < lastSeq - firstSeq + 1; ++m) { const vector* _seqM = alignPtr->getSequence(m + firstSeq - 1); lenSeqM = alignPtr->getSeqLength(m + firstSeq - 1); for (n = m + 1; n <= lastSeq - firstSeq + 1; ++n) { const vector* _seqN = alignPtr->getSequence(n + firstSeq - 1); lenSeqN = alignPtr->getSeqLength(n + firstSeq - 1); p = q = e = 0.0; quickDistMat->SetAt(m, n, 0.0); quickDistMat->SetAt(n ,m, 0.0); for (i = 1; i <= _lenFirstSeq; ++i) { j = bootPositions[i]; if (clustalw::userParameters->getTossGaps() && (treeGaps[j] > 0)) { goto skip; } // gap position /** ******************************************************************************* * BUG!!!!!!! NOTE this was found for protein. Presuming the same here * * NOTE: the following if statements were coded in so as to produce * * the same distance results as the old clustal. Old clustal compares * * up to the length of the first sequence. If this is longer than the * * other sequences, then the -3 and 0's are compared at the end of the * * array. These should not be compared, but I need to stick to this to * * produce the same results as the old version for testing! * **********************************************************************************/ if(j > lenSeqM) { if(j == lenSeqM + 1) { res1 = -3; } else { res1 = 0; } } else { res1 = (*_seqM)[j]; } if(j > lenSeqN) { if(j == lenSeqN + 1) { res2 = -3; } else { res2 = 0; } } else { res2 = (*_seqN)[j]; } if ((res1 == _gapPos1) || (res1 == _gapPos2) || (res2 == _gapPos1) || (res2 == _gapPos2)) { goto skip; } // gap in a seq if (!clustalw::userParameters->getUseAmbiguities()) { if (isAmbiguity(res1) || isAmbiguity(res2)) { goto skip; } } // ambiguity code in a seq e = e+1.0; if (res1 != res2) { if (transition(res1, res2)) { p = p + 1.0; } else { q = q + 1.0; } } skip: ; } // Kimura's 2 parameter correction for multiple substitutions if (!clustalw::userParameters->getKimura()) { if (e == 0) { cerr << "\n WARNING: sequences " << m << " and " << n << " are non-overlapping\n"; k = 0.0; p = 0.0; q = 0.0; } else { k = (p + q) / e; if (p > 0.0) { p = p / e; } else { p = 0.0; } if (q > 0.0) { q = q / e; } else { q = 0.0; } } quickDistMat->SetAt(m, n, k); quickDistMat->SetAt(n ,m, k); if (verbose) { (*treeFile) << setw(4) << m << " vs." << setw(4) << n << ": DIST = " << setw(4) << fixed << setprecision(4) << k << "; p = " << fixed << setprecision(4) << p << "; q = " << fixed << setprecision(4) << q << "; length = " << setw(6) << fixed << setprecision(0) << e << "\n"; } } else { if (e == 0) { cerr << "\n WARNING: sequences " << m << " and " << n << " are non-overlapping\n";; p = 0.0; q = 0.0; } else { if (p > 0.0) { p = p / e; } else { p = 0.0; } if (q > 0.0) { q = q / e; } else { q = 0.0; } } if (((2.0 *p) + q) == 1.0) { a = 0.0; } else { a = 1.0 / (1.0 - (2.0 *p) - q); } if (q == 0.5) { b = 0.0; } else { b = 1.0 / (1.0 - (2.0 *q)); } // watch for values going off the scale for the correction. if ((a <= 0.0) || (b <= 0.0)) { overspill++; k = 3.5; // arbitrary high score } else { k = 0.5 * log(a) + 0.25 * log(b); } quickDistMat->SetAt(m, n, k); quickDistMat->SetAt(n ,m, k); if (verbose) // if screen output { (*treeFile) << setw(4) << m << " vs." << setw(4) << n << ": DIST = " << fixed << setprecision(4) << k << "; p = " << fixed << setprecision(4) << p << "; q = " << fixed << setprecision(4) << q << "; length = " << setw(6) << fixed << setprecision(0) << e << "\n"; } } } } return overspill; // return the number of off-scale values } int ClusterTree::protDistanceMatrix(ofstream* treeFile, clustalw::Alignment *alignPtr) { int m, n; int j, i; int res1, res2; int overspill = 0; double p, e, k, tableEntry; treeGapDelete(alignPtr); // flag positions with gaps (tree_gaps[i] = 1 ) if (verbose) { (*treeFile) << "\n"; (*treeFile) << "\n DIST = percentage divergence (/100)"; (*treeFile) << "\n Length = number of sites used in comparison"; (*treeFile) << "\n\n"; if (clustalw::userParameters->getTossGaps()) { (*treeFile) << "\n All sites with gaps (in any sequence) deleted"; (*treeFile) << "\n"; } if (clustalw::userParameters->getKimura()) { (*treeFile) << "\n Distances up to 0.75 corrected by Kimura's empirical method:"; (*treeFile) << "\n\n Kimura, M. (1983)"; (*treeFile) << " The Neutral Theory of Molecular Evolution."; (*treeFile) << "\n Page 75. Cambridge University Press, Cambridge, England."; (*treeFile) << "\n\n"; } } int _numSeqs = alignPtr->getNumSeqs(); int _lenSeq1 = alignPtr->getSeqLength(1); quickDistMat.reset(new clustalw::DistMatrix(_numSeqs + 1)); int _gapPos1 = clustalw::userParameters->getGapPos1(); int _gapPos2 = clustalw::userParameters->getGapPos2(); int lenSeqM, lenSeqN; // for every pair of sequence for (m = 1; m < _numSeqs; ++m) { const vector* _seqM = alignPtr->getSequence(m); lenSeqM = alignPtr->getSeqLength(m); for (n = m + 1; n <= _numSeqs; ++n) { const vector* _seqN = alignPtr->getSequence(n); lenSeqN = alignPtr->getSeqLength(n); p = e = 0.0; quickDistMat->SetAt(m, n, 0.0); quickDistMat->SetAt(n ,m, 0.0); for (i = 1; i <= _lenSeq1; ++i) // It may be this here! { j = bootPositions[i]; if (clustalw::userParameters->getTossGaps() && (treeGaps[j] > 0)) { goto skip; } // gap position /** ******************************************************************************* * BUG!!!!!!! * * NOTE: the following if statements were coded in so as to produce * * the same distance results as the old clustal. Old clustal compares * * up to the length of the first sequence. If this is longer than the * * other sequences, then the -3 and 0's are compared at the end of the * * array. These should not be compared, but I need to stick to this to * * produce the same results as the old version for testing! * **********************************************************************************/ if(j > lenSeqM) { if(j == lenSeqM + 1) { res1 = -3; } else { res1 = 0; } } else { res1 = (*_seqM)[j]; } if(j > lenSeqN) { if(j == lenSeqN + 1) { res2 = -3; } else { res2 = 0; } } else { res2 = (*_seqN)[j]; } if ((res1 == _gapPos1) || (res1 == _gapPos2) || (res2 == _gapPos1) || (res2 == _gapPos2)) { goto skip; } // gap in a seq e = e + 1.0; if (res1 != res2) { p = p + 1.0; } skip: ; } if (p <= 0.0) { k = 0.0; } else { k = p / e; } if (clustalw::userParameters->getKimura()) { if (k < 0.75) { // use Kimura's formula if (k > 0.0) { k = - log(1.0 - k - (k * k / 5.0)); } } else { if (k > 0.930) { overspill++; k = 10.0; // arbitrarily set to 1000% } else // dayhoff_pams is from dayhoff.h file { tableEntry = (k * 1000.0) - 750.0; k = (double)dayhoff_pams[(int)tableEntry]; k = k / 100.0; } } } quickDistMat->SetAt(m, n, k); quickDistMat->SetAt(n ,m, k); if (verbose) { (*treeFile) << setw(4) << m << " vs." << setw(4) << n << " DIST = " << fixed << setprecision(4) << k << "; length = " << setw(6) << setprecision(0) << e << "\n"; } } } return overspill; } bool ClusterTree::isAmbiguity(int c) { int i; char codes[] = "ACGTU"; if (clustalw::userParameters->getUseAmbiguities() == true) { return false; } for (i = 0; i < 5; i++) if (clustalw::userParameters->getAminoAcidCode(c) == codes[i]) { return false; } return true; } /* * The function calcPercIdentity calculates the percent identity of the sequences * and outputs it to a the file pfile. NOTE this is not used at the moment. It was in * the old code, but there was no way to access it from the menu. This may change. */ void ClusterTree::calcPercIdentity(ofstream* pfile, clustalw::Alignment *alignPtr) { clustalw::DistMatrix percentMat; float ident; int nmatch; int val1, val2; int i,j,k, length_longest; int length_shortest; int rs = 0, rl = 0; // findout sequence length, longest and shortest; length_longest = 0; length_shortest = 0; int _numSeqs = alignPtr->getNumSeqs(); int _seqLength; for (i = 1; i <= _numSeqs; i++) { _seqLength = alignPtr->getSeqLength(i); if (length_longest < _seqLength) { length_longest = _seqLength; rs = i; } if (length_shortest > _seqLength) { length_shortest = _seqLength; rl = i; } } percentMat.ResizeRect(_numSeqs + 1); nmatch = 0; int _lenSeqI, _lenSeqJ; int _maxAA = clustalw::userParameters->getMaxAA(); for (i = 1; i <= _numSeqs; i++) { const vector* _seqI = alignPtr->getSequence(i); _lenSeqI = alignPtr->getSeqLength(i); for (j = i; j <= _numSeqs; j++) { const vector* _seqJ = alignPtr->getSequence(j); _lenSeqJ = alignPtr->getSeqLength(j); cout << "\n " << alignPtr->getName(j) << " "; ident = 0; nmatch = 0; for(k = 1; k <= length_longest; k++) { if((k > _lenSeqI) || (k > _lenSeqJ)) { break; } val1 = (*_seqI)[k]; val2 = (*_seqJ)[k]; if (((val1 < 0) || (val1 > _maxAA)) || ((val2 < 0) || (val2 > _maxAA))) { continue; // residue = '-'; } if (val1 == val2) { ident++ ; nmatch++; } else { nmatch++ ; } } ident = ident/nmatch * 100.0 ; percentMat.SetAt(i, j, ident); percentMat.SetAt(j, i, ident); } } int _maxNameSize = alignPtr->getMaxNames(); (*pfile) << "#\n#\n# Percent Identity Matrix - created by Clustal" << clustalw::userParameters->getRevisionLevel() << " \n#\n#\n"; for(i = 1; i <= _numSeqs; i++) { (*pfile) << "\n " << right << setw(5) << i << ": "; (*pfile) << left << setw(_maxNameSize) << alignPtr->getName(i); for(j = 1; j <= _numSeqs; j++) { (*pfile) << setw(8) << right << fixed << setprecision(0) << percentMat(i, j); } } (*pfile) << "\n"; } void ClusterTree::compareTree(PhyloTree* tree1, PhyloTree* tree2, vector* hits, int n) { int i, j, k; int nhits1, nhits2; for (i = 1; i <= n - 3; i++) { for (j = 1; j <= n - 3; j++) { nhits1 = 0; nhits2 = 0; for (k = 1; k <= n; k++) { if (tree1->treeDesc[i][k] == tree2->treeDesc[j][k]) { nhits1++; } if (tree1->treeDesc[i][k] != tree2->treeDesc[j][k]) { nhits2++; } } if ((nhits1 == lastSeq - firstSeq + 1) || (nhits2 == lastSeq - firstSeq + 1)) { (*hits)[i]++; } } } } /** * NOTE this will go into the OutputFile class and will not be needed here anymore. * */ /*string ClusterTree::getOutputFileName(const string prompt, string path, const string fileExtension) { string temp; string _fileName; // Will return this name. string message; _fileName = path + fileExtension; if(_fileName.compare(clustalw::userParameters->getSeqName()) == 0) { cout << "Output file name is the same as input file.\n"; if (clustalw::userParameters->getMenuFlag()) { message = "\n\nEnter new name to avoid overwriting [" + _fileName + "]: "; clustalw::utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } } else if (clustalw::userParameters->getMenuFlag()) { message = prompt + " [" + _fileName + "]"; clustalw::utilityObject->getStr(message, temp); if(temp != "") { _fileName = temp; } } return _fileName; }*/ bool ClusterTree::transition(int base1, int base2) { // assumes that the bases of DNA sequences have been translated as // a,A = 0; c,C = 1; g,G = 2; t,T,u,U = 3; N = 4; // a,A = 0; c,C = 2; g,G = 6; t,T,u,U =17; // A <--> G and T <--> C are transitions; all others are transversions. if (((base1 == 0) && (base2 == 6)) || ((base1 == 6) && (base2 == 0))) { return true; } // A <--> G if (((base1 == 17) && (base2 == 2)) || ((base1 == 2) && (base2 == 17))) { return true; } // T <--> C return false; } /** * This function is used to open all the bootstrap tree files. It opens them with the * correct message prompt. */ bool ClusterTree::openFilesForBootstrap(clustalw::OutputFile* clustalFile, clustalw::OutputFile* phylipFile, clustalw::OutputFile* nexusFile, clustalw::TreeNames* treeNames, string* path) { if (clustalw::userParameters->getOutputTreeClustal()) { if(!clustalFile || !clustalFile->openFile(&(treeNames->clustalName), bootstrapPrompt, path, "njb", bootstrapFileTypeMsg)) { return false; } } if (clustalw::userParameters->getOutputTreePhylip()) { if(!phylipFile || !phylipFile->openFile(&(treeNames->phylipName), bootstrapPrompt, path, "phb", bootstrapFileTypeMsg)) { return false; } } if (clustalw::userParameters->getOutputTreeNexus()) { if(!nexusFile || !nexusFile->openFile(&(treeNames->nexusName), bootstrapPrompt, path, "treb", bootstrapFileTypeMsg)) { return false; } } return true; } bool ClusterTree::openFilesForTreeFromAlignment(clustalw::OutputFile* clustalFile, clustalw::OutputFile* phylipFile, clustalw::OutputFile* distFile, clustalw::OutputFile* nexusFile, clustalw::OutputFile* pimFile, clustalw::TreeNames* treeNames, string* path) { if (clustalw::userParameters->getOutputTreeClustal()) { if(!clustalFile || !clustalFile->openFile(&(treeNames->clustalName), "\nEnter name for CLUSTAL tree output file ", path, "nj", "Phylogenetic tree")) { return false; } } if (clustalw::userParameters->getOutputTreePhylip()) { if(!phylipFile || !phylipFile->openFile(&(treeNames->phylipName), "\nEnter name for PHYLIP tree output file ", path, "ph", "Phylogenetic tree")) { return false; } } if (clustalw::userParameters->getOutputTreeDistances()) { if(!distFile || !distFile->openFile(&(treeNames->distName), "\nEnter name for distance matrix output file ", path, "dst", "Distance matrix")) { return false; } } if (clustalw::userParameters->getOutputTreeNexus()) { if(!nexusFile || !nexusFile->openFile(&(treeNames->nexusName), "\nEnter name for NEXUS tree output file ", path, "tre", "Nexus tree")) { return false; } } if (clustalw::userParameters->getOutputPim()) { if(!pimFile || !pimFile->openFile(&(treeNames->pimName), "\nEnter name for % Identity matrix output file ", path, "pim", "perc identity")) { return false; } } return true; } int ClusterTree::calcQuickDistMatForAll(ofstream* clustalFile, ofstream* phylipFile, ofstream* nexusFile, ofstream* pimFile, ofstream* distFile, clustalw::Alignment* alignPtr) { int overspill = 0; bool _DNAFlag = clustalw::userParameters->getDNAFlag(); overspill = calcQuickDistMatForSubSet(clustalFile, phylipFile, nexusFile, alignPtr); if (pimFile && clustalw::userParameters->getOutputPim()) { verbose = false; // Turn off file output if (_DNAFlag) { calcPercIdentity(pimFile, alignPtr); } else { calcPercIdentity(pimFile, alignPtr); } } if (distFile && clustalw::userParameters->getOutputTreeDistances()) { verbose = false; // Turn off file output if (_DNAFlag) { overspill = dnaDistanceMatrix(distFile, alignPtr); } else { overspill = protDistanceMatrix(distFile, alignPtr); } distanceMatrixOutput(distFile, quickDistMat.get(), alignPtr); } return overspill; } int ClusterTree::calcQuickDistMatForSubSet(ofstream* clustalFile, ofstream* phylipFile, ofstream* nexusFile, clustalw::Alignment* alignPtr, bool inBootLoop) { int overspill = 0; bool _DNAFlag = clustalw::userParameters->getDNAFlag(); if (clustalFile && clustalw::userParameters->getOutputTreeClustal()) { if(!inBootLoop) { verbose = true; // Turn on file output } else { verbose = false; // Turn off when we are in the loop in bootstrap! } if (_DNAFlag) { overspill = dnaDistanceMatrix(clustalFile, alignPtr); } else { overspill = protDistanceMatrix(clustalFile, alignPtr); } } if (phylipFile && clustalw::userParameters->getOutputTreePhylip()) { verbose = false; // Turn off file output if (_DNAFlag) { overspill = dnaDistanceMatrix(phylipFile, alignPtr); } else { overspill = protDistanceMatrix(phylipFile, alignPtr); } } if (nexusFile && clustalw::userParameters->getOutputTreeNexus()) { verbose = false; // Turn off file output if (_DNAFlag) { overspill = dnaDistanceMatrix(nexusFile, alignPtr); } else { overspill = protDistanceMatrix(nexusFile, alignPtr); } } return overspill; } void ClusterTree::printBootstrapHeaderToClustalFile(ofstream* clustalFile) { if(clustalFile) { (*clustalFile) << "\n\n\t\t\tBootstrap Confidence Limits\n\n"; (*clustalFile) << "\n Random number generator seed = " << setw(7) << clustalw::userParameters->getBootRanSeed() << "\n"; (*clustalFile) << "\n Number of bootstrap trials = " << setw(7) << clustalw::userParameters->getBootNumTrials() << "\n"; (*clustalFile) << "\n\n Diagrammatic representation of the above tree: \n"; (*clustalFile) << "\n Each row represents 1 tree cycle;"; (*clustalFile) << " defining 2 groups.\n"; (*clustalFile) << "\n Each column is 1 sequence; "; (*clustalFile) << "the stars in each line show 1 group; "; (*clustalFile) << "\n the dots show the other\n"; (*clustalFile) << "\n Numbers show occurences in bootstrap samples."; } } void ClusterTree::promptForBoolSeedAndNumTrials() { if (clustalw::userParameters->getMenuFlag()) { unsigned int tempSeed; tempSeed = clustalw::utilityObject->getInt( "\n\nEnter seed no. for random number generator ", 1, 1000, clustalw::userParameters->getBootRanSeed()); clustalw::userParameters->setBootRanSeed(tempSeed); clustalw::userParameters->setBootNumTrials( clustalw::utilityObject->getInt("\n\nEnter number of bootstrap trials ", 1, 10000, clustalw::userParameters->getBootNumTrials())); } } void ClusterTree::printErrorMessageForBootstrap(int totalOverspill, int totalDists, int nfails) { cerr << "\n"; cerr << "\n WARNING: " << totalOverspill << " of the distances out of a total of " << totalDists << " times" << clustalw::userParameters->getBootNumTrials(); cerr << "\n were out of range for the distance correction."; cerr << "\n This affected " << nfails << " out of " << clustalw::userParameters->getBootNumTrials() << " bootstrap trials."; cerr << "\n This may not be fatal but you have been warned!" << "\n"; cerr << "\n SUGGESTIONS: 1) turn off the correction"; cerr << "\n or 2) remove the most distant sequences"; cerr << "\n or 3) use the PHYLIP package.\n\n"; if (clustalw::userParameters->getMenuFlag()) { string dummy; clustalw::utilityObject->getStr(string("Press [RETURN] to continue"), dummy); } } bool ClusterTree::checkIfConditionsMet(int numSeqs, int min) { if (clustalw::userParameters->getEmpty()) { clustalw::utilityObject->error("You must load an alignment first"); return false; } if (numSeqs < min) { clustalw::utilityObject->error("Alignment has only %d sequences", numSeqs); return false; } return true; } } clustalw-2.1/configure0000755000175000017500000056776611467267740012113 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65 for clustalw 2.1. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and clustalw@ucd.ie $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='clustalw' PACKAGE_TARNAME='clustalw' PACKAGE_VERSION='2.1' PACKAGE_STRING='clustalw 2.1' PACKAGE_BUGREPORT='clustalw@ucd.ie' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP CXXCPP RANLIB am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM CLUSTALW_NAME CLUSTALW_VERSION target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_mhash ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error "unrecognized option: \`$ac_option' Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures clustalw 2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/clustalw] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of clustalw 2.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mhash Enable mhash support in stats Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF clustalw configure 2.1 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_type # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_header_compile # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to clustalw@ucd.ie ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by clustalw $as_me 2.1, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # The AC_INIT macro can take any source file as an argument. It just # checks that the file is there, which should, in turn, mean that the # source directory is there. # AC_INIT generates the following m4 macros, output variables and preprocessor symbols: # * [AC_]PACKAGE_NAME # * [AC_]PACKAGE_TARNAME # * [AC_]PACKAGE_VERSION # * [AC_]PACKAGE_STRING # * [AC_]PACKAGE_BUGREPORT # Detect the canonical host and target build environment # see e.g. http://cvs.haskell.org/darcs/ghc/configure.ac for howto use # AC_CANONICAL_HOST or AC_CANONICAL_TARGET? # AC_CANONICAL_SYSTEM will also run AC_CANONICAL_HOST and allows to use --target ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- # DEFINES here are going to config.h and have to be the same as in clustalx.pro #echo "host_os $host_os" case $target_os in *linux*|*solaris*|*bsd*) $as_echo "#define OS_UNIX 1" >>confdefs.h ;; *darwin*) $as_echo "#define OS_MAC 1" >>confdefs.h $as_echo "#define OS_UNIX 1" >>confdefs.h ;; *cygwin*|*mingw*) $as_echo "#define OS_WINDOWS 1" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Couldn't determine target operating system. Using Unix\"" >&5 $as_echo "$as_me: WARNING: \"Couldn't determine target operating system. Using Unix\"" >&2;}; $as_echo "#define OS_UNIX 1" >>confdefs.h ;; esac echo "building for $target_os" # set in clustalw_version.h[.in] rather than config.h to avoid name clashes #AC_DEFINE_UNQUOTED(CLUSTALW_VERSION, "${PACKAGE_VERSION}", [ClustalW version]) #AC_DEFINE_UNQUOTED(CLUSTALW_NAME, "ClustalW", [ClustalW name]) CLUSTALW_VERSION="${PACKAGE_VERSION}" CLUSTALW_NAME="ClustalW" # The AM_INIT_AUTOMAKE line adds several standard checks. # This macro is always needed for automake # Obsolete: It takes the program name and version number as arguments. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='clustalw' VERSION='2.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # AC_PROG_CC indicates that the source code may be in C. If the source # code is C++ then we also need AC_PROG_CXX. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "no acceptable C compiler found in \$PATH See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of object files: cannot compile See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # AC_PROG_RANLIB will allow you to build code in sub-directories into # temporary libraries, which make will then link in with the rest of # the code. if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # AC_PROG_INSTALL will generate an install target so that users may # just type 'make install' to install the software. # use C++ compiler and linker ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Checks for header files. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # AC_CHECK_HEADERS([a.h b.h]) # Checks for typedefs, structures, and compiler characteristics. # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # This may beincluded by your source code and provides a way for # people to customise the configuration for their platform, via # #defines. config.h.in can be generated automatically with the # autoheader tool. However, you need a stamp-h file in your project # to ensure that automake regenerates config.h from config.h.in. Type # 'touch stamp-h' to add this file to your project. # Andreas Wilm: standard would be config.h but let's avoid conflicts with ac_config_headers="$ac_config_headers src/config.h" for ac_header in stdlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi # enable hashing if requested (--with-mhash) # will set HAVE_MHASH_H only # Check whether --with-mhash was given. if test "${with_mhash+set}" = set; then : withval=$with_mhash; with_mhash=$withval else with_mhash=no fi if test "$with_mhash" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mhash_init in -lmhash" >&5 $as_echo_n "checking for mhash_init in -lmhash... " >&6; } if test "${ac_cv_lib_mhash_mhash_init+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmhash $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mhash_init (); int main () { return mhash_init (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_mhash_mhash_init=yes else ac_cv_lib_mhash_mhash_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mhash_mhash_init" >&5 $as_echo "$ac_cv_lib_mhash_mhash_init" >&6; } if test "x$ac_cv_lib_mhash_mhash_init" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMHASH 1 _ACEOF LIBS="-lmhash $LIBS" else as_fn_error "mhash lib not found" "$LINENO" 5 fi for ac_header in mhash.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "mhash.h" "ac_cv_header_mhash_h" "$ac_includes_default" if test "x$ac_cv_header_mhash_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MHASH_H 1 _ACEOF else as_fn_error "mhash header not found" "$LINENO" 5 fi done fi # AC_OUTPUT indicates the name of the Makefile which will be generated. ### AC_CONFIG_FILES([ Makefile ]) ac_config_files="$ac_config_files Makefile m4/Makefile src/Makefile src/clustalw_version.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by clustalw $as_me 2.1, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ clustalw config.status 2.1 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/clustalw_version.h") CONFIG_FILES="$CONFIG_FILES src/clustalw_version.h" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi clustalw-2.1/configure.ac0000644000175000017500000001067011457300613012425 00000000000000# Andreas Wilm (UCD): 2007-12-10 # Generated using the following sites # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html # # autoconf looks for a file called configure.ac (or, previously, # configure.in). It then creates the configure script, based on the # macros which it finds. Whenever you add a macro to configure.ac, # you should run aclocal as well as autoconf, because aclocal scans # configure.ac to find which macros it should provide. # This is all black magic and we (as well as all reasonable # developers) should change to a sane system like e.g. SCons # http://freshmeat.net/articles/stop-the-autoconf-insanity-why-we-need-a-new-build-system # Andreas Wilm (UCD): # you will only have to change the version number here! # after apllying any changes you will have to run # $ autoreconf # AC_INIT([clustalw], [2.1], [clustalw@ucd.ie]) # # The AC_INIT macro can take any source file as an argument. It just # checks that the file is there, which should, in turn, mean that the # source directory is there. # AC_INIT generates the following m4 macros, output variables and preprocessor symbols: # * [AC_]PACKAGE_NAME # * [AC_]PACKAGE_TARNAME # * [AC_]PACKAGE_VERSION # * [AC_]PACKAGE_STRING # * [AC_]PACKAGE_BUGREPORT # Detect the canonical host and target build environment # see e.g. http://cvs.haskell.org/darcs/ghc/configure.ac for howto use # AC_CANONICAL_HOST or AC_CANONICAL_TARGET? # AC_CANONICAL_SYSTEM will also run AC_CANONICAL_HOST and allows to use --target AC_CANONICAL_SYSTEM # DEFINES here are going to config.h and have to be the same as in clustalx.pro #echo "host_os $host_os" case $target_os in *linux*|*solaris*|*bsd*) AC_DEFINE([OS_UNIX], [1], [Host OS]) ;; *darwin*) AC_DEFINE([OS_MAC], [1], [Host OS]) AC_DEFINE([OS_UNIX], [1], [Host OS]) ;; *cygwin*|*mingw*) AC_DEFINE([OS_WINDOWS], [1], [Host OS]) ;; *) AC_MSG_WARN(["Couldn't determine target operating system. Using Unix"]); AC_DEFINE([OS_UNIX], [1], [Host OS]) ;; esac echo "building for $target_os" # set in clustalw_version.h[.in] rather than config.h to avoid name clashes #AC_DEFINE_UNQUOTED(CLUSTALW_VERSION, "${PACKAGE_VERSION}", [ClustalW version]) #AC_DEFINE_UNQUOTED(CLUSTALW_NAME, "ClustalW", [ClustalW name]) CLUSTALW_VERSION="${PACKAGE_VERSION}" AC_SUBST(CLUSTALW_VERSION) CLUSTALW_NAME="ClustalW" AC_SUBST(CLUSTALW_NAME) # The AM_INIT_AUTOMAKE line adds several standard checks. # This macro is always needed for automake # Obsolete: It takes the program name and version number as arguments. AM_INIT_AUTOMAKE([]) AC_PROG_MAKE_SET # AC_PROG_CC indicates that the source code may be in C. If the source # code is C++ then we also need AC_PROG_CXX. AC_PROG_CC AC_PROG_CXX # AC_PROG_RANLIB will allow you to build code in sub-directories into # temporary libraries, which make will then link in with the rest of # the code. AC_PROG_RANLIB # AC_PROG_INSTALL will generate an install target so that users may # just type 'make install' to install the software. AC_PROG_INSTALL # use C++ compiler and linker AC_LANG_CPLUSPLUS # Checks for header files. AC_HEADER_STDC # AC_CHECK_HEADERS([a.h b.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T # This may beincluded by your source code and provides a way for # people to customise the configuration for their platform, via # #defines. config.h.in can be generated automatically with the # autoheader tool. However, you need a stamp-h file in your project # to ensure that automake regenerates config.h from config.h.in. Type # 'touch stamp-h' to add this file to your project. # Andreas Wilm: standard would be config.h but let's avoid conflicts with AM_CONFIG_HEADER(src/config.h) AC_FUNC_MALLOC # enable hashing if requested (--with-mhash) # will set HAVE_MHASH_H only AC_ARG_WITH([mhash], [AS_HELP_STRING([--with-mhash], [Enable mhash support in stats])], [with_mhash=$withval], [with_mhash=no]) if test "$with_mhash" = "yes"; then AC_CHECK_LIB([mhash], [mhash_init], , [AC_MSG_ERROR([mhash lib not found])]) AC_CHECK_HEADERS([mhash.h], , [AC_MSG_ERROR([mhash header not found])]) fi # AC_OUTPUT indicates the name of the Makefile which will be generated. ### AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT(Makefile m4/Makefile src/Makefile src/clustalw_version.h) clustalw-2.1/config.sub0000755000175000017500000010242511274160642012125 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: clustalw-2.1/install-sh0000755000175000017500000003253711331674343012156 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: clustalw-2.1/Makefile.am0000644000175000017500000000054311442167172012176 00000000000000# Andreas Wilm (UCD): 2007-12-10 # Generated using the following sites # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html # we do not use GNU-style files: NEWS README AUTHORS ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = m4 src EXTRA_DIST = README LICENSE clustalw_help clustalw-2.1/aclocal.m40000644000175000017500000010432511457310176012005 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, [m4_warning([this file was generated for autoconf 2.65. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR clustalw-2.1/Makefile.in0000644000175000017500000005237611457310200012206 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Andreas Wilm (UCD): 2007-12-10 # Generated using the following sites # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure config.guess \ config.sub depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLUSTALW_NAME = @CLUSTALW_NAME@ CLUSTALW_VERSION = @CLUSTALW_VERSION@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # we do not use GNU-style files: NEWS README AUTHORS ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = m4 src EXTRA_DIST = README LICENSE clustalw_help all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clustalw-2.1/clustalw_help0000644000175000017500000010173011467270431012733 00000000000000 CLUSTAL 2.1 Multiple Sequence Alignments >> HELP NEW << NEW FEATURES/OPTIONS ==UPGMA== The UPGMA algorithm has been added to allow faster tree construction. The user now has the choice of using Neighbour Joining or UPGMA. The default is still NJ, but the user can change this by setting the clustering parameter. -CLUSTERING= :NJ or UPGMA ==ITERATION== A remove first iteration scheme has been added. This can be used to improve the final alignment or improve the alignment at each stage of the progressive alignment. During the iteration step each sequence is removed in turn and realigned. If the resulting alignment is better than the previous alignment it is kept. This process is repeated until the score converges (the score is not improved) or until the maximum number of iterations is reached. The user can iterate at each step of the progressive alignment by setting the iteration parameter to TREE or just on the final alignment by seting the iteration parameter to ALIGNMENT. The default is no iteration. The maximum number of iterations can be set using the numiter parameter. The default number of iterations is 3. -ITERATION= :NONE or TREE or ALIGNMENT -NUMITER=n :Maximum number of iterations to perform ==HELP== -FULLHELP :Print out the complete help content ==MISC== -MAXSEQLEN=n :Maximum allowed sequence length -QUIET :Reduce console output to minimum -STATS=file :Log some alignents statistics to file >> HELP 1 << General help for CLUSTAL W (2.1) Clustal W is a general purpose multiple alignment program for DNA or proteins. SEQUENCE INPUT: all sequences must be in 1 file, one after another. 7 formats are automatically recognised: NBRF-PIR, EMBL-SWISSPROT, Pearson (Fasta), Clustal (*.aln), GCG-MSF (Pileup), GCG9-RSF and GDE flat file. All non-alphabetic characters (spaces, digits, punctuation marks) are ignored except "-" which is used to indicate a GAP ("." in MSF-RSF). To do a MULTIPLE ALIGNMENT on a set of sequences, use item 1 from this menu to INPUT them; go to menu item 2 to do the multiple alignment. PROFILE ALIGNMENTS (menu item 3) are used to align 2 alignments. Use this to add a new sequence to an old alignment, or to use secondary structure to guide the alignment process. GAPS in the old alignments are indicated using the "-" character. PROFILES can be input in ANY of the allowed formats; just use "-" (or "." for MSF-RSF) for each gap position. PHYLOGENETIC TREES (menu item 4) can be calculated from old alignments (read in with "-" characters to indicate gaps) OR after a multiple alignment while the alignment is still in memory. The program tries to automatically recognise the different file formats used and to guess whether the sequences are amino acid or nucleotide. This is not always foolproof. FASTA and NBRF-PIR formats are recognised by having a ">" as the first character in the file. EMBL-Swiss Prot formats are recognised by the letters ID at the start of the file (the token for the entry name field). CLUSTAL format is recognised by the word CLUSTAL at the beginning of the file. GCG-MSF format is recognised by one of the following: - the word PileUp at the start of the file. - the word !!AA_MULTIPLE_ALIGNMENT or !!NA_MULTIPLE_ALIGNMENT at the start of the file. - the word MSF on the first line of the line, and the characters .. at the end of this line. GCG-RSF format is recognised by the word !!RICH_SEQUENCE at the beginning of the file. If 85% or more of the characters in the sequence are from A,C,G,T,U or N, the sequence will be assumed to be nucleotide. This works in 97.3% of cases but watch out! >> HELP 2 << Help for multiple alignments If you have already loaded sequences, use menu item 1 to do the complete multiple alignment. You will be prompted for 2 output files: 1 for the alignment itself; another to store a dendrogram that describes the similarity of the sequences to each other. Multiple alignments are carried out in 3 stages (automatically done from menu item 1 ...Do complete multiple alignments now): 1) all sequences are compared to each other (pairwise alignments); 2) a dendrogram (like a phylogenetic tree) is constructed, describing the approximate groupings of the sequences by similarity (stored in a file). 3) the final multiple alignment is carried out, using the dendrogram as a guide. PAIRWISE ALIGNMENT parameters control the speed-sensitivity of the initial alignments. MULTIPLE ALIGNMENT parameters control the gaps in the final multiple alignments. RESET GAPS (menu item 7) will remove any new gaps introduced into the sequences during multiple alignment if you wish to change the parameters and try again. This only takes effect just before you do a second multiple alignment. You can make phylogenetic trees after alignment whether or not this is ON. If you turn this OFF, the new gaps are kept even if you do a second multiple alignment. This allows you to iterate the alignment gradually. Sometimes, the alignment is improved by a second or third pass. SCREEN DISPLAY (menu item 8) can be used to send the output alignments to the screen as well as to the output file. You can skip the first stages (pairwise alignments; dendrogram) by using an old dendrogram file (menu item 3); or you can just produce the dendrogram with no final multiple alignment (menu item 2). OUTPUT FORMAT: Menu item 9 (format options) allows you to choose from 6 different alignment formats (CLUSTAL, GCG, NBRF-PIR, PHYLIP, GDE, NEXUS, and FASTA). >> HELP 3 << Help for pairwise alignment parameters A distance is calculated between every pair of sequences and these are used to construct the dendrogram which guides the final multiple alignment. The scores are calculated from separate pairwise alignments. These can be calculated using 2 methods: dynamic programming (slow but accurate) or by the method of Wilbur and Lipman (extremely fast but approximate). You can choose between the 2 alignment methods using menu option 8. The slow-accurate method is fine for short sequences but will be VERY SLOW for many (e.g. >100) long (e.g. >1000 residue) sequences. SLOW-ACCURATE alignment parameters: These parameters do not have any affect on the speed of the alignments. They are used to give initial alignments which are then rescored to give percent identity scores. These % scores are the ones which are displayed on the screen. The scores are converted to distances for the trees. 1) Gap Open Penalty: the penalty for opening a gap in the alignment. 2) Gap extension penalty: the penalty for extending a gap by 1 residue. 3) Protein weight matrix: the scoring table which describes the similarity of each amino acid to each other. 4) DNA weight matrix: the scores assigned to matches and mismatches (including IUB ambiguity codes). FAST-APPROXIMATE alignment parameters: These similarity scores are calculated from fast, approximate, global align- ments, which are controlled by 4 parameters. 2 techniques are used to make these alignments very fast: 1) only exactly matching fragments (k-tuples) are considered; 2) only the 'best' diagonals (the ones with most k-tuple matches) are used. K-TUPLE SIZE: This is the size of exactly matching fragment that is used. INCREASE for speed (max= 2 for proteins; 4 for DNA), DECREASE for sensitivity. For longer sequences (e.g. >1000 residues) you may need to increase the default. GAP PENALTY: This is a penalty for each gap in the fast alignments. It has little affect on the speed or sensitivity except for extreme values. TOP DIAGONALS: The number of k-tuple matches on each diagonal (in an imaginary dot-matrix plot) is calculated. Only the best ones (with most matches) are used in the alignment. This parameter specifies how many. Decrease for speed; increase for sensitivity. WINDOW SIZE: This is the number of diagonals around each of the 'best' diagonals that will be used. Decrease for speed; increase for sensitivity. >> HELP 4 << Help for multiple alignment parameters These parameters control the final multiple alignment. This is the core of the program and the details are complicated. To fully understand the use of the parameters and the scoring system, you will have to refer to the documentation. Each step in the final multiple alignment consists of aligning two alignments or sequences. This is done progressively, following the branching order in the GUIDE TREE. The basic parameters to control this are two gap penalties and the scores for various identical-non-indentical residues. 1) and 2) The GAP PENALTIES are set by menu items 1 and 2. These control the cost of opening up every new gap and the cost of every item in a gap. Increasing the gap opening penalty will make gaps less frequent. Increasing the gap extension penalty will make gaps shorter. Terminal gaps are not penalised. 3) The DELAY DIVERGENT SEQUENCES switch delays the alignment of the most distantly related sequences until after the most closely related sequences have been aligned. The setting shows the percent identity level required to delay the addition of a sequence; sequences that are less identical than this level to any other sequences will be aligned later. 4) The TRANSITION WEIGHT gives transitions (A <--> G or C <--> T i.e. purine-purine or pyrimidine-pyrimidine substitutions) a weight between 0 and 1; a weight of zero means that the transitions are scored as mismatches, while a weight of 1 gives the transitions the match score. For distantly related DNA sequences, the weight should be near to zero; for closely related sequences it can be useful to assign a higher score. 5) PROTEIN WEIGHT MATRIX leads to a new menu where you are offered a choice of weight matrices. The default for proteins in version 1.8 is the PAM series derived by Gonnet and colleagues. Note, a series is used! The actual matrix that is used depends on how similar the sequences to be aligned at this alignment step are. Different matrices work differently at each evolutionary distance. 6) DNA WEIGHT MATRIX leads to a new menu where a single matrix (not a series) can be selected. The default is the matrix used by BESTFIT for comparison of nucleic acid sequences. Further help is offered in the weight matrix menu. 7) In the weight matrices, you can use negative as well as positive values if you wish, although the matrix will be automatically adjusted to all positive scores, unless the NEGATIVE MATRIX option is selected. 8) PROTEIN GAP PARAMETERS displays a menu allowing you to set some Gap Penalty options which are only used in protein alignments. >> HELP A << Help for protein gap parameters. 1) RESIDUE SPECIFIC PENALTIES are amino acid specific gap penalties that reduce or increase the gap opening penalties at each position in the alignment or sequence. See the documentation for details. As an example, positions that are rich in glycine are more likely to have an adjacent gap than positions that are rich in valine. 2) 3) HYDROPHILIC GAP PENALTIES are used to increase the chances of a gap within a run (5 or more residues) of hydrophilic amino acids; these are likely to be loop or random coil regions where gaps are more common. The residues that are "considered" to be hydrophilic are set by menu item 3. 4) GAP SEPARATION DISTANCE tries to decrease the chances of gaps being too close to each other. Gaps that are less than this distance apart are penalised more than other gaps. This does not prevent close gaps; it makes them less frequent, promoting a block-like appearance of the alignment. 5) END GAP SEPARATION treats end gaps just like internal gaps for the purposes of avoiding gaps that are too close (set by GAP SEPARATION DISTANCE above). If you turn this off, end gaps will be ignored for this purpose. This is useful when you wish to align fragments where the end gaps are not biologically meaningful. >> HELP 5 << Help for output format options. Several output formats are offered. You can choose any (or all 6 if you wish). CLUSTAL format output is a self explanatory alignment format. It shows the sequences aligned in blocks. It can be read in again at a later date to (for example) calculate a phylogenetic tree or add a new sequence with a profile alignment. GCG output can be used by any of the GCG programs that can work on multiple alignments (e.g. PRETTY, PROFILEMAKE, PLOTALIGN). It is the same as the GCG .msf format files (multiple sequence file); new in version 7 of GCG. Fasta output cis widely used because of it's simplicity. Each sequence name is preceeded by a '>'-sign. The sequence itself is printed out in the following lines PHYLIP format output can be used for input to the PHYLIP package of Joe Felsenstein. This is an extremely widely used package for doing every imaginable form of phylogenetic analysis (MUCH more than the the modest intro- duction offered by this program). NBRF-PIR: this is the same as the standard PIR format with ONE ADDITION. Gap characters "-" are used to indicate the positions of gaps in the multiple alignment. These files can be re-used as input in any part of clustal that allows sequences (or alignments or profiles) to be read in. GDE: this is the flat file format used by the GDE package of Steven Smith. NEXUS: the format used by several phylogeny programs, including PAUP and MacClade. GDE OUTPUT CASE: sequences in GDE format may be written in either upper or lower case. CLUSTALW SEQUENCE NUMBERS: residue numbers may be added to the end of the alignment lines in clustalw format. OUTPUT ORDER is used to control the order of the sequences in the output alignments. By default, the order corresponds to the order in which the sequences were aligned (from the guide tree-dendrogram), thus automatically grouping closely related sequences. This switch can be used to set the order to the same as the input file. PARAMETER OUTPUT: This option allows you to save all your parameter settings in a parameter file. This file can be used subsequently to rerun Clustal W using the same parameters. >> HELP 6 << Help for profile and structure alignments By PROFILE ALIGNMENT, we mean alignment using existing alignments. Profile alignments allow you to store alignments of your favourite sequences and add new sequences to them in small bunches at a time. A profile is simply an alignment of one or more sequences (e.g. an alignment output file from CLUSTAL W). Each input can be a single sequence. One or both sets of input sequences may include secondary structure assignments or gap penalty masks to guide the alignment. The profiles can be in any of the allowed input formats with "-" characters used to specify gaps (except for MSF-RSF where "." is used). You have to specify the 2 profiles by choosing menu items 1 and 2 and giving 2 file names. Then Menu item 3 will align the 2 profiles to each other. Secondary structure masks in either profile can be used to guide the alignment. Menu item 4 will take the sequences in the second profile and align them to the first profile, 1 at a time. This is useful to add some new sequences to an existing alignment, or to align a set of sequences to a known structure. In this case, the second profile would not be pre-aligned. The alignment parameters can be set using menu items 5, 6 and 7. These are EXACTLY the same parameters as used by the general, automatic multiple alignment procedure. The general multiple alignment procedure is simply a series of profile alignments. Carrying out a series of profile alignments on larger and larger groups of sequences, allows you to manually build up a complete alignment, if necessary editing intermediate alignments. SECONDARY STRUCTURE OPTIONS. Menu Option 0 allows you to set 2D structure parameters. If a solved structure is available, it can be used to guide the alignment by raising gap penalties within secondary structure elements, so that gaps will preferentially be inserted into unstructured surface loops. Alternatively, a user-specified gap penalty mask can be supplied directly. A gap penalty mask is a series of numbers between 1 and 9, one per position in the alignment. Each number specifies how much the gap opening penalty is to be raised at that position (raised by multiplying the basic gap opening penalty by the number) i.e. a mask figure of 1 at a position means no change in gap opening penalty; a figure of 4 means that the gap opening penalty is four times greater at that position, making gaps 4 times harder to open. The format for gap penalty masks and secondary structure masks is explained in the help under option 0 (secondary structure options). >> HELP B << Help for secondary structure - gap penalty masks The use of secondary structure-based penalties has been shown to improve the accuracy of multiple alignment. Therefore CLUSTAL W now allows gap penalty masks to be supplied with the input sequences. The masks work by raising gap penalties in specified regions (typically secondary structure elements) so that gaps are preferentially opened in the less well conserved regions (typically surface loops). Options 1 and 2 control whether the input secondary structure information or gap penalty masks will be used. Option 3 controls whether the secondary structure and gap penalty masks should be included in the output alignment. Options 4 and 5 provide the value for raising the gap penalty at core Alpha Helical (A) and Beta Strand (B) residues. In CLUSTAL format, capital residues denote the A and B core structure notation. The basic gap penalties are multiplied by the amount specified. Option 6 provides the value for the gap penalty in Loops. By default this penalty is not raised. In CLUSTAL format, loops are specified by "." in the secondary structure notation. Option 7 provides the value for setting the gap penalty at the ends of secondary structures. Ends of secondary structures are observed to grow and-or shrink in related structures. Therefore by default these are given intermediate values, lower than the core penalties. All secondary structure read in as lower case in CLUSTAL format gets the reduced terminal penalty. Options 8 and 9 specify the range of structure termini for the intermediate penalties. In the alignment output, these are indicated as lower case. For Alpha Helices, by default, the range spans the end helical turn. For Beta Strands, the default range spans the end residue and the adjacent loop residue, since sequence conservation often extends beyond the actual H-bonded Beta Strand. CLUSTAL W can read the masks from SWISS-PROT, CLUSTAL or GDE format input files. For many 3-D protein structures, secondary structure information is recorded in the feature tables of SWISS-PROT database entries. You should always check that the assignments are correct - some are quite inaccurate. CLUSTAL W looks for SWISS-PROT HELIX and STRAND assignments e.g. FT HELIX 100 115 FT STRAND 118 119 The structure and penalty masks can also be read from CLUSTAL alignment format as comment lines beginning "!SS_" or "!GM_" e.g. !SS_HBA_HUMA ..aaaAAAAAAAAAAaaa.aaaAAAAAAAAAAaaaaaaAaaa.........aaaAAAAAA !GM_HBA_HUMA 112224444444444222122244444444442222224222111111111222444444 HBA_HUMA VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGK Note that the mask itself is a set of numbers between 1 and 9 each of which is assigned to the residue(s) in the same column below. In GDE flat file format, the masks are specified as text and the names must begin with "SS_ or "GM_. Either a structure or penalty mask or both may be used. If both are included in an alignment, the user will be asked which is to be used. >> HELP C << Help for secondary structure - gap penalty mask output options The options in this menu let you choose whether or not to include the masks in the CLUSTAL W output alignments. Showing both is useful for understanding how the masks work. The secondary structure information is itself very useful in judging the alignment quality and in seeing how residue conservation patterns vary with secondary structure. >> HELP 7 << Help for phylogenetic trees 1) Before calculating a tree, you must have an ALIGNMENT in memory. This can be input in any format or you should have just carried out a full multiple alignment and the alignment is still in memory. *************** Remember YOU MUST ALIGN THE SEQUENCES FIRST!!!! *************** The methods used are NJ (Neighbour Joining) and UPGMA. First you calculate distances (percent divergence) between all pairs of sequence from a multiple alignment; second you apply the NJ or UPGMA method to the distance matrix. 2) EXCLUDE POSITIONS WITH GAPS? With this option, any alignment positions where ANY of the sequences have a gap will be ignored. This means that 'like' will be compared to 'like' in all distances, which is highly desirable. It also automatically throws away the most ambiguous parts of the alignment, which are concentrated around gaps (usually). The disadvantage is that you may throw away much of the data if there are many gaps (which is why it is difficult for us to make it the default). 3) CORRECT FOR MULTIPLE SUBSTITUTIONS? For small divergence (say <10%) this option makes no difference. For greater divergence, it corrects for the fact that observed distances underestimate actual evolutionary distances. This is because, as sequences diverge, more than one substitution will happen at many sites. However, you only see one difference when you look at the present day sequences. Therefore, this option has the effect of stretching branch lengths in trees (especially long branches). The corrections used here (for DNA or proteins) are both due to Motoo Kimura. See the documentation for details. Where possible, this option should be used. However, for VERY divergent sequences, the distances cannot be reliably corrected. You will be warned if this happens. Even if none of the distances in a data set exceed the reliable threshold, if you bootstrap the data, some of the bootstrap distances may randomly exceed the safe limit. 4) To calculate a tree, use option 4 (DRAW TREE NOW). This gives an UNROOTED tree and all branch lengths. The root of the tree can only be inferred by using an outgroup (a sequence that you are certain branches at the outside of the tree .... certain on biological grounds) OR if you assume a degree of constancy in the 'molecular clock', you can place the root in the 'middle' of the tree (roughly equidistant from all tips). 5) TOGGLE PHYLIP BOOTSTRAP POSITIONS By default, the bootstrap values are correctly placed on the tree branches of the phylip format output tree. The toggle allows them to be placed on the nodes, which is incorrect, but some display packages (e.g. TreeTool, TreeView and Phylowin) only support node labelling but not branch labelling. Care should be taken to note which branches and labels go together. 6) OUTPUT FORMATS: four different formats are allowed. None of these displays the tree visually. Useful display programs accepting PHYLIP format include NJplot (from Manolo Gouy and supplied with Clustal W), TreeView (Mac-PC), and PHYLIP itself - OR get the PHYLIP package and use the tree drawing facilities there. (Get the PHYLIP package anyway if you are interested in trees). The NEXUS format can be read into PAUP or MacClade. >> HELP 8 << Help for choosing a weight matrix For protein alignments, you use a weight matrix to determine the similarity of non-identical amino acids. For example, Tyr aligned with Phe is usually judged to be 'better' than Tyr aligned with Pro. There are three 'in-built' series of weight matrices offered. Each consists of several matrices which work differently at different evolutionary distances. To see the exact details, read the documentation. Crudely, we store several matrices in memory, spanning the full range of amino acid distance (from almost identical sequences to highly divergent ones). For very similar sequences, it is best to use a strict weight matrix which only gives a high score to identities and the most favoured conservative substitutions. For more divergent sequences, it is appropriate to use "softer" matrices which give a high score to many other frequent substitutions. 1) BLOSUM (Henikoff). These matrices appear to be the best available for carrying out database similarity (homology searches). The matrices used are: Blosum 80, 62, 45 and 30. (BLOSUM was the default in earlier Clustal W versions) 2) PAM (Dayhoff). These have been extremely widely used since the late '70s. We use the PAM 20, 60, 120 and 350 matrices. 3) GONNET. These matrices were derived using almost the same procedure as the Dayhoff one (above) but are much more up to date and are based on a far larger data set. They appear to be more sensitive than the Dayhoff series. We use the GONNET 80, 120, 160, 250 and 350 matrices. This series is the default for Clustal W version 1.8. We also supply an identity matrix which gives a score of 1.0 to two identical amino acids and a score of zero otherwise. This matrix is not very useful. Alternatively, you can read in your own (just one matrix, not a series). A new matrix can be read from a file on disk, if the filename consists only of lower case characters. The values in the new weight matrix must be integers and the scores should be similarities. You can use negative as well as positive values if you wish, although the matrix will be automatically adjusted to all positive scores. For DNA, a single matrix (not a series) is used. Two hard-coded matrices are available: 1) IUB. This is the default scoring matrix used by BESTFIT for the comparison of nucleic acid sequences. X's and N's are treated as matches to any IUB ambiguity symbol. All matches score 1.9; all mismatches for IUB symbols score 0. 2) CLUSTALW(1.6). The previous system used by Clustal W, in which matches score 1.0 and mismatches score 0. All matches for IUB symbols also score 0. INPUT FORMAT The format used for a new matrix is the same as the BLAST program. Any lines beginning with a # character are assumed to be comments. The first non-comment line should contain a list of amino acids in any order, using the 1 letter code, followed by a * character. This should be followed by a square matrix of integer scores, with one row and one column for each amino acid. The last row and column of the matrix (corresponding to the * character) contain the minimum score over the whole matrix. >> HELP 9 << Help for command line parameters DATA (sequences) -INFILE=file.ext :input sequences. -PROFILE1=file.ext and -PROFILE2=file.ext :profiles (old alignment). VERBS (do things) -OPTIONS :list the command line parameters -HELP or -CHECK :outline the command line params. -FULLHELP :output full help content. -ALIGN :do full multiple alignment. -TREE :calculate NJ tree. -PIM :output percent identity matrix (while calculating the tree) -BOOTSTRAP(=n) :bootstrap a NJ tree (n= number of bootstraps; def. = 1000). -CONVERT :output the input sequences in a different file format. PARAMETERS (set things) ***General settings:**** -INTERACTIVE :read command line, then enter normal interactive menus -QUICKTREE :use FAST algorithm for the alignment guide tree -TYPE= :PROTEIN or DNA sequences -NEGATIVE :protein alignment with negative values in matrix -OUTFILE= :sequence alignment file name -OUTPUT= :CLUSTAL(default), GCG, GDE, PHYLIP, PIR, NEXUS and FASTA -OUTORDER= :INPUT or ALIGNED -CASE :LOWER or UPPER (for GDE output only) -SEQNOS= :OFF or ON (for Clustal output only) -SEQNO_RANGE=:OFF or ON (NEW: for all output formats) -RANGE=m,n :sequence range to write starting m to m+n -MAXSEQLEN=n :maximum allowed input sequence length -QUIET :Reduce console output to minimum -STATS= :Log some alignents statistics to file ***Fast Pairwise Alignments:*** -KTUPLE=n :word size -TOPDIAGS=n :number of best diags. -WINDOW=n :window around best diags. -PAIRGAP=n :gap penalty -SCORE :PERCENT or ABSOLUTE ***Slow Pairwise Alignments:*** -PWMATRIX= :Protein weight matrix=BLOSUM, PAM, GONNET, ID or filename -PWDNAMATRIX= :DNA weight matrix=IUB, CLUSTALW or filename -PWGAPOPEN=f :gap opening penalty -PWGAPEXT=f :gap opening penalty ***Multiple Alignments:*** -NEWTREE= :file for new guide tree -USETREE= :file for old guide tree -MATRIX= :Protein weight matrix=BLOSUM, PAM, GONNET, ID or filename -DNAMATRIX= :DNA weight matrix=IUB, CLUSTALW or filename -GAPOPEN=f :gap opening penalty -GAPEXT=f :gap extension penalty -ENDGAPS :no end gap separation pen. -GAPDIST=n :gap separation pen. range -NOPGAP :residue-specific gaps off -NOHGAP :hydrophilic gaps off -HGAPRESIDUES= :list hydrophilic res. -MAXDIV=n :% ident. for delay -TYPE= :PROTEIN or DNA -TRANSWEIGHT=f :transitions weighting -ITERATION= :NONE or TREE or ALIGNMENT -NUMITER=n :maximum number of iterations to perform -NOWEIGHTS :disable sequence weighting ***Profile Alignments:*** -PROFILE :Merge two alignments by profile alignment -NEWTREE1= :file for new guide tree for profile1 -NEWTREE2= :file for new guide tree for profile2 -USETREE1= :file for old guide tree for profile1 -USETREE2= :file for old guide tree for profile2 ***Sequence to Profile Alignments:*** -SEQUENCES :Sequentially add profile2 sequences to profile1 alignment -NEWTREE= :file for new guide tree -USETREE= :file for old guide tree ***Structure Alignments:*** -NOSECSTR1 :do not use secondary structure-gap penalty mask for profile 1 -NOSECSTR2 :do not use secondary structure-gap penalty mask for profile 2 -SECSTROUT=STRUCTURE or MASK or BOTH or NONE :output in alignment file -HELIXGAP=n :gap penalty for helix core residues -STRANDGAP=n :gap penalty for strand core residues -LOOPGAP=n :gap penalty for loop regions -TERMINALGAP=n :gap penalty for structure termini -HELIXENDIN=n :number of residues inside helix to be treated as terminal -HELIXENDOUT=n :number of residues outside helix to be treated as terminal -STRANDENDIN=n :number of residues inside strand to be treated as terminal -STRANDENDOUT=n:number of residues outside strand to be treated as terminal ***Trees:*** -OUTPUTTREE=nj OR phylip OR dist OR nexus -SEED=n :seed number for bootstraps. -KIMURA :use Kimura's correction. -TOSSGAPS :ignore positions with gaps. -BOOTLABELS=node OR branch :position of bootstrap values in tree display -CLUSTERING= :NJ or UPGMA >> HELP 0 << Help for tree output format options Four output formats are offered: 1) Clustal, 2) Phylip, 3) Just the distances 4) Nexus None of these formats displays the results graphically. Many packages can display trees in the the PHYLIP format 2) below. It can also be imported into the PHYLIP programs RETREE, DRAWTREE and DRAWGRAM for graphical display. NEXUS format trees can be read by PAUP and MacClade. 1) Clustal format output. This format is verbose and lists all of the distances between the sequences and the number of alignment positions used for each. The tree is described at the end of the file. It lists the sequences that are joined at each alignment step and the branch lengths. After two sequences are joined, it is referred to later as a NODE. The number of a NODE is the number of the lowest sequence in that NODE. 2) Phylip format output. This format is the New Hampshire format, used by many phylogenetic analysis packages. It consists of a series of nested parentheses, describing the branching order, with the sequence names and branch lengths. It can be used by the RETREE, DRAWGRAM and DRAWTREE programs of the PHYLIP package to see the trees graphically. This is the same format used during multiple alignment for the guide trees. Use this format with NJplot (Manolo Gouy), supplied with Clustal W. Some other packages that can read and display New Hampshire format are TreeView (Mac/PC), TreeTool (UNIX), and Phylowin. 3) The distances only. This format just outputs a matrix of all the pairwise distances in a format that can be used by the Phylip package. It used to be useful when one could not produce distances from protein sequences in the Phylip package but is now redundant (Protdist of Phylip 3.5 now does this). 4) NEXUS FORMAT TREE. This format is used by several popular phylogeny programs, including PAUP and MacClade. The format is described fully in: Maddison, D. R., D. L. Swofford and W. P. Maddison. 1997. NEXUS: an extensible file format for systematic information. Systematic Biology 46:590-621. 5) TOGGLE PHYLIP BOOTSTRAP POSITIONS By default, the bootstrap values are placed on the nodes of the phylip format output tree. This is inaccurate as the bootstrap values should be associated with the tree branches and not the nodes. However, this format can be read and displayed by TreeTool, TreeView and Phylowin. An option is available to correctly place the bootstrap values on the branches with which they are associated. clustalw-2.1/README0000644000175000017500000000131311442167172011016 00000000000000Please see also ftp://ftp.ebi.ac.uk/pub/software/clustalw2/README and http://www.clustal.org/ HOWTO COMPILE THE SOURCE AND INSTALL ---------------------------------------------------------------------- You will need a Unix environment with a working C++ compiler to compile the ClustalW source. We recommened GCC>=4.2. ICC users need to configure the package as follows: ./configure CXX=icpc For compilation under Windows you will probably need to install mingw and cygwin. Type $ ./configure $ make This will create a clustalw binary in the src directory. To install the software type $ make install (might have to be executed as superuser) or simply copy the clustalw binary to a directory of your choice. clustalw-2.1/missing0000755000175000017500000002623311331674343011545 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: clustalw-2.1/m4/0000755000175000017500000000000011467270447010547 500000000000000clustalw-2.1/m4/Makefile.am0000644000175000017500000000032411442167171012512 00000000000000# Install m4 macros in this directory m4datadir = $(datadir)/aclocal # List your m4 macros here #m4macros = AC_CHECK_VERSION m4macros = # The following is boilerplate m4data_DATA = EXTRA_DIST = $(m4data_DATA) clustalw-2.1/m4/Makefile.in0000644000175000017500000002605211457310177012533 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(m4datadir)" DATA = $(m4data_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLUSTALW_NAME = @CLUSTALW_NAME@ CLUSTALW_VERSION = @CLUSTALW_VERSION@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Install m4 macros in this directory m4datadir = $(datadir)/aclocal # List your m4 macros here #m4macros = AC_CHECK_VERSION m4macros = # The following is boilerplate m4data_DATA = EXTRA_DIST = $(m4data_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)" @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(m4datadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(m4datadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(m4datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-m4dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-m4dataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-m4dataDATA install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-m4dataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clustalw-2.1/config.guess0000755000175000017500000013105411274160642012462 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: clustalw-2.1/depcomp0000755000175000017500000004426711331674343011532 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: clustalw-2.1/COPYING.LESSER0000644000175000017500000001674311457601126012200 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. clustalw-2.1/COPYING0000644000175000017500000010451311457601157011201 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .