Package Bio :: Package Align :: Package Applications :: Module _Dialign
[hide private]
[frames] | no frames]

Source Code for Module Bio.Align.Applications._Dialign

  1  # Copyright 2009 by Cymon J. Cox.  All rights reserved. 
  2  # This code is part of the Biopython distribution and governed by its 
  3  # license.  Please see the LICENSE file that should have been included 
  4  # as part of this package. 
  5  """Command line wrapper for the multiple alignment program DIALIGN2-2. 
  6  """ 
  7   
  8  from __future__ import print_function 
  9   
 10  __docformat__ = "epytext en"  # Don't just use plain text in epydoc API pages! 
 11   
 12  from Bio.Application import _Option, _Argument, _Switch, AbstractCommandline 
 13   
 14   
15 -class DialignCommandline(AbstractCommandline):
16 """Command line wrapper for the multiple alignment program DIALIGN2-2. 17 18 http://bibiserv.techfak.uni-bielefeld.de/dialign/welcome.html 19 20 Example: 21 22 To align a FASTA file (unaligned.fasta) with the output files names 23 aligned.* including a FASTA output file (aligned.fa), use: 24 25 >>> from Bio.Align.Applications import DialignCommandline 26 >>> dialign_cline = DialignCommandline(input="unaligned.fasta", 27 ... fn="aligned", fa=True) 28 >>> print(dialign_cline) 29 dialign2-2 -fa -fn aligned unaligned.fasta 30 31 You would typically run the command line with dialign_cline() or via 32 the Python subprocess module, as described in the Biopython tutorial. 33 34 Citation: 35 36 B. Morgenstern (2004). DIALIGN: Multiple DNA and Protein Sequence 37 Alignment at BiBiServ. Nucleic Acids Research 32, W33-W36. 38 39 Last checked against version: 2.2 40 """
41 - def __init__(self, cmd="dialign2-2", **kwargs):
42 self.program_name = cmd 43 self.parameters = \ 44 [ 45 _Switch(["-afc", "afc"], 46 "Creates additional output file '*.afc' " 47 "containing data of all fragments considered " 48 "for alignment WARNING: this file can be HUGE !"), 49 _Switch(["-afc_v", "afc_v"], 50 "Like '-afc' but verbose: fragments are explicitly " 51 "printed. WARNING: this file can be EVEN BIGGER !"), 52 _Switch(["-anc", "anc"], 53 "Anchored alignment. Requires a file <seq_file>.anc " 54 "containing anchor points."), 55 _Switch(["-cs", "cs"], 56 "If segments are translated, not only the `Watson " 57 "strand' but also the `Crick strand' is looked at."), 58 _Switch(["-cw", "cw"], 59 "Additional output file in CLUSTAL W format."), 60 _Switch(["-ds", "ds"], 61 "`dna alignment speed up' - non-translated nucleic acid " 62 "fragments are taken into account only if they start " 63 "with at least two matches. Speeds up DNA alignment at " 64 "the expense of sensitivity."), 65 _Switch(["-fa", "fa"], 66 "Additional output file in FASTA format."), 67 _Switch(["-ff", "ff"], 68 "Creates file *.frg containing information about all " 69 "fragments that are part of the respective optimal " 70 "pairwise alignmnets plus information about " 71 "consistency in the multiple alignment"), 72 _Option(["-fn", "fn"], 73 "Output files are named <out_file>.<extension>.", 74 equate=False), 75 _Switch(["-fop", "fop"], 76 "Creates file *.fop containing coordinates of all " 77 "fragments that are part of the respective pairwise alignments."), 78 _Switch(["-fsm", "fsm"], 79 "Creates file *.fsm containing coordinates of all " 80 "fragments that are part of the final alignment"), 81 _Switch(["-iw", "iw"], 82 "Overlap weights switched off (by default, overlap " 83 "weights are used if up to 35 sequences are aligned). " 84 "This option speeds up the alignment but may lead " 85 "to reduced alignment quality."), 86 _Switch(["-lgs", "lgs"], 87 "`long genomic sequences' - combines the following " 88 "options: -ma, -thr 2, -lmax 30, -smin 8, -nta, -ff, " 89 "-fop, -ff, -cs, -ds, -pst "), 90 _Switch(["-lgs_t", "lgs_t"], 91 "Like '-lgs' but with all segment pairs assessed " 92 "at the peptide level (rather than 'mixed alignments' " 93 "as with the '-lgs' option). Therefore faster than " 94 "-lgs but not very sensitive for non-coding regions."), 95 _Option(["-lmax", "lmax"], 96 "Maximum fragment length = x (default: x = 40 or " 97 "x = 120 for `translated' fragments). Shorter x " 98 "speeds up the program but may affect alignment quality.", 99 checker_function=lambda x: isinstance(x, int), 100 equate=False), 101 _Switch(["-lo", "lo"], 102 "(Long Output) Additional file *.log with information " 103 "about fragments selected for pairwise alignment and " 104 "about consistency in multi-alignment proceedure."), 105 _Switch(["-ma", "ma"], 106 "`mixed alignments' consisting of P-fragments and " 107 "N-fragments if nucleic acid sequences are aligned."), 108 _Switch(["-mask", "mask"], 109 "Residues not belonging to selected fragments are " 110 "replaced by `*' characters in output alignment " 111 "(rather than being printed in lower-case characters)"), 112 _Switch(["-mat", "mat"], 113 "Creates file *mat with substitution counts derived " 114 "from the fragments that have been selected for alignment."), 115 _Switch(["-mat_thr", "mat_thr"], 116 "Like '-mat' but only fragments with weight score " 117 "> t are considered"), 118 _Switch(["-max_link", "max_link"], 119 "'maximum linkage' clustering used to construct " 120 "sequence tree (instead of UPGMA)."), 121 _Switch(["-min_link", "min_link"], 122 "'minimum linkage' clustering used."), 123 _Option(["-mot", "mot"], 124 "'motif' option.", 125 equate=False), 126 _Switch(["-msf", "msf"], 127 "Separate output file in MSF format."), 128 _Switch(["-n", "n"], 129 "Input sequences are nucleic acid sequences. " 130 "No translation of fragments."), 131 _Switch(["-nt", "nt"], 132 "Input sequences are nucleic acid sequences and " 133 "`nucleic acid segments' are translated to `peptide " 134 "segments'."), 135 _Switch(["-nta", "nta"], 136 "`no textual alignment' - textual alignment suppressed. " 137 "This option makes sense if other output files are of " 138 "intrest -- e.g. the fragment files created with -ff, " 139 "-fop, -fsm or -lo."), 140 _Switch(["-o", "o"], 141 "Fast version, resulting alignments may be slightly " 142 "different."), 143 _Switch(["-ow", "ow"], 144 "Overlap weights enforced (By default, overlap weights " 145 "are used only if up to 35 sequences are aligned since " 146 "calculating overlap weights is time consuming)."), 147 _Switch(["-pst", "pst"], 148 "'print status'. Creates and updates a file *.sta with " 149 "information about the current status of the program " 150 "run. This option is recommended if large data sets " 151 "are aligned since it allows the user to estimate the " 152 "remaining running time."), 153 _Switch(["-smin", "smin"], 154 "Minimum similarity value for first residue pair " 155 "(or codon pair) in fragments. Speeds up protein " 156 "alignment or alignment of translated DNA fragments " 157 "at the expense of sensitivity."), 158 _Option(["-stars", "stars"], 159 "Maximum number of `*' characters indicating degree " 160 "of local similarity among sequences. By default, no " 161 "stars are used but numbers between 0 and 9, instead.", 162 checker_function = lambda x: x in range(0, 10), 163 equate=False), 164 _Switch(["-stdo", "stdo"], 165 "Results written to standard output."), 166 _Switch(["-ta", "ta"], 167 "Standard textual alignment printed (overrides " 168 "suppression of textual alignments in special " 169 "options, e.g. -lgs)"), 170 _Option(["-thr", "thr"], 171 "Threshold T = x.", 172 checker_function = lambda x: isinstance(x, int), 173 equate=False), 174 _Switch(["-xfr", "xfr"], 175 "'exclude fragments' - list of fragments can be " 176 "specified that are NOT considered for pairwise alignment"), 177 _Argument(["input"], 178 "Input file name. Must be FASTA format", 179 filename=True, 180 is_required=True), 181 ] 182 AbstractCommandline.__init__(self, cmd, **kwargs)
183 184
185 -def _test():
186 """Run the module's doctests (PRIVATE).""" 187 print("Running modules doctests...") 188 import doctest 189 doctest.testmod() 190 print("Done")
191 192 if __name__ == "__main__": 193 _test() 194