Package Bio :: Package Motif :: Package Parsers :: Module MEME :: Class MASTParser
[hide private]
[frames] | no frames]

Class MASTParser

source code

ParserSupport.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

Instance Methods [hide private]
 
__init__(self) source code
 
parse(self, handle) source code

Inherited from ParserSupport.AbstractParser: parse_file, parse_str

Method Details [hide private]

parse(self, handle)

source code 
Overrides: ParserSupport.AbstractParser.parse