Trees | Indices | Help |
---|
|
Basic functions for breaking up a GenBank/EMBL file into sub sections.
The International Nucleotide Sequence Database Collaboration (INSDC) between the DDBJ, EMBL, and GenBank. These organisations all use the same "Feature Table" layout in their plain text flat file formats.
However, the header and sequence sections of an EMBL file are very different in layout to those produced by GenBank/DDBJ.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
Read in lines until find the ID/LOCUS line, which is returned. Any preamble (such as the header used by the NCBI on *.seq.gz archives) will we ignored. |
Return list of strings making up the header New line characters are removed. Assumes you have just read in the ID/LOCUS line. |
Return list of tuples for the features (if present) Each feature is returned as a tuple (key, location, qualifiers) where key and location are strings (e.g. "CDS" and "complement(join(490883..490885,1..879))") while qualifiers is a list of two string tuples (feature qualifier keys and values). Assumes you have already read to the start of the features table. |
Expects a feature as a list of strings, returns a tuple (key, location, qualifiers) For example given this GenBank feature: CDS complement(join(490883..490885,1..879)) /locus_tag="NEQ001" /note="conserved hypothetical [Methanococcus jannaschii]; COG1583:Uncharacterized ACR; IPR001472:Bipartite nuclear localization signal; IPR002743: Protein of unknown function DUF57" /codon_start=1 /transl_table=11 /product="hypothetical protein" /protein_id="NP_963295.1" /db_xref="GI:41614797" /db_xref="GeneID:2732620" /translation="MRLLLELKALNSIDKKQLSNYLIQGFIYNILKNTEYSWLHNWKK EKYFNFTLIPKKDIIENKRYYLIISSPDKRFIEVLHNKIKDLDIITIGLAQFQLRKTK KFDPKLRFPWVTITPIVLREGKIVILKGDKYYKVFVKRLEELKKYNLIKKKEPILEEP IEISLNQIKDGWKIIDVKDRYYDFRNKSFSAFSNWLRDLKEQSLRKYNNFCGKNFYFE EAIFEGFTFYKTVSIRIRINRGEAVYIGTLWKELNVYRKLDKEEREFYKFLYDCGLGS LNSMGFGFVNTKKNSAR" Then should give input key="CDS" and the rest of the data as a list of strings lines=["complement(join(490883..490885,1..879))", ..., "LNSMGFGFVNTKKNSAR"] where the leading spaces and trailing newlines have been removed. Returns tuple containing: (key as string, location string, qualifiers as list) as follows for this example: key = "CDS", string location = "complement(join(490883..490885,1..879))", string qualifiers = list of string tuples: [('locus_tag', '"NEQ001"'), ('note', '"conserved hypothetical [Methanococcus jannaschii]; COG1583:..."'), ('codon_start', '1'), ('transl_table', '11'), ('product', '"hypothetical protein"'), ('protein_id', '"NP_963295.1"'), ('db_xref', '"GI:41614797"'), ('db_xref', '"GeneID:2732620"'), ('translation', '"MRLLLELKALNSIDKKQLSNYLIQGFIYNILKNTEYSWLHNWKK EKYFNFT..."')] In the above example, the "note" and "translation" were edited for compactness, and they would contain multiple new line characters (displayed above as ) If a qualifier is quoted (in this case, everything except codon_start and transl_table) then the quotes are NOT removed. Note that no whitespace is removed. |
Handle the LOCUS/ID line, passing data to the comsumer This should be implemented by the EMBL / GenBank specific subclass Used by the parse_records() and parse() methods. |
Handle the header lines (list of strings), passing data to the comsumer This should be implemented by the EMBL / GenBank specific subclass Used by the parse_records() and parse() methods. |
Handle the feature table (list of tuples), passing data to the comsumer Used by the parse_records() and parse() methods. |
Handle any lines between features and sequence (list of strings), passing data to the consumer This should be implemented by the EMBL / GenBank specific subclass Used by the parse_records() and parse() methods. |
Feed a set of data into the consumer. This method is intended for use with the "old" code in Bio.GenBank Arguments: handle - A handle with the information to parse. consumer - The consumer that should be informed of events. do_features - Boolean, should the features be parsed? Skipping the features can be much faster. Return values: true - Passed a record false - Did not find a record |
Returns a SeqRecord (with SeqFeatures if do_features=True) See also the method parse_records() for use on multi-record files. |
Returns a SeqRecord object iterator Each record (from the ID/LOCUS line to the // line) becomes a SeqRecord The SeqRecord objects include SeqFeatures if do_features=True This method is intended for use in Bio.SeqIO |
Returns SeqRecord object iterator Each CDS feature becomes a SeqRecord. alphabet - Used for any sequence found in a translation field. tags2id - Tupple of three strings, the feature keys to use for the record id, name and description, This method is intended for use in Bio.SeqIO |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Sep 22 19:54:00 2009 | http://epydoc.sourceforge.net |