[Bioperl-l] How to print encoded fastq quality string?
Chris Fields
cjfields at illinois.edu
Tue Jun 8 03:17:08 UTC 2010
Yes, this is the way to currently do it from the hash ref, but the actual key/value pairings there may change depending on a few things. I'm probably going to get something started up amongst the various Bio* to see if we can standardize generically parsing this data into somewhat standardized data structures, both for downstream use (creating objects) and other purposes. The current k/v pairs won't change until that happens, but if we manage to come up with some standard I assume we will change them accordingly.
chris
On Jun 7, 2010, at 9:59 PM, Smithies, Russell wrote:
> A bit hacky and there's probably a "proper" way to do it but this works:
>
>
> while (my $seq = $in->next_dataset()) {
> print %{$seq}->{'-id'},"\n";
> print %{$seq}->{'-raw_quality'},"\n";
> print %{$seq}->{'-seq'},"\n";
> print join ' ',@{ %{$seq}->{'-qual'}},"\n";
> }
>
>
>
>> -----Original Message-----
>> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
>> bounces at lists.open-bio.org] On Behalf Of Peng Yu
>> Sent: Tuesday, 8 June 2010 1:15 p.m.
>> To: bioperl-l at lists.open-bio.org
>> Subject: [Bioperl-l] How to print encoded fastq quality string?
>> (Bio::Seq::Quality)
>>
>> Hello All,
>>
>> I want to retrieve the original encoded quality string. But it seems
>> that Bio::Seq::Quality has already converted them into numerical
>> array. Is there a method that can help retrieve the original encoded
>> quality string such as
>> "ffffff`edfffeeff^ffefffeeeef`ffcf`deedaYcceecdcedaffffefaaYfc`ccc`TdaYT^L
>> Tb"?
>>
>> --
>> Regards,
>> Peng
>>
>> $ cat main.fastq
>> @HWI-EAS11X_10097:4:1:1909:9532#0/1
>> CGCGGGGATGACTCTAAGCATGGTGCAGGCGATAGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCT
>> C
>> +
>> ffffff`edfffeeff^ffefffeeeef`ffcf`deedaYcceecdcedaffffefaaYfc`ccc`TdaYT^LT
>> b
>> @HWI-EAS11X_10097:4:1:1948:6460#0/1
>> CATGGCTTACATGCTGAGTGCCAACATGGACCAGGGAGATCGGAAGATCGGTTCAGCAGGAATGCCGAGACCGA
>> T
>> +
>> dc^c^dddadLcccLc\^acaa^Yca^caYYcacc^YbJ^aTcaT`KKacY\LL\c^\YTTYLL\TL_T_BBBB
>> B
>> @HWI-EAS11X_10097:4:1:1986:2311#0/1
>> CTAGGCTTCCTCCCCTCCGTCAGGGCCACTCTCGAGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATA
>> T
>> +
>> effaYefffcffdfecefbeffdce^eLedd`e\YcaceeffcYeaeee\ddcT\\TaYTaddbYbbL^Y]LZL
>> ]
>> $ cat main.pl
>> #!/usr/bin/env perl
>>
>> use strict;
>> use warnings;
>> use Bio::SeqIO;
>>
>> my $in=Bio::SeqIO->new(-file => "main.fastq", -format => 'fastq-
>> illumina');
>>
>> while (my $seq = $in->next_seq()) {
>> print ref($seq), "\n";
>> print $seq->qual_text, "\n";
>> }
>> $ ./main.pl
>> Bio::Seq::Quality
>> 38 38 38 38 38 38 32 37 36 38 38 38 37 37 38 38 30 38 38 37 38 38 38
>> 37 37 37 37 38 32 38 38 35 38 32 36 37 37 36 33 25 35 35 37 37 35 36
>> 35 37 36 33 38 38 38 38 37 38 33 33 25 38 35 32 35 35 35 32 20 36 33
>> 25 20 30 12 20 34
>> Bio::Seq::Quality
>> 36 35 30 35 30 36 36 36 33 36 12 35 35 35 12 35 28 30 33 35 33 33 30
>> 25 35 33 30 35 33 25 25 35 33 35 35 30 25 34 10 30 33 20 35 33 20 32
>> 11 11 33 35 25 28 12 12 28 35 30 28 25 20 20 25 12 12 28 20 12 31 20
>> 31 2 2 2 2 2
>> Bio::Seq::Quality
>> 37 38 38 33 25 37 38 38 38 35 38 38 36 38 37 35 37 38 34 37 38 38 36
>> 35 37 30 37 12 37 36 36 32 37 28 25 35 33 35 37 37 38 38 35 25 37 33
>> 37 37 37 28 36 36 35 20 28 28 20 33 25 20 33 36 36 34 25 34 34 12 30
>> 25 29 12 26 12 29
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> =======================================================================
> Attention: The information contained in this message and/or attachments
> from AgResearch Limited is intended only for the persons or entities
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipients is prohibited by AgResearch
> Limited. If you have received this message in error, please notify the
> sender immediately.
> =======================================================================
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list