Back to index

python-biopython  1.60
Public Member Functions
test_Emboss.TranslationTests Class Reference

List of all members.

Public Member Functions

def tearDown
def test_simple
def check
def translate_all_codons
def test_all_unambig_dna_codons
def test_all_unambig_rna_codons
def test_mixed_unambig_rna_codons

Detailed Description

Run pairwise alignments with water and needle, and parse them.

Definition at line 822 of file test_Emboss.py.


Member Function Documentation

def test_Emboss.TranslationTests.check (   self,
  sequence 
)
Compare our translation to EMBOSS's using all tables.

Takes a Seq object (and a filename containing it).

Definition at line 863 of file test_Emboss.py.

00863 
00864     def check(self, sequence):
00865         """Compare our translation to EMBOSS's using all tables.
00866 
00867         Takes a Seq object (and a filename containing it)."""
00868         translation = emboss_translate(sequence)
00869         self.assertTrue(check_translation(sequence, translation))
00870 
00871         for table in [1,2,3,4,5,6,9,10,11,12,13,14,15,16,21,22,23]:
00872             translation = emboss_translate(sequence, table)
00873             self.assertTrue(check_translation(sequence, translation, table))
00874         return True

Here is the call graph for this function:

Definition at line 825 of file test_Emboss.py.

00825 
00826     def tearDown(self):
00827         clean_up()

Here is the call graph for this function:

transeq vs Bio.Seq on unambiguous DNA codons (inc. alt tables).

Definition at line 887 of file test_Emboss.py.

00887 
00888     def test_all_unambig_dna_codons(self):
00889         """transeq vs Bio.Seq on unambiguous DNA codons (inc. alt tables)."""
00890         self.translate_all_codons("ATCGatcg")

Here is the call graph for this function:

transeq vs Bio.Seq on unambiguous RNA codons (inc. alt tables).

Definition at line 891 of file test_Emboss.py.

00891 
00892     def test_all_unambig_rna_codons(self):
00893         """transeq vs Bio.Seq on unambiguous RNA codons (inc. alt tables)."""
00894         self.translate_all_codons("AUCGaucg")

Here is the call graph for this function:

transeq vs Bio.Seq on unambiguous DNA/RNA codons (inc. alt tables).

Definition at line 895 of file test_Emboss.py.

00895 
00896     def test_mixed_unambig_rna_codons(self):
00897         """transeq vs Bio.Seq on unambiguous DNA/RNA codons (inc. alt tables)."""
00898         self.translate_all_codons("ATUCGatucg")
        

Here is the call graph for this function:

transeq vs Bio.Seq for simple translations (including alt tables).

Definition at line 828 of file test_Emboss.py.

00828 
00829     def test_simple(self):
00830         """transeq vs Bio.Seq for simple translations (including alt tables)."""
00831 
00832         examples = [Seq("ACGTGACTGACGTAGCATGCCACTAGG"),
00833                     #Unamibguous TA? codons:
00834                     Seq("TAATACTATTAG", generic_dna),
00835                     #Most of the ambiguous TA? codons:
00836                     Seq("TANTARTAYTAMTAKTAHTABTADTAV", generic_dna),
00837                     #Problem cases,
00838                     #
00839                     #Seq("TAW", generic_dna),
00840                     #W = A or T, but EMBOSS does TAW -> X
00841                     #TAA -> Y, TAT ->Y, so in Biopython TAW -> Y
00842                     #
00843                     #Seq("TAS", generic_dna),
00844                     #S = C or G, but EMBOSS does TAS -> Y
00845                     #TAG -> *, TAC ->Y, so in Biopython TAS -> X (Y or *)
00846                     #
00847                     #Seq("AAS", generic_dna),
00848                     #On table 9, EMBOSS gives N, we give X.
00849                     #S = C or G, so according to my reading of
00850                     #table 9 on the NCBI page, AAC=N, AAG=K
00851                     #suggesting this is a bug in EMBOSS.
00852                     #
00853                     Seq("ACGGGGGGGGTAAGTGGTGTGTGTGTAGT", generic_dna),
00854                     ]
00855         
00856         for sequence in examples:
00857             #EMBOSS treats spare residues differently... avoid this issue
00858             if len(sequence) % 3 != 0:
00859                 sequence = sequence[:-(len(sequence)%3)]
00860             self.assertEqual(len(sequence) % 3, 0)
00861             self.assertTrue(len(sequence) > 0)
00862             self.check(sequence)

Here is the call graph for this function:

Definition at line 875 of file test_Emboss.py.

00875 
00876     def translate_all_codons(self, letters):
00877         sequence = Seq("".join([c1+c3+c3 \
00878                        for c1 in letters \
00879                        for c2 in letters \
00880                        for c3 in letters]),
00881                        generic_nucleotide)
00882         self.check(sequence)
        

Here is the call graph for this function:

Here is the caller graph for this function:


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