NAME
Bio::Seq::SeqWithQuality - Bioperl object packaging a sequence with its quality. Deprecated class, use Bio::Seq::Quality instead!
SYNOPSIS
use Bio::PrimarySeq;use Bio::Seq::PrimaryQual;use Bio::Seq::SeqWithQuality;# make from memorymy $qual = Bio::Seq::SeqWithQuality->new( -qual => '10 20 30 40 50 50 20 10',-seq => 'ATCGATCG',-id => 'human_id',-accession_number => 'AL000012',);# make from objects# first, make a PrimarySeq objectmy $seqobj = Bio::PrimarySeq->new( -seq => 'atcgatcg',-id => 'GeneFragment-12',-accession_number => 'X78121',-alphabet => 'dna');# now make a PrimaryQual objectmy $qualobj = Bio::Seq::PrimaryQual->new( -qual => '10 20 30 40 50 50 20 10',-id => 'GeneFragment-12',-accession_number => 'X78121',-alphabet => 'dna');# now make the SeqWithQuality objectmy $swqobj = Bio::Seq::SeqWithQuality->new( -seq => $seqobj,-qual => $qualobj);# done!$swqobj->id(); # the id of the SeqWithQuality object# may not match the the id of the sequence or# of the quality (check the pod, luke)$swqobj->seq(); # the sequence of the SeqWithQuality object$swqobj->qual(); # the quality of the SeqWithQuality object# to get out parts of the sequence.print "Sequence ", $seqobj->id(), " with accession ",$seqobj->accession, " and desc ", $seqobj->desc, "\n";$string2 = $seqobj->subseq(1,40);
DESCRIPTION
This object stores base quality values together with the sequence string.
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]
CONTRIBUTORS
Jason Stajich, [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::SeqWithQuality ->new( -qual => '10 20 30 40 50 50 20 10',-seq => 'ATCGATCG',-id => 'human_id',-accession_number => 'AL000012',-trace_indices => '0 5 10 15 20 25 30 35');Function: Returns a new Bio::Seq::SeqWithQual object from basicconstructors.Returns : a new Bio::Seq::PrimaryQual objectArgs : -qual can be a quality string (see Bio::Seq::PrimaryQual for moreinformation on this) or a reference to a Bio::Seq::PrimaryQualobject.-seq can be a sequence string (see Bio::PrimarySeq for moreinformation on this) or a reference to a Bio::PrimaryQual object.-seq, -id, -accession_number, -primary_id, -desc, -id behave likethis:1. if they are provided on construction of theBio::Seq::SeqWithQuality they will be set as the descriptors forthe object unless changed by one of the following mechanisms:a) $obj->set_common_descriptors() is used and both the -seq andthe -qual object have the same descriptors. These commondescriptors will then become the descriptors for theBio::Seq::SeqWithQual object.b) the descriptors are manually set using the seq(), id(),desc(), or accession_number(), primary_id(),2. if no descriptors are provided, the new() constructor will seeif the descriptor used in the PrimarySeq and in thePrimaryQual objects match. If they do, they will becomethe descriptors for the SeqWithQuality object.To eliminate ambiguity, I strongly suggest you set thedescriptors manually on construction of the object. Really.-trace_indices : a space_delimited list of trace indices(where would the peaks be drawn if this list of qualitieswas to be plotted?)
_common_id()
Title : _common_id()Usage : $common_id = $self->_common_id();Function: Compare the display_id of {qual_ref} and {seq_ref}.Returns : Nothing if they don't match. If they do return {seq_ref}->display_id()Args : None.
_common_display_id()
Title : _common_id()Usage : $common_id = $self->_common_display_id();Function: Compare the display_id of {qual_ref} and {seq_ref}.Returns : Nothing if they don't match. If they do return {seq_ref}->display_id()Args : None.
_common_accession_number()
Title : _common_accession_number()Usage : $common_id = $self->_common_accession_number();Function: Compare the accession_number() of {qual_ref} and {seq_ref}.Returns : Nothing if they don't match. If they do return {seq_ref}->accession_number()Args : None.
_common_primary_id()
Title : _common_primary_id()Usage : $common_primard_id = $self->_common_primary_id();Function: Compare the primary_id of {qual_ref} and {seq_ref}.Returns : Nothing if they don't match. If they do return {seq_ref}->primary_id()Args : None.
_common_desc()
Title : _common_desc()Usage : $common_desc = $self->_common_desc();Function: Compare the desc of {qual_ref} and {seq_ref}.Returns : Nothing if they don't match. If they do return {seq_ref}->desc()Args : None.
set_common_descriptors()
Title : set_common_descriptors()Usage : $self->set_common_descriptors();Function: Compare the descriptors (id,accession_number,display_id,primary_id, desc) for the PrimarySeq and PrimaryQual objectswithin the SeqWithQuality object. If they match, make thatdescriptor the descriptor for the SeqWithQuality object.Returns : Nothing.Args : None.
alphabet()
Title : alphabet();Usage : $molecule_type = $obj->alphabet();Function: Get the molecule type from the PrimarySeq object.Returns : What what PrimarySeq says the type of the sequence is.Args : None.
display_id()
Title : display_id()Usage : $id_string = $obj->display_id();Function: Returns the display id, aka the common name of the Quality object.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 issues.This method sets the display_id for the SeqWithQuality object.Returns : A stringArgs : If a scalar is provided, it is set as the new display_id forthe SeqWithQuality object.Status : Virtual
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".This method sets the accession_number for the SeqWithQualityobject.Returns : A string (the value of accession_number)Args : If a scalar is provided, it is set as the new accession_numberfor the SeqWithQuality object.Status : Virtual
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.This method sets the primary_id for the SeqWithQuality object.Returns : A string. (the value of primary_id)Args : If a scalar is provided, it is set as the new primary_id forthe SeqWithQuality object.
desc()
Title : desc()Usage : $qual->desc($newval); _or_$description = $qual->desc();Function: Get/set description text for this SeqWithQuality object.Returns : A string. (the value of desc)Args : If a scalar is provided, it is set as the new desc for theSeqWithQuality object.
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. (the value of id)Args : If a scalar is provided, it is set as the new id for theSeqWithQuality object.
seq
Title : seq()Usage : $string = $obj->seq(); _or_ $obj->seq("atctatcatca");Function: Returns the sequence that is contained in the imbedded in thePrimarySeq object within the SeqWithQuality objectReturns : A scalar (the seq() value for the imbedded PrimarySeq object.)Args : If a scalar is provided, the SeqWithQuality object willattempt to set that as the sequence for the imbedded PrimarySeqobject. Otherwise, the value of seq() for the PrimarySeq objectis returned.Notes : This is probably not a good idea because you then should calllength() to make sure that the sequence and quality are of thesame length. Even then, how can you make sure that this sequencebelongs with that quality? I provided this to give you rope tohang yourself with. Tie it to a strong device and use a goodknot.
qual()
Title : qual()Usage : @quality_values = @{$obj->qual()}; _or_$obj->qual("10 10 20 40 50");Function: Returns the quality as imbedded in the PrimaryQual objectwithin the SeqWithQuality object.Returns : A reference to an array containing the quality values in thePrimaryQual object.Args : If a scalar is provided, the SeqWithQuality object willattempt to set that as the quality for the imbedded PrimaryQualobject. Otherwise, the value of qual() for the PrimaryQualobject is returned.Notes : This is probably not a good idea because you then should calllength() to make sure that the sequence and quality are of thesame length. Even then, how can you make sure that this sequencebelongs with that quality? I provided this to give you a strongboard with which to flagellate yourself.
trace_indices()
Title : trace_indices()Usage : @trace_indice_values = @{$obj->trace_indices()}; _or_$obj->trace_indices("10 10 20 40 50");Function: Returns the trace_indices as imbedded in the Primaryqual objectwithin the SeqWithQualiity object.Returns : A reference to an array containing the trace_indice values in thePrimaryQual object.Args : If a scalar is provided, the SeqWithuQuality object willattempt to set that as the trace_indices for the imbedded PrimaryQualobject. Otherwise, the value of trace_indices() for the PrimaryQualobject is returned.Notes : This is probably not a good idea because you then should calllength() to make sure that the sequence and trace_indices are of thesame length. Even then, how can you make sure that this sequencebelongs with that trace_indicex? I provided this to give you a strongboard with which to flagellate yourself.
length()
Title : length()Usage : $length = $seqWqual->length();Function: Get the length of the SeqWithQuality sequence/quality.Returns : Returns the length of the sequence and quality if they areboth the same. Returns "DIFFERENT" if they differ.Args : None.
qual_obj
Title : qual_obj($different_obj)Usage : $qualobj = $seqWqual->qual_obj(); _or_$qualobj = $seqWqual->qual_obj($ref_to_primaryqual_obj);Function: Get the PrimaryQual object that is imbedded in theSeqWithQuality object or if a reference to a PrimaryQual objectis provided, set this as the PrimaryQual object imbedded in theSeqWithQuality object.Returns : A reference to a Bio::Seq::SeqWithQuality object.
seq_obj
Title : seq_obj()Usage : $seqobj = $seqWqual->qual_obj(); _or_$seqobj = $seqWqual->seq_obj($ref_to_primary_seq_obj);Function: Get the PrimarySeq object that is imbedded in theSeqWithQuality object or if a reference to a PrimarySeq object isprovided, set this as the PrimarySeq object imbedded in theSeqWithQuality object.Returns : A reference to a Bio::PrimarySeq object.
_set_descriptors
Title : _set_descriptors()Usage : $seqWqual->_qual_obj($qual,$seq,$id,$acc,$pid,$desc,$given_id,$alphabet);Function: Set the descriptors for the SeqWithQuality object. Try tomatch the descriptors in the PrimarySeq object and in thePrimaryQual object if descriptors were not provided withconstruction.Returns : Nothing.Args : $qual,$seq,$id,$acc,$pid,$desc,$given_id,$alphabet as foundin the new() method.Notes : Really only intended to be called by the new() method. Ifyou want to invoke a similar function try set_common_descriptors().
subseq($start,$end)
Title : subseq($start,$end)Usage : $subsequence = $obj->subseq($start,$end);Function: Returns the subseq from start to end, where the first baseis 1 and the number is inclusive, ie 1-2 are the first twobases of the sequence.Returns : A string.Args : Two positions.
baseat($position)
Title : baseat($position)Usage : $base_at_position_6 = $obj->baseat("6");Function: Returns a single base at the given position, where the firstbase is 1 and the number is inclusive, ie 1-2 are the first twobases of the sequence.Returns : A scalar.Args : A position.
subqual($start,$end)
Title : subqual($start,$end)Usage : @qualities = @{$obj->subqual(10,20);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
qualat($position)
Title : qualat($position)Usage : $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 thefirst two bases of the sequence. Start cannot be larger thanend but can be equal.Returns : A scalar.Args : A position.
sub_trace_index($start,$end)
Title : sub_trace_index($start,$end)Usage : @trace_indices = @{$obj->sub_trace_index(10,20);Function: returns the trace index 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 e_trace_index.Returns : A reference to an array.Args : a start position and an end position
trace_index_at($position)
Title : trace_index_at($position)Usage : $trace_index = $obj->trace_index_at(10);Function: Return the trace_index value at the given location, 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 etrace_index_.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:qualseqdisplay_idaccession_numberprimary_iddescidlength_sequencelength_qualityReturns : A scalar.Args : None.