Bio::S...Quality(3pm)
π Bio::Seq::Quality π
okay so bestie, welcome to Bio::Seq::Quality β it's the implementation of a sequence that also carries its residue quality and trace values. it's giving β¨sequence with receiptsβ¨. no cap.
β¨ SYNOPSIS β¨
use Bio::Seq::Quality;
# input can be space delimited string or array ref
my $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 ref
my $traces = $seq->trace; # array ref
my $quals = $seq->qual_text; # string
my $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");
like, look at that. it's literally all there. π
πΈ DESCRIPTION πΈ
so this object stores base quality values right alongside the sequence string. two-for-one. iconic behaviour fr fr.
the implementation is based on Bio::Seq::Meta::Array. qual() and trace() are the base methods that store and retrieve the info, and they've got extensions to grab values as a scalar (like qual_text()), or to get/set subvalues (like subqual()). if you want the full tea, go read Bio::Seq::MetaI.
all the functional code actually lives in Bio::Seq::Meta::Array. that's where the real work happens, bestie.
there are some deprecated methods in here that got kept around for compatibility with Bio::Seq::SeqWithQuality. heads up though:
these will print a warning unless the verbosity of the object is set to be less than zero. so if you're getting spammed, that's why. π set -verbose => -1 and you're golden.
π 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. like genuinely, we eat it up. π
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π Support
please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. there are many experienced and reponsive experts who 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. give them the whole picture, not just the vibe. π
π 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
okay and there's more coming bestie, stay tuned π
π¦ APPENDIX π¦
The rest of this doc spills all the tea on every object method, bestie. Heads up: internal methods usually have an underscore _ out front, iykyk. π
β¨ new
- Title:
new - Usage:
$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::Qualityclass. Okay so bestie, note that you can totally provide empty quality and trace strings. π - Returns: a new
Bio::Seq::Qualityobject
π qual
- Title:
qual - Usage:
$qual_values = $obj->qual($values_string); - Function: Get and set method for the meta data starting from residue position one. Since it's dependent on the length of the sequence, it needs to be manipulated after the sequence, fr fr. The length of the returned value always matches the length of the sequence. π§¬
- Returns: reference to an array of meta data
- Args: new value, string or array ref or
Bio::Seq::PrimaryQual, optional
Not me reminding you: setting quality values resets the clear range. π
π¦ qual_text
- Title:
qual_text - Usage:
$qual_values = $obj->qual_text($values_arrayref); - Function: Variant of
meta()andqual()guarantied to return a string representation of meta data. For details, seemeta. - Returns: a string
- Args: new value, optional
πΈ subqual
- Title:
subqual - Usage:
$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-2 are the first two residue of the sequence. Start cannot be larger than end but can be equal, lowkey important. If the second argument is missing the returned values should extend to the end of the sequence. π«
- Returns: A reference to an array
- Args:
- integer, start position
- integer, end position, optional when a third argument present
- new value, optional
π subqual_text
- Title:
subqual_text - Usage:
$meta_values = $obj->subqual_text(20, $value_string); - Function: Variant of
subqual()returning a stringified representation of meta data. For details, seeBio::Seq::MetaI. - Returns: a string
- Args: new value, optional
β quality_length
- Title:
quality_length() - Usage:
$qual_len = $obj->quality_length(); - Function: return the number of elements in the quality array
- Returns: integer
- Args: -
π quality_is_flush
- Title:
quality_is_flush - Usage:
$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 0
- Args: none
π trace
- Title:
trace - Usage:
$trace_values = $obj->trace($values_string); - Function: Get and set method for the meta data starting from residue position one. Since it's dependent on the length of the sequence, it needs to be manipulated after the sequence. The length of the returned value always matches the length of the sequence. π
- Returns: reference to an array of meta data
- Args: new value, string or array ref, optional
π trace_text
- Title:
trace_text - Usage:
$trace_values = $obj->trace_text($values_arrayref); - Function: Variant of
meta()andtrace()guarantied to return a string representation of meta data. For details, seemeta. - Returns: a string
- Args: new value, optional
π«Ά subtrace
- Title:
subtrace - Usage:
$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-2 are the first two residue of the sequence. Start cannot be larger than end but can be equal. If the second argument is missing the returned values should extend to the end of the sequence. π
- Returns: A reference to an array
- Args:
- integer, start position
- integer, end position, optional when a third argument present
- new value, optional
π¦ subtrace_text
- Title:
subtrace_text - Usage:
$meta_values = $obj->subtrace_text(20, $value_string); - Function: Variant of
subtrace()returning a stringified representation of meta data. For details, seeBio::Seq::MetaI. - Returns: a string
- Args: new value, optional
β¨ trace_length
- Title:
trace_length() - Usage:
$trace_len = $obj->trace_length(); - Function: return the number of elements in the trace set
- Returns: integer
- Args: -
π trace_is_flush
- Title:
trace_is_flush - Usage:
$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 0
- Args: none
π₯ get_trace_graph
- Title:
get_trace_graph - Usage:
@trace_values = $obj->get_trace_graph( -trace => 'a',
-scale => 100)
- Function: Returns array of raw trace values for a trace file, or false if no trace data exists. Requires a value for trace to get either the a, g, c or t trace information, and an optional value for scale, which rescales the data between 0 and the provided value, a scale value of '0' performs no scaling. π
- Returns: Array or 0
- Args: string, trace to retrieve, one of a, g, c or t integer, scale, for scaling of trace between 0 and scale, or 0 for no scaling, optional
π threshold
- Title:
threshold - Usage:
$qual->threshold($value); - Function: Sets the quality threshold.
- Returns: an integer
- Args: new value, optional
Value used by clear_range method below. π
πΈ mask_below_threshold
- Title:
mask_below_threshold - Usage:
$count = $obj->count_clear_ranges($threshold); - Function: Counts number of ranges in the sequence where quality values are above the threshold
- Returns: count integer
- Args: threshold integer, optional
Set threshold first using method threshold. Don't skip this step bestie, fr fr. π«Ά
π count_clear_ranges
- Title:
count_clear_ranges - Usage:
$count = $obj->count_clear_ranges($threshold); - Function: Counts number of ranges in the sequence where quality values are above the threshold
- Returns: count integer
- Args: threshold integer, optional
Set threshold first using method threshold. π
π clear_ranges_length
- Title:
clear_ranges_length - Usage:
$total_lenght = $obj->clear_ranges_length($threshold); - Function: Return number of residues with quality values above the threshold in all clear ranges
- Returns: an integer
- Args: threshold, optional
Set threshold first using method threshold.
And, quoting the original vibes: "I think this method needs a better name! count_high_quality_bases? or sum_clear_ranges?" β the author said it, not me. π
β get_clear_range
- Title:
get_clear_range - Usage:
$newqualobj = $obj->get_clear_range($threshold); - Function: Return longest subsequence that has quality values above the given threshold, or a default value of 13
- Returns: a new
Bio::Seq::Qualityobject - Args: 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_ranges - Usage:
@ranges = $obj->get_all_clean_ranges($minlength); - Function: Return all ranges where quality values are above the threshold. Original ordering.
- Returns: an ordered array of new
Bio::Seq::Qualityobjects - Args: minimum length , optional
Set threshold first using method threshold.
And that's the whole page, bestie!! π You made it all the way through β iconic behaviour, no cap.
This lil tour was brought to you by perl v5.32.1, dated 2021-08-15, living under the name Bio::S...Quality(3pm). Go forth and slay your quality scores π
β¨π¦
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms