allpy
view allpy/processors.py @ 1168:b556c96c6719
blocks3d/www Makefile: never check certificates of github, they are too confusing for wget
author | Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
---|---|
date | Mon, 26 May 2014 17:20:29 +0400 |
parents | f05b08e13072 |
children |
line source
1 """Processors for Alignment.process and Block.process.
2 """
9 #
10 # External command processors: processors that pass their output to some
11 # other program (via call to os.system).
12 #
15 """Use external command to process block.
17 External command will receive FASTA-file and must return answer as a
18 FASTA-file with the same ordering of sequences.
19 """
36 #
37 # Standard (re)alignment tools.
38 #
41 """Realign block with muscle.
43 Arguments:
45 - remove_gaps -- drop all gaps from alignment before realigning
46 """
60 """"Realign block with Muscle.
62 Accepted arguments:
64 - `remove_gaps` -- make fresh alignment (remove gaps before aligning);
65 otherwise, gaps are retained and muscle performs subalignment of
66 an existing alignment.
67 """
71 """Realign block with needle.
73 WARNING! This MUST be wrapped in `FixNamesAndOrder()`.
74 """
93 """Realign block with Needle.
95 Arguments are the same as accepted by needle command line program.
96 """
99 #
100 # Trivial processors (move all gaps to one side)
101 #
104 """Flush all non-gap monomers to one side."""
116 """Flush all non-gap monomers to the left."""
121 """Flush all non-gap monomers to the right."""
126 """Center all non-gap monomers in alignment."""
130 #
131 # Helper processors that are combined with other processors to work
132 #
135 """Metaprocessor: only apply processor to non-empty rows in alignment."""
145 ]
155 """Metaprocessor: fix sequence ordering output by processor."""
158 """Create the processor.
160 Arguments:
162 - `processor` -- a processor to fix ordering of
163 - `id` -- a function mapping sequence to it's identity,
164 identity is some hashable value that does not change after applying
165 the processor; e.g. it is sequence name or a pair of name and
166 description; defaults to FixOrdering.id_by_name_description
167 """
178 ))
180 "Sequence identificators must be unique!"
184 ]
187 @staticmethod
191 @staticmethod
195 @staticmethod
200 """Metaprocessor: avoid problems with sequence names and sequence order.
202 Temporarily replace sequence names with numbers while processor. Don't
203 bother restoring sequence names/desceriptions, since the caller will only
204 rely on sequence order.
205 """
219 # vim: set et ts=4 sts=4 sw=4: