NAME
Bio::Seq::Quality - Implementation of sequence with residue quality
and trace values
SYNOPSIS
use Bio::Seq::Quality;# input can be space delimited string or array refmy $qual = '0 1 2 3 4 5 6 7 8 9 11 12';my $trace = '0 5 10 15 20 25 30 35 40 45 50 55';my $seq = Bio::Seq::Quality->new( -qual => $qual,-trace_indices => $trace,-seq => 'atcgatcgatcg',-id => 'human_id',-accession_number => 'S000012',-verbose => -1 # to silence deprecated methods);my $quals = $seq->qual; # array refmy $traces = $seq->trace; # array refmy $quals = $seq->qual_text; # stringmy $traces = $seq->trace_text; # string# get sub values$quals = $seq->subqual(2, 3); # array ref$traces = $seq->subtrace(2, 3); # array ref$quals = $seq->subqual_text(2, 3); # string$quals = $seq->subtrace_text(2, 3); # string# set sub values$seq->subqual(2, 3, "9 9");$seq->subtrace(2, 3, "9 9");
DESCRIPTION
This object stores base quality values together with the sequence string.
The implementation is based on Bio::Seq::Meta::Array. qual() and trace() are base methods to store and retrieve information that have extensions to retrieve values as a scalar (e.g. qual_text() ), or get or set subvalues (e.g. subqual() ). See Bio::Seq::MetaI for more details.
All the functional code is in Bio::Seq::Meta::Array.
There deprecated methods that are included for compatibility with Bio::Seq::SeqWithQuality. These will print a warning unless verbosity of the object is set to be less than zero.
SEE ALSO
Bio::Seq::MetaI, Bio::Seq::Meta::Array
FEEDBACK
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
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.
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:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Heikki Lehvaslaiho
Email heikki-at-bioperl-dot-org
CONTRIBUTORS
Chad Matsalla, bioinformatics at dieselwurks dot com
Dan Bolser, dan dot bolser at gmail dot com
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : $metaseq = Bio::Seq::Quality->new( -qual => '0 1 2 3 4 5 6 7 8 9 11 12',-trace => '0 5 10 15 20 25 30 35 40 45 50 55',-seq => 'atcgatcgatcg',-id => 'human_id',-accession_number => 'S000012',);Function: Constructor for Bio::Seq::Quality class. Note that you canprovide an empty quality and trace strings.Returns : a new Bio::Seq::Quality object
qual
Title : qualUsage : $qual_values = $obj->qual($values_string);Function:Get and set method for the meta data starting from residueposition one. Since it is dependent on the length of thesequence, it needs to be manipulated after the sequence.The length of the returned value always matches the lengthof the sequence.Returns : reference to an array of meta dataArgs : new value, string or array ref or Bio::Seq::PrimaryQual, optional
Setting quality values resets the clear range.
qual_text
Title : qual_textUsage : $qual_values = $obj->qual_text($values_arrayref);Function: Variant of meta() and qual() guarantied to return a stringrepresentation of meta data. For details, see L<meta>.Returns : a stringArgs : new value, optional
subqual
Title : subqualUsage : $subset_of_qual_values = $obj->subqual(10, 20, $value_string);$subset_of_qual_values = $obj->subqual(10, undef, $value_string);Function:Get and set method for meta data for subsequences.Numbering starts from 1 and the number is inclusive, ie 1-2are the first two residue of the sequence. Start cannot belarger than end but can be equal.If the second argument is missing the returned valuesshould extend to the end of the sequence.Returns : A reference to an arrayArgs : integer, start positioninteger, end position, optional when a third argument presentnew value, optional
subqual_text
Title : subqual_textUsage : $meta_values = $obj->subqual_text(20, $value_string);Function: Variant of subqual() returning a stringifiedrepresentation of meta data. For details, see L<Bio::Seq::MetaI>.Returns : a stringArgs : new value, optional
quality_length
Title : quality_length()Usage : $qual_len = $obj->quality_length();Function: return the number of elements in the quality arrayReturns : integerArgs : -
quality_is_flush
Title : quality_is_flushUsage : $quality_is_flush = $obj->quality_is_flush()Function: Boolean to tell if the trace length equals the sequence length.Returns true if force_flush() is set.Returns : boolean 1 or 0Args : none
trace
Title : traceUsage : $trace_values = $obj->trace($values_string);Function:Get and set method for the meta data starting from residueposition one. Since it is dependent on the length of thesequence, it needs to be manipulated after the sequence.The length of the returned value always matches the lengthof the sequence.Returns : reference to an array of meta dataArgs : new value, string or array ref, optional
trace_text
Title : trace_textUsage : $trace_values = $obj->trace_text($values_arrayref);Function: Variant of meta() and trace() guarantied to return a stringrepresentation of meta data. For details, see L<meta>.Returns : a stringArgs : new value, optional
subtrace
Title : subtraceUsage : $subset_of_trace_values = $obj->subtrace(10, 20, $value_string);$subset_of_trace_values = $obj->subtrace(10, undef, $value_string);Function:Get and set method for meta data for subsequences.Numbering starts from 1 and the number is inclusive, ie 1-2are the first two residue of the sequence. Start cannot belarger than end but can be equal.If the second argument is missing the returned valuesshould extend to the end of the sequence.Returns : A reference to an arrayArgs : integer, start positioninteger, end position, optional when a third argument presentnew value, optional
subtrace_text
Title : subtrace_textUsage : $meta_values = $obj->subtrace_text(20, $value_string);Function: Variant of subtrace() returning a stringifiedrepresentation of meta data. For details, see L<Bio::Seq::MetaI>.Returns : a stringArgs : new value, optional
trace_length
Title : trace_length()Usage : $trace_len = $obj->trace_length();Function: return the number of elements in the trace setReturns : integerArgs : -
trace_is_flush
Title : trace_is_flushUsage : $trace_is_flush = $obj->trace_is_flush()Function: Boolean to tell if the trace length equals the sequence length.Returns true if force_flush() is set.Returns : boolean 1 or 0Args : none
get_trace_graph
Title : get_trace_graphUsage : @trace_values = $obj->get_trace_graph( -trace => 'a',-scale => 100)Function : Returns array of raw trace values for a trace file, orfalse if no trace data exists. Requires a value for traceto get either the a, g, c or t trace information, and anoptional value for scale, which rescales the data between0 and the provided value, a scale value of '0' performs noscalingReturns : Array or 0Args : string, trace to retrieve, one of a, g, c or t integer,scale, for scaling of trace between 0 and scale, or 0 forno scaling, optional
threshold
Title : thresholdUsage : $qual->threshold($value);Function: Sets the quality threshold.Returns : an integerArgs : new value, optional
Value used by *clear_range* method below.
mask_below_threshold
Title : mask_below_thresholdUsage : $count = $obj->count_clear_ranges($threshold);Function: Counts number of ranges in the sequence where qualityvalues are above the thresholdReturns : count integerArgs : threshold integer, optional
Set threshold first using method threshold.
count_clear_ranges
Title : count_clear_rangesUsage : $count = $obj->count_clear_ranges($threshold);Function: Counts number of ranges in the sequence where qualityvalues are above the thresholdReturns : count integerArgs : threshold integer, optional
Set threshold first using method threshold.
clear_ranges_length
Title : clear_ranges_lengthUsage : $total_lenght = $obj->clear_ranges_length($threshold);Function: Return number of residues with quality values abovethe threshold in all clear rangesReturns : an integerArgs : threshold, optional
Set threshold first using method threshold.
I think this method needs a better name! count_high_quality_bases? or sum_clear_ranges?
get_clear_range
Title : get_clear_rangeUsage : $newqualobj = $obj->get_clear_range($threshold);Function: Return longest subsequence that has quality values abovethe given threshold, or a default value of 13Returns : a new Bio::Seq::Quality objectArgs : threshold, optional
Set threshold first using method threshold.
Note, this method could be implemented using some gaussian smoothing of the quality scores. Currently one base below the threshold is enough to end the clear range.
get_all_clean_ranges
Title : get_all_clean_rangesUsage : @ranges = $obj->get_all_clean_ranges($minlength);Function: Return all ranges where quality values are abovethe threshold. Original ordering.Returns : an ordered array of new Bio::Seq::Quality objectsArgs : minimum length , optional
Set threshold first using method threshold.