[Biopython-dev] [Biopython - Bug #3436] (New) Fix slicing of SFF objects

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Fri Jun 28 14:31:37 UTC 2013


Issue #3436 has been reported by Martin Mokrejš.

----------------------------------------
Bug #3436: Fix slicing of SFF objects
https://redmine.open-bio.org/issues/3436

Author: Martin Mokrejš
Status: New
Priority: Normal
Assignee: Peter Cock
Category: 
Target version: 
URL: 


I am chasing a deemed bug in biopython which happens during slicing. It seems it is related to some internal cross-checks and NOT to the slicing range itself. This is likely caused by quality trim points conflicting and thir check triggers during slicing whereas NOT during SFF input parsing. But I think this a valid use case. Maybe Peter will be faster then me in finding the answer what is going on.

<pre>
$ python
Python 2.7.3 (default, Apr 20 2013, 18:28:22) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio import SeqIO
>>> for _record in SeqIO.parse('/tmp/SRR088776_short_F95S1KP01DA6OU.sff', 'sff'):
...     print _record
... 
ID: F95S1KP01DA6OU
Name: F95S1KP01DA6OU
Number of features: 0
/flow_values=(95, 9, 110, 10, 30, 104, 15, 103, 1539, 33, 10, 20, 1501, 19, 8, 10, 1507, 22, 8, 8, 1482, 21, 8, 7, 1402, 22, 7, 11, 1394, 25, 10, 10, 1390, 27, 10, 12, 1333, 32, 14, 12, 1313, 59, 12, 14, 1258, 77, 13, 15, 1152, 91, 16, 16, 1144, 100, 14, 19, 1005, 107, 17, 20, 945, 109, 19, 20, 920, 113, 21, 21, 826, 113, 20, 25, 744, 105, 24, 25, 633, 110, 26, 26, 532, 103, 28, 30, 428, 103, 31, 33, 306, 106, 34, 37, 208, 106, 37, 39, 155, 113, 37, 46, 115, 103, 44, 57, 91, 113, 42, 57, 79, 111, 43, 67, 52, 103, 43, 78, 41, 102, 46, 82, 37, 102, 49, 91, 33, 103, 47, 104, 32, 100, 49, 98, 27, 111, 51, 109, 26, 113, 48, 114, 25, 116, 48, 120, 25, 111, 47, 119, 26, 100, 47, 109, 27, 90, 38, 112, 25, 85, 35, 105, 26, 74, 34, 102, 26, 78, 31, 90, 21, 67, 30, 78, 22, 49, 27, 67, 24, 45, 27, 62, 19, 46, 23, 48, 18, 41, 20, 45, 18, 37, 15, 44, 14, 33, 13, 39, 17, 32, 12, 34, 17, 27, 11, 24, 17, 26, 12, 20, 12, 26, 11, 17, 15, 22, 12, 15, 13, 20, 11, 18, 15, 20, 12, 16, 15, 22, 11, 14, 15, 16, 11, 13, 13, 18, 13, 11, 14, 17, 12, 13, 13, 17, 10, 12, 13, 15, 10, 12, 14, 15, 10, 13, 15, 15, 11, 14, 11, 14, 12, 11, 12, 15, 11, 10, 14, 12, 10, 10, 11, 18, 12, 9, 13, 14, 11, 10, 14, 13, 10, 13, 14, 14, 10, 13, 13, 15, 11, 9, 14, 17, 11, 13, 14, 18, 9, 15, 15, 16, 11, 11, 20, 16, 11, 14, 14, 14, 12, 14, 17, 16, 11, 12, 17, 14, 11, 11, 18, 15, 10, 11, 13, 14, 11, 12, 10, 19, 13, 10, 10, 16, 11, 10, 13, 14, 11, 12, 12, 12, 11, 13, 13, 14, 11, 15, 12, 16, 12, 15, 12, 14, 15, 11, 15, 15, 15, 9, 18, 14, 14, 12, 16, 13, 13, 13, 15, 13, 12, 12, 19, 15, 11, 12, 14, 15, 13, 11, 14, 14, 12, 12, 14, 16, 12, 13, 13, 17, 13, 11, 16, 15, 12, 12, 16, 16, 12, 12, 17, 13, 12, 11)
/flow_index=(1, 2, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 3, 0, 0, 0, 1, 3, 0, 0, 1, 3, 0, 1, 3, 0, 1, 3, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 4, 4, 4, 4, 4, 4, 4, 12, 76)
/flow_chars=TACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACG
/clip_adapter_right=0
/clip_qual_right=239
/clip_qual_left=248
/clip_adapter_left=4
/flow_key=TCAG
Per letter annotation for: phred_quality
Seq('tcagtttttttttttttttnttttttttttttttttttttttttttttttnttt...nnn', DNAAlphabet())
>>> _record[4:]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/Bio/SeqRecord.py", line 460, in __getitem__
    answer._per_letter_annotations[key] = value[index]
  File "/usr/lib64/python2.7/site-packages/Bio/SeqRecord.py", line 78, in __setitem__
    "strings) of length %i." % self._length)
TypeError: We only allow python sequences (lists, tuples or strings) of length 316.
>>> 
</pre>

Um, this was biopython 1.59. I just installed 1.61 but it is same:

    _new = record[lval:]
  File "/usr/lib64/python2.7/site-packages/Bio/SeqRecord.py", line 461, in __getitem__
    answer._per_letter_annotations[key] = value[index]
  File "/usr/lib64/python2.7/site-packages/Bio/SeqRecord.py", line 79, in __setitem__
    "strings) of length %i." % self._length)
TypeError: We only allow python sequences (lists, tuples or strings) of length 316.



----------------------------------------
You have received this notification because this email was added to the New Issue Alert plugin


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list