[Biopython-dev] [Biopython - Bug #3437] (New) SeqIO.write(): Do not write broken data for empty objects

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Fri Jun 28 14:49:38 UTC 2013


Issue #3437 has been reported by Martin Mokrejš.

----------------------------------------
Bug #3437: SeqIO.write(): Do not write broken data for empty objects
https://redmine.open-bio.org/issues/3437

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


While slicing SFF objects I tripped several times in the past across the case when left trim point is defined whereas right trim point is not. Doing a slice like

_record[_lval:_rval] not surprisingly results in an empty object (e.g. _record[4:0]).

I think "SFF object" could be smart enough and do just [4:] on my behalf. Alternatively, I would prefer a Warning message. While you might disagree with both proposals above, you might change your view if you think about writing sliced objects into an outfile, for example in fastq or fasta or qual. These objects with empty sequence are written into the files but of course, only the FASTA/FASTQ header line is written and nothing for the sequence or qualities itself. So, the output FASTA or QUAL or FASTQ is actually broken. So must do something about this anyway. And users tend to forget so at leats I am likely to trip into this again after a few months. ;-)



To recapitulate what I propose:

First, I would just replace [4:0] with [4:] in the example mentioned.

Second, SeqIO.write() must definitely check for non-zero length of object's sequence.

This was on biopython-1.59 but happens also on 1.61.


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