[Biopython-dev] [Bug 2437] New: comparing alphabet references causes assert to fail when it should pass

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Jan 28 19:12:33 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2437

           Summary: comparing alphabet references causes assert to fail when
                    it should pass
           Product: Biopython
           Version: 1.44
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: rjalves at igc.gulbenkian.pt


/var/lib/python-support/python2.4/Bio/Translate.py in translate_to_stop(self,
seq)
    34     def translate_to_stop(self, seq):
    35         # This doesn't have a stop encoding
---> 36         assert seq.alphabet == self.table.nucleotide_alphabet, \
    37                "cannot translate from given alphabet (have %s, need %s)"
%\
    38                (seq.alphabet, self.table.nucleotide_alphabet)

AssertionError: cannot translate from given alphabet (have IUPACAmbiguousDNA(),
need IUPACAmbiguousDNA())


What I did:

from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA
from Bio import Translate
from Bio import Seq

a=Seq.Seq("ATCGGATGA...ATGCAGT",alphabet=IUPACAmbiguousDNA())
b=Translate.ambiguous_dna_by_id[11]

b.translate_to_stop(a) ... error pops out

The only way around I was able to find is:

b.table.nucleotide_alphabet=a.alphabet


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list