allpy
view allpy/fileio.py @ 861:0dbbf6403b7f
Removed pair_cores/html.htm and blocks3d/html.htm, whcih were autogenerated files. Looks like this closes #93.
| author | Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
|---|---|
| date | Thu, 21 Jul 2011 16:41:08 +0400 |
| parents | 18119191a4c8 |
| children | cfcbd13f6761 |
line source
7 """This ugly helper is to avoid bad untimely import loops."""
12 """Automatical file IO."""
25 """Some helpers."""
34 """Append alignment to the file."""
38 )
41 """Read alignment from the file."""
48 """Fasta parser & writer."""
51 """Append one sequence to file."""
64 """Write sequences to file.
66 Sequences are given as list of tuples (string, name, description).
67 """
72 """Read parts beginning with > in FASTA file.
74 This is a drop-in replacement for self.file.read().split("\n>")
75 It is required for markup format, which combines parts read with
76 different parsers. Python prohibits combining iterators and file.read
77 methods on the same file.
78 """
98 """Parser & writer for our own marked alignment file format.
100 Marked alignment file consists of a list of records, separated with one or
101 more empty lines. Each record consists of type name, header and optional
102 contents. Type name is a line, containing just one word, describing the
103 record type. Header is a sequence of lines, each in format `key: value`.
104 Content, if present, is separated from header with an empty line.
106 Type names and header key names are case-insensitive and '-' and '_' in
107 them are equivalent.
109 Known record types now are:
111 - `alignment` -- this must be the last record in file for now
112 - `sequence_markup`
113 - `alignment_markup`
115 Example::
117 sequence-markup
118 sequence-name: cyb5_mouse
119 sequence-description:
120 name: pdb_residue_number
121 type: SequencePDBResidueNumberMarkup
122 markup: -,12,121,122,123,124,13,14,15,-,-,16
124 alignment-markup
125 name: geometrical_core
126 type: AlignmentGeometricalCoreMarkup
127 markup: -,-,-,-,+,+,+,-,-,-,+,+,-,-,-,-
129 alignment
130 format: fasta
132 > cyb5_mouse
133 seqvencemouse
134 """
137 """Helper attribute for write_empty_line."""
140 """Write alignment to file."""
146 }
