.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::SeqIO::fastq 3pm" .TH Bio::SeqIO::fastq 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::SeqIO::fastq \- fastq sequence input/output stream .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& ################## pertains to FASTQ parsing only ################## \& \& # grabs the FASTQ parser, specifies the Illumina variant \& my $in = Bio::SeqIO\->new(\-format => \*(Aqfastq\-illumina\*(Aq, \& \-file => \*(Aqmydata.fq\*(Aq); \& \& # simple \*(Aqfastq\*(Aq format defaults to \*(Aqsanger\*(Aq variant \& my $out = Bio::SeqIO\->new(\-format => \*(Aqfastq\*(Aq, \& \-file => \*(Aq>mydata.fq\*(Aq); \& \& # $seq is a Bio::Seq::Quality object \& while (my $seq = $in\->next_seq) { \& $out\->write_seq($seq); # convert Illumina 1.3 to Sanger format \& } \& \& # for 4x faster parsing, one can do something like this for raw data \& use Bio::Seq::Quality; \& \& # $data is a hash reference containing all arguments to be passed to \& # the Bio::Seq::Quality constructor \& while (my $data = $in\->next_dataset) { \& # process $data, such as trim, etc \& my $seq = Bio::Seq::Quality\->new(%$data); \& \& # for now, write_seq only accepts Bio::Seq::Quality, but may be modified \& # to allow raw hash references for speed \& $out\->write_seq($data); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object can transform Bio::Seq and Bio::Seq::Quality objects to and from \&\s-1FASTQ\s0 flat file databases. .PP \&\s-1FASTQ\s0 is a file format used frequently at the Sanger Centre and in next-gen sequencing to bundle a \s-1FASTA\s0 sequence and its quality data. A typical \s-1FASTQ\s0 entry takes the form: .PP .Vb 4 \& @HCDPQ1D0501 \& GATTTGGGGTTCAAAGCAGTATCGATCAAATAGTAAATCCATTTGTTCAACTCACAGTTT..... \& +HCDPQ1D0501 \& !\*(Aq\*(Aq*((((***+))%%%++)(%%%%).1***\-+*\*(Aq\*(Aq))**55CCF>>>>>>CCCCCCC65..... .Ve .PP where: .PP .Vb 3 \& @ = descriptor, followed by one or more sequence lines \& + = optional descriptor (if present, must match first one), followed by one or \& more qual lines .Ve .PP When writing \s-1FASTQ\s0 output the redundant descriptor following the '+' is by default left off to save disk space. If needed, one can set the \fBquality_header()\fR flag in order for this to be printed. .SS "\s-1FASTQ\s0 and Bio::Seq::Quality mapping" .IX Subsection "FASTQ and Bio::Seq::Quality mapping" \&\s-1FASTQ\s0 files have sequence and quality data on single line or multiple lines, and the quality values are single-byte encoded. Data are mapped very simply to Bio::Seq::Quality instances: .PP .Vb 7 \& Data Bio::Seq::Quality method \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& first non\-whitespace chars in descriptor id^ \& descriptor line desc^ \& sequence lines seq \& quality qual* \& FASTQ variant namespace \& \& ^ first nonwhitespace chars are id(), everything else after (to end of line) \& is in desc() \& * Converted to PHRED quality scores where applicable (\*(Aqsolexa\*(Aq) .Ve .SS "\s-1FASTQ\s0 variants" .IX Subsection "FASTQ variants" This parser supports all variants of \s-1FASTQ,\s0 including Illumina v 1.0 and 1.3: .PP .Vb 5 \& variant note \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& sanger original \& solexa Solexa, Inc. (2004), aka Illumina 1.0 \& illumina Illumina 1.3 .Ve .PP The variant can be specified by passing by either passing the additional \&\-variant parameter to the constructor: .PP .Vb 3 \& my $in = Bio::SeqIO\->new(\-format => \*(Aqfastq\*(Aq, \& \-variant => \*(Aqsolexa\*(Aq, \& \-file => \*(Aqmysol.fq\*(Aq); .Ve .PP or by passing the format and variant together (Bio::SeqIO will now handle this and convert it accordingly to the proper argument): .PP .Vb 2 \& my $in = Bio::SeqIO\->new(\-format => \*(Aqfastq\-solexa\*(Aq, \& \-file => \*(Aqmysol.fq\*(Aq); .Ve .PP Variants can be converted back and forth from one another; however, due to the difference in scaling for solexa quality reads, converting from 'illumina' or 'sanger' \s-1FASTQ\s0 to solexa is not recommended. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHORS \- Chris Fields (taken over from Tony Cox)" .IX Header "AUTHORS - Chris Fields (taken over from Tony Cox)" Email: cjfields at bioperl dot org .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SH "Bio::SeqIO interface methods" .IX Header "Bio::SeqIO interface methods" .SS "next_seq" .IX Subsection "next_seq" .Vb 6 \& Title : next_seq \& Usage : $seq = $stream\->next_seq() \& Function : returns the next sequence in the stream \& Returns : Bio::Seq::Quality object \& Args : NONE \& Status : Stable .Ve .SS "write_seq" .IX Subsection "write_seq" .Vb 8 \& Title : write_seq \& Usage : $stream\->write_seq(@seq) \& Function : writes the $seq object into the stream \& Returns : 1 for success and 0 for error \& Args : Bio::Seq::Quality \& Note : This now conforms to SeqIO spec (module output is same format as \& next_seq) \& Status : Stable .Ve .SS "variant" .IX Subsection "variant" .Vb 5 \& Title : variant \& Usage : $format = $obj\->variant(); \& Function: Get and set method for the quality sequence variant. This is \& important for indicating the encoding/decoding to be used for \& quality data. \& \& Current values accepted are: \& \*(Aqsanger\*(Aq (original FASTQ) \& ASCII encoding from 33\-126, PHRED quality score from 0 to 93 \& \*(Aqsolexa\*(Aq (aka illumina1.0) \& ASCII encoding from 59\-104, SOLEXA quality score from \-5 to 40 \& \*(Aqillumina\*(Aq (aka illumina1.3) \& ASCII encoding from 64\-104, PHRED quality score from 0 to 40 \& \& (Derived from the MAQ website): \& For \*(Aqsolexa\*(Aq, scores are converted to PHRED qual scores using: \& $Q = 10 * log(1 + 10 ** (ord($sq) \- 64) / 10.0)) / log(10) \& \& \& Returns : string \& Args : new value, string .Ve .SH "Plugin-specific methods" .IX Header "Plugin-specific methods" .SS "next_dataset" .IX Subsection "next_dataset" .Vb 6 \& Title : next_dataset \& Usage : $obj\->next_dataset \& Function : returns a hash reference containing the parsed data \& Returns : hash reference \& Args : none \& Status : Stable .Ve .SS "write_fastq" .IX Subsection "write_fastq" .Vb 6 \& Title : write_fastq \& Usage : $stream\->write_fastq(@seq) \& Function: writes the $seq object into the stream \& Returns : 1 for success and 0 for error \& Args : Bio::Seq::Quality object \& Status : Deprecated (delegates to write_seq) .Ve .SS "write_fasta" .IX Subsection "write_fasta" .Vb 9 \& Title : write_fasta \& Usage : $stream\->write_fasta(@seq) \& Function: writes the $seq object into the stream \& Returns : 1 for success and 0 for error \& Args : Bio::Seq object \& Note : This method does not currently delegate to Bio::SeqIO::fasta \& (maybe it should?). Not sure whether we should keep this as a \& convenience method. \& Status : Unstable .Ve .SS "write_qual" .IX Subsection "write_qual" .Vb 9 \& Title : write_qual \& Usage : $stream\->write_qual(@seq) \& Function: writes the $seq object into the stream \& Returns : 1 for success and 0 for error \& Args : Bio::Seq::Quality object \& Note : This method does not currently delegate to Bio::SeqIO::qual \& (maybe it should?). Not sure whether we should keep this as a \& convenience method. \& Status : Unstable .Ve .SS "validate" .IX Subsection "validate" .Vb 6 \& Title : validate \& Usage : $obj\->validate(0) \& Function : flag for format/qual range validation \- default is 1, validate \& Returns : Bool (0/1) \& Args : Bool (0/1) \& Status : Stable (may be moved to interface) .Ve .SS "quality_header" .IX Subsection "quality_header" .Vb 6 \& Title : quality_header \& Usage : $obj\->quality_header \& Function : flag for printing quality header \- default is 0, no header \& Returns : Bool (0/1) \& Args : Bool (0/1) \& Status : Unstable (name may change dep. on feedback) .Ve