Bio :: GenBank :: _FeatureConsumer :: Class _FeatureConsumer
[hide private]
[frames] | no frames]

Class _FeatureConsumer

source code

          object --+    
                   |    
_BaseGenBankConsumer --+
                       |
                      _FeatureConsumer

Create a SeqRecord object with Features to return (PRIVATE).

Attributes:
o use_fuzziness - specify whether or not to parse with fuzziness in
feature locations.
o feature_cleaner - a class that will be used to provide specialized
cleaning-up of feature values.

Instance Methods [hide private]
 
__init__(self, use_fuzziness, feature_cleaner=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
locus(self, locus_name)
Set the locus name is set as the name of the Sequence.
source code
 
size(self, content)
Record the sequence length.
source code
 
residue_type(self, type)
Record the sequence type so we can choose an appropriate alphabet.
source code
 
data_file_division(self, division) source code
 
date(self, submit_date) source code
 
definition(self, definition)
Set the definition as the description of the sequence.
source code
 
accession(self, acc_num)
Set the accession number as the id of the sequence.
source code
 
wgs(self, content) source code
 
add_wgs_scafld(self, content) source code
 
nid(self, content) source code
 
pid(self, content) source code
 
version(self, version_id) source code
 
project(self, content)
Handle the information from the PROJECT line as a list of projects.
source code
 
dblink(self, content)
Store DBLINK cross references as dbxrefs in our record object.
source code
 
version_suffix(self, version)
Set the version to overwrite the id.
source code
 
db_source(self, content) source code
 
gi(self, content) source code
 
keywords(self, content) source code
 
segment(self, content) source code
 
source(self, content) source code
 
organism(self, content) source code
 
taxonomy(self, content)
Records (another line of) the taxonomy lineage.
source code
 
reference_num(self, content)
Signal the beginning of a new reference object.
source code
 
reference_bases(self, content)
Attempt to determine the sequence region the reference entails.
source code
 
_split_reference_locations(self, location_string)
Get reference locations out of a string of reference information
source code
 
authors(self, content) source code
 
consrtm(self, content) source code
 
title(self, content) source code
 
journal(self, content) source code
 
medline_id(self, content) source code
 
pubmed_id(self, content) source code
 
remark(self, content)
Deal with a reference comment.
source code
 
comment(self, content) source code
 
features_line(self, content)
Get ready for the feature table when we reach the FEATURE line.
source code
 
start_feature_table(self)
Indicate we've got to the start of the feature table.
source code
 
feature_key(self, content) source code
 
location(self, content)
Parse out location information from the location string.
source code
 
feature_qualifier(self, key, value)
When we get a qualifier key and its value.
source code
 
feature_qualifier_name(self, content_list)
Use feature_qualifier instead (OBSOLETE).
source code
 
feature_qualifier_description(self, content)
Use feature_qualifier instead (OBSOLETE).
source code
 
contig_location(self, content)
Deal with CONTIG information.
source code
 
origin_name(self, content) source code
 
base_count(self, content) source code
 
base_number(self, content) source code
 
sequence(self, content)
Add up sequence information as we get it.
source code
 
record_end(self, content)
Clean up when we've finished the record.
source code

Inherited from _BaseGenBankConsumer: __getattr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from _BaseGenBankConsumer: remove_space_keys

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, use_fuzziness, feature_cleaner=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

accession(self, acc_num)

source code 
Set the accession number as the id of the sequence.

If we have multiple accession numbers, the first one passed is
used.

project(self, content)

source code 
Handle the information from the PROJECT line as a list of projects.

e.g.
PROJECT     GenomeProject:28471

or:
PROJECT     GenomeProject:13543  GenomeProject:99999

This is stored as dbxrefs in the SeqRecord to be consistent with the
projected switch of this line to DBLINK in future GenBank versions.
Note the NCBI plan to replace "GenomeProject:28471" with the shorter
"Project:28471" as part of this transition.

dblink(self, content)

source code 
Store DBLINK cross references as dbxrefs in our record object.

This line type is expected to replace the PROJECT line in 2009. e.g.

During transition:

PROJECT     GenomeProject:28471
DBLINK      Project:28471
            Trace Assembly Archive:123456

Once the project line is dropped:

DBLINK      Project:28471
            Trace Assembly Archive:123456

Note GenomeProject -> Project.

We'll have to see some real examples to be sure, but based on the
above example we can expect one reference per line.

Note that at some point the NCBI have included an extra space, e.g.

DBLINK      Project: 28471

version_suffix(self, version)

source code 
Set the version to overwrite the id.

Since the verison provides the same information as the accession
number, plus some extra info, we set this as the id if we have
a version.

reference_bases(self, content)

source code 
Attempt to determine the sequence region the reference entails.

Possible types of information we may have to deal with:

(bases 1 to 86436)
(sites)
(bases 1 to 105654; 110423 to 111122)
1  (residues 1 to 182)

_split_reference_locations(self, location_string)

source code 
Get reference locations out of a string of reference information

The passed string should be of the form:

    1 to 20; 20 to 100

This splits the information out and returns a list of location objects
based on the reference locations.

location(self, content)

source code 
Parse out location information from the location string.

This uses simple Python code with some regular expressions to do the
parsing, and then translates the results into appropriate objects.

feature_qualifier(self, key, value)

source code 
When we get a qualifier key and its value.

Can receive None, since you can have valueless keys such as /pseudo

sequence(self, content)

source code 
Add up sequence information as we get it.

To try and make things speedier, this puts all of the strings
into a list of strings, and then uses string.join later to put
them together. Supposedly, this is a big time savings