Class MASTParser
AbstractParser
--+
|
MASTParser
Parser for MAST text output. HTML output cannot be parsed, yet. Returns a MASTRecord
A MASTParser takes a file handle for a MAST text output file and
returns a MASTRecord, containing the hits between motifs and
sequences. The parser does some unusual line buffering to parse out
match diagrams. Really complex diagrams often lead to an error message
and p-values not being parsed for a given line.
Methods:
parse (handle): parses the data from the file handle passed to it.
Example:
f = open("mast_file.txt")
parser = MASTParser()
mast_record = parser.parse(f)
for motif in mast_record.motifs:
for instance in motif.instances:
print instance.motif_name, instance.sequence_name, instance.strand, instance.pvalue
Method Summary |
|
__init__(self)
|
|
parse(self,
handle)
|
Inherited from AbstractParser |
|
parse_file (self,
filename)
|
|
parse_str (self,
string)
|