[Biopython-dev] [Bug 2323] New functions: GCG Checksum and CRC64

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Jul 13 07:08:07 EDT 2007


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


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |biopython-
                   |                            |bugzilla at maubp.freeserve.co.
                   |                            |uk
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Comment #22 from biopython-bugzilla at maubp.freeserve.co.uk  2007-07-13 07:08 EST -------
I've started to write a test case for the code now in Bio/SeqUtils/CheckSum.py
and noticed that while crc64, gcg and seguid will cope with both strings and
Seq objects, crc32 will only cope with strings.

Any objections to me fixing this like so:

Old:

from binascii import crc32

New:

from binascii import crc32 as _crc32

def crc32(seq) :
    """Returns the crc32 checksum for a sequence (string or Seq object)"""
    try :
        #Assume its a Seq object
        return _crc32(seq.tostring())
    except AttributeError :
        #Assume its a string
        return _crc32(seq)

--
Peter


-- 
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