Package BioSQL :: Module BioSeqDatabase :: Class BioSeqDatabase
[hide private]
[frames] | no frames]

Class BioSeqDatabase

source code

Represents a namespace (sub-database) within the BioSQL database.

i.e. One row in the biodatabase table, and all all rows in the bioentry
table associated with it.

Instance Methods [hide private]
 
__init__(self, adaptor, name) source code
 
__repr__(self) source code
 
get_Seq_by_id(self, name)
Gets a DBSeqRecord object by its name
source code
 
get_Seq_by_acc(self, name)
Gets a DBSeqRecord object by accession number
source code
 
get_Seq_by_ver(self, name)
Gets a DBSeqRecord object by version number
source code
 
get_Seqs_by_acc(self, name)
Gets a list of DBSeqRecord objects by accession number
source code
 
get_all_primary_ids(self)
All the primary_ids of the sequences in the database (OBSOLETE).
source code
 
__getitem__(self, key) source code
 
__delitem__(self, key)
Remove an entry and all its annotation.
source code
 
__len__(self)
Number of records in this namespace (sub database).
source code
 
__contains__(self, value)
Check if a primary (internal) id is this namespace (sub database).
source code
 
__iter__(self)
Iterate over ids (which may not be meaningful outside this database).
source code
 
iterkeys(self)
Iterate over ids (which may not be meaningful outside this database).
source code
 
itervalues(self)
Iterate over DBSeqRecord objects in the namespace (sub database).
source code
 
iteritems(self)
Iterate over (id, DBSeqRecord) for the namespace (sub database).
source code
 
keys(self)
List of ids which may not be meaningful outside this database.
source code
 
values(self)
List of DBSeqRecord objects in the namespace (sub database).
source code
 
items(self)
List of (id, DBSeqRecord) for the namespace (sub database).
source code
 
lookup(self, **kwargs) source code
 
get_Seq_by_primary_id(self, seqid)
Get a DBSeqRecord by the primary (internal) id (OBSOLETE).
source code
 
load(self, record_iterator, fetch_NCBI_taxonomy=False)
Load a set of SeqRecords into the BioSQL database.
source code
Method Details [hide private]

get_Seq_by_id(self, name)

source code 
Gets a DBSeqRecord object by its name

Example: seq_rec = db.get_Seq_by_id('ROA1_HUMAN')

The name of this method is misleading since it returns a DBSeqRecord
rather than a DBSeq ojbect, and presumably was to mirror BioPerl.

get_Seq_by_acc(self, name)

source code 
Gets a DBSeqRecord object by accession number

Example: seq_rec = db.get_Seq_by_acc('X77802')

The name of this method is misleading since it returns a DBSeqRecord
rather than a DBSeq ojbect, and presumably was to mirror BioPerl.

get_Seq_by_ver(self, name)

source code 
Gets a DBSeqRecord object by version number

Example: seq_rec = db.get_Seq_by_ver('X77802.1')

The name of this method is misleading since it returns a DBSeqRecord
rather than a DBSeq ojbect, and presumably was to mirror BioPerl.

get_Seqs_by_acc(self, name)

source code 
Gets a list of DBSeqRecord objects by accession number

Example: seq_recs = db.get_Seq_by_acc('X77802')

The name of this method is misleading since it returns a list of
DBSeqRecord objects rather than a list of DBSeq ojbects, and presumably
was to mirror BioPerl.

get_all_primary_ids(self)

source code 
All the primary_ids of the sequences in the database (OBSOLETE).

These maybe ids (display style) or accession numbers or
something else completely different - they *are not*
meaningful outside of this database implementation.

Please use .keys() instead of .get_all_primary_ids()

get_Seq_by_primary_id(self, seqid)

source code 
Get a DBSeqRecord by the primary (internal) id (OBSOLETE).

Rather than db.get_Seq_by_primary_id(my_id) use db[my_id]

The name of this method is misleading since it returns a DBSeqRecord
rather than a DBSeq ojbect, and presumably was to mirror BioPerl.

load(self, record_iterator, fetch_NCBI_taxonomy=False)

source code 
Load a set of SeqRecords into the BioSQL database.

record_iterator is either a list of SeqRecord objects, or an
Iterator object that returns SeqRecord objects (such as the
output from the Bio.SeqIO.parse() function), which will be
used to populate the database.

fetch_NCBI_taxonomy is boolean flag allowing or preventing
connection to the taxonomic database on the NCBI server
(via Bio.Entrez) to fetch a detailed taxonomy for each
SeqRecord.

Example:
from Bio import SeqIO
count = db.load(SeqIO.parse(open(filename), format))

Returns the number of records loaded.