Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
test_SeqIO_features.NC_000932 Class Reference
Inheritance diagram for test_SeqIO_features.NC_000932:
Inheritance graph
[legend]
Collaboration diagram for test_SeqIO_features.NC_000932:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_CDS

Public Attributes

 gb_filename
 ffn_filename
 faa_filename
 fna_filename
 embl_filename

Static Public Attributes

string basename = "NC_000932"
 emblname = None
int table = 11
list skip_trans_test

Static Private Attributes

string __doc__ = "Tests using %s GenBank and FASTA files from the NCBI"

Detailed Description

Definition at line 950 of file test_SeqIO_features.py.


Member Function Documentation

Definition at line 962 of file test_SeqIO_features.py.

00962 
00963     def setUp(self):
00964         self.gb_filename = os.path.join("GenBank",self.basename+".gb")
00965         self.ffn_filename = os.path.join("GenBank",self.basename+".ffn")
00966         self.faa_filename = os.path.join("GenBank",self.basename+".faa")
00967         self.fna_filename = os.path.join("GenBank",self.basename+".fna")
00968         if self.emblname:
00969             self.embl_filename = os.path.join("EMBL",self.emblname+".embl")

Definition at line 971 of file test_SeqIO_features.py.

00971 
00972     def test_CDS(self):
00973         #"""Checking GenBank CDS translations vs FASTA faa file."""
00974         gb_record = SeqIO.read(open(self.gb_filename),"genbank")
00975         gb_cds = list(SeqIO.parse(open(self.gb_filename),"genbank-cds"))
00976         fasta = list(SeqIO.parse(open(self.faa_filename),"fasta"))
00977         compare_records(gb_cds, fasta)
00978         cds_features = [f for f in gb_record.features if f.type=="CDS"]
00979         self.assertEqual(len(cds_features), len(fasta))
00980         for f, r in zip(cds_features, fasta):
00981             if r.id in self.skip_trans_test:
00982                 continue
00983             #Get the nucleotides and translate them
00984             nuc = f.extract(gb_record.seq)
00985             self.assertEqual(len(nuc), len(f))
00986             pro = nuc.translate(table=self.table, cds=True)
00987             #print r.id, nuc, pro, r.seq
00988             #print f
00989             if pro[-1] == "*":
00990                 self.assertEqual(str(pro)[:-1], str(r.seq))
00991             else:
00992                 self.assertEqual(str(pro), str(r.seq))

Here is the call graph for this function:


Member Data Documentation

string test_SeqIO_features.NC_000932.__doc__ = "Tests using %s GenBank and FASTA files from the NCBI" [static, private]

Reimplemented in test_SeqIO_features.NC_005816.

Definition at line 959 of file test_SeqIO_features.py.

string test_SeqIO_features.NC_000932.basename = "NC_000932" [static]

Reimplemented in test_SeqIO_features.NC_005816.

Definition at line 952 of file test_SeqIO_features.py.

Definition at line 968 of file test_SeqIO_features.py.

Reimplemented in test_SeqIO_features.NC_005816.

Definition at line 953 of file test_SeqIO_features.py.

Definition at line 965 of file test_SeqIO_features.py.

Definition at line 964 of file test_SeqIO_features.py.

Definition at line 966 of file test_SeqIO_features.py.

Definition at line 963 of file test_SeqIO_features.py.

Initial value:
["gi|7525080|ref|NP_051037.1|", #dual-strand
                       "gi|7525057|ref|NP_051038.1|", #dual-strand
                       "gi|90110725|ref|NP_051109.2|", #Invalid annotation? No start codon
                       ]

Reimplemented in test_SeqIO_features.NC_005816.

Definition at line 955 of file test_SeqIO_features.py.

Reimplemented in test_SeqIO_features.NC_005816.

Definition at line 954 of file test_SeqIO_features.py.


The documentation for this class was generated from the following file: