NAME
Bio::Seq::PrimaryQual - Bioperl lightweight Quality Object
SYNOPSIS
use Bio::Seq::PrimaryQual;# you can use either a space-delimited string for qualitymy $string_quals = "10 20 30 40 50 40 30 20 10";my $qualobj = Bio::Seq::PrimaryQual->new(-qual => $string_quals,-id => 'QualityFragment-12',-accession_number => 'X78121',);# _or_ you can use an array of quality valuesmy @q2 = split/ /,$string_quals;$qualobj = Bio::Seq::PrimaryQual->new(-qual => \@q2,-primary_id => 'chads primary_id',-desc => 'chads desc',-accession_number => 'chads accession_number',-id => 'chads id');# to get the quality values out:my @quals = @{$qualobj->qual()};# to give _new_ quality valuesmy $newqualstring = "50 90 1000 20 12 0 0";$qualobj->qual($newqualstring);
DESCRIPTION
This module provides a mechanism for storing quality values. Much more useful as part of Bio::Seq::Quality where these quality values are associated with the sequence information.
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 - Chad Matsalla
Email [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new()
Title : new()Usage : $qual = Bio::Seq::PrimaryQual->new(-qual => '10 20 30 40 50 50 20 10',-id => 'human_id',-accession_number => 'AL000012',);Function: Returns a new Bio::Seq::PrimaryQual object from basicconstructors, being a string _or_ a reference to an array for thesequence and strings for id and accession_number. Note that youcan provide an empty quality string.Returns : a new Bio::Seq::PrimaryQual object
qual()
Title : qual()Usage : @quality_values = @{$obj->qual()};Function: Get or set the quality as a reference to an array containing thequality values. An error is generated if the quality scores areinvalid, see validate_qual().Returns : A reference to an array.
seq()
Title : seq()Usager : $sequence = $obj->seq();Function : Returns the quality numbers as a space-separated string.Returns : Single string.Args : None.
validate_qual($qualstring)
Title : validate_qual($qualstring)Usage : print("Valid.") if { &validate_qual($self, $quality_string); }Function: Test that the given quality string is valid. It is expected tocontain space-delimited numbers that can be parsed using split /\d+/.However, this validation takes shortcuts and only tests that thestring contains characters valid in numbers: 0-9 . eE +-Note that empty quality strings are valid too.Returns : 1 for a valid sequence, 0 otherwiseArgs : - Scalar containing the quality string to validate.- Boolean to optionally throw an error if validation failed
subqual($start,$end)
Title : subqual($start,$end)Usage : @subset_of_quality_values = @{$obj->subqual(10,40)};Function: returns the quality values from $start to $end, where thefirst value is 1 and the number is inclusive, ie 1-2 are thefirst two bases of the sequence. Start cannot be larger thanend but can be equal.Returns : A reference to an array.Args : a start position and an end position
display_id()
Title : display_id()Usage : $id_string = $obj->display_id();Function: returns the display id, aka the common name of the Qualityobject.The semantics of this is that it is the most likely string to beused as an identifier of the quality sequence, and likely to have"human" readability. The id is equivalent to the ID field of theGenBank/EMBL databanks and the id field of the Swissprot/sptrembldatabase. In fasta format, the >(\S+) is presumed to be the id,though some people overload the id to embed other information.Bioperl does not use any embedded information in the ID field,and people are encouraged to use other mechanisms (accessionfield for example, or extending the sequence object) to solvethis. Notice that $seq->id() maps to this function, mainly forlegacy/convience issuesReturns : A stringArgs : None
header()
Title : header()Usage : $header = $obj->header();Function: Get/set the header that the user wants printed for thisquality object.Returns : A stringArgs : None
accession_number()
Title : accession_number()Usage : $unique_biological_key = $obj->accession_number();Function: Returns the unique biological id for a sequence, commonlycalled the accession_number. For sequences from establisheddatabases, the implementors should try to use the correctaccession number. Notice that primary_id() provides the unique idfor the implementation, allowing multiple objects to have the sameaccession number in a particular implementation. For sequenceswith no accession number, this method should return "unknown".Returns : A stringArgs : None
primary_id()
Title : primary_id()Usage : $unique_implementation_key = $obj->primary_id();Function: Returns the unique id for this object in this implementation.This allows implementations to manage their own object ids in away the implementation can control clients can expect one id tomap to one object. For sequences with no accession number, thismethod should return a stringified memory location.Returns : A stringArgs : None
desc()
Title : desc()Usage : $qual->desc($newval);$description = $qual->desc();Function: Get/set description text for a qual objectExample :Returns : Value of descArgs : newvalue (optional)
id()
Title : id()Usage : $id = $qual->id();Function: Return the ID of the quality. This should normally be (andactually is in the implementation provided here) just a synonymfor display_id().Returns : A string.Args : None.
length()
Title : length()Usage : $length = $qual->length();Function: Return the length of the array holding the quality values.Under most circumstances, this should match the number of qualityvalues but no validation is done when the PrimaryQual object isconstructed and non-digits could be put into this array. Is thisa bug? Just enough rope...Returns : A scalar (the number of elements in the quality array).Args : None.
qualat()
Title : qualatUsage : $quality = $obj->qualat(10);Function: Return the quality value at the given location, where thefirst value is 1 and the number is inclusive, ie 1-2 are the firsttwo bases of the sequence. Start cannot be larger than end but canbe equal.Returns : A scalar.Args : A position.
to_string()
Title : to_string()Usage : $quality = $obj->to_string();Function: Return a textual representation of what the object contains.For this module, this function will return:qualdisplay_idaccession_numberprimary_iddescidlengthReturns : A scalar.Args : None.