[Bioperl-l] Bio::Index::Fastq '@' in qual
p.j.a.cock at googlemail.com
Mon Oct 24 12:17:18 EDT 2011
On Mon, Oct 24, 2011 at 5:10 PM, Fields, Christopher J
<cjfields at illinois.edu> wrote:
> On Oct 24, 2011, at 10:10 AM, Peter Cock wrote:
>> On Mon, Oct 24, 2011 at 3:58 PM, Sofia Robb <sofia2341 at gmail.com> wrote:
>>> I am having problems running Bio::Index::Fastq. I get the following error
>>> when a quality line begins with '@'.
>>> Here is an example of a fastq record that is causing this error, The last
>>> line which starts with an '@' is actually the qual line.
>>> i see that chris has partially addressed this in the mailing list
>>> However as he pointed out at the time, it appears this may be a fairly large
>> Have you double checked you have the latest BioPerl with that
>> fix Chris mentioned?
> This should be fixed in both CPAN and bioperl-live. If not let me know.
>>> My fastq seq and qual lines are alway only one line, so I think that adding
>>> a line count and only checking for @ in the lines that $line_count%4 ==0
>>> would work since the header lines are always the first of 4 lines , 0,4,8,
>> Yes, *if* you can assume that for your data, which is an assumption I
>> wouldn't like to make a general purpose library like BioPerl (or Biopython)
> One could build in an optimization that takes this assumption into account
> when explicitly requested, something worth looking into. A lot of our short
> read pipelines use the 4-line format.
That's a sensible compromise.
>>> BioPerl fastq parsing issues aside, is there another tool which allows you
>>> to retrieve arbitrary sequences from a fastq file by sequence ID?
>>> There's one called cdbfasta which looks like it might work — does anyone
>>> have experience with it?
>>> P.S. I am CCing Peter Cock in case BioPython has solved this issue already —
>>> if so, perhaps their solution could be applied here.
>> If you want a Python solution, Biopython's Bio.SeqIO.index (in memory)
>> or Bio.SeqIO.index_db (using SQLite) functions will give you random
>> access by ID to assorted files including FASTQ, even with nasty line
>> wrapping and quality lines starting with @ or +.
>> The Biopython FASTQ indexer basically tracks the state: @ header, seq
>> line(s), + line, or qual line(s). You pay a slight performance hit when
>> building the index over assuming four lines per record, but it is robust
>> to this kind of nasty data.
> We should really look into a consistent OBDA-like indexing scheme
> that could work cross-Bio*. Or simply resuscitate OBDA. :)
Our SQLite index is based on OBDA but replacing the BDB / flat file
index with SQLite3. Also we're using the Biopython SeqIO format
names which don't 100% align with BioPerl/EMBOSS/etc.
More information about the Bioperl-l