[Biopython-dev] [Bug 2639] SeqRecord.init doesn't check for arguments to their types

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Nov 6 11:14:07 UTC 2008


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





------- Comment #3 from dalloliogm at gmail.com  2008-11-06 06:14 EST -------
Created an attachment (id=1041)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1041&action=view)
add a check for the seq argument in seqrecord, to be a Seq object and not None

This patch adds a check for the seq argument in SeqRecord.
If seq is None (by default), it raises a ValueError Exception.
If it is a Seq objects, it saves it as self.seq.
If it is another kind of object (string, list, integer), it is converted to a
string, and then used to instantiate a seq object.
I thought that someone could use an integer (e.g.: 010100010101101) as a
sequence, and in this case, the integer is first converted to a string
(otherwise Seq() would return an error).

Please, take care with this patch: I have messed a bit with cvs and patches :(,
so, this patch contains also a doctest example that I have added for my self
(see bug report 2640).


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