NAME
FAST::Bio::Seq::SequenceTrace - Bioperl object packaging a sequence with its trace
SYNOPSIS
# example code here
DESCRIPTION
This object stores a sequence with its trace.
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.
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. 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://redmine.open-bio.org/projects/bioperl/
AUTHOR - Chad Matsalla
Email bioinformatics@dieselwurks.com
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new()
Title : new()
Usage : $st = FAST::Bio::Seq::SequenceTrace->new
( -swq => FAST::Bio::Seq::SequenceWithQuality,
-trace_a => \@trace_values_for_a_channel,
-trace_t => \@trace_values_for_t_channel,
-trace_g => \@trace_values_for_g_channel,
-trace_c => \@trace_values_for_c_channel,
-accuracy_a => \@a_accuracies,
-accuracy_t => \@t_accuracies,
-accuracy_g => \@g_accuracies,
-accuracy_c => \@c_accuracies,
-peak_indices => '0 5 10 15 20 25 30 35'
);
Function: Returns a new FAST::Bio::Seq::SequenceTrace object from basic
constructors.
Returns : a new FAST::Bio::Seq::SequenceTrace object
Arguments: I think that these are all describes in the usage above.
trace($base,\@new_values)
Title : trace($base,\@new_values)
Usage : @trace_Values = @{$obj->trace($base,\@new_values)};
Function: Returns the trace values as a reference to an array containing the
trace values. The individual elements of the trace array are not validated
and can be any numeric value.
Returns : A reference to an array.
Status :
Arguments: $base : which color channel would you like the trace values for?
- $base must be one of "A","T","G","C"
\@new_values : a reference to an array of values containing trace
data for this base
peak_indices($new_indices)
Title : peak_indices($new_indices)
Usage : $indices = $obj->peak_indices($new_indices);
Function: Return the trace index points for this object.
Returns : A scalar
Args : If used, the trace indices will be set to the provided value.
_reset_peak_indices()
Title : _rest_peak_indices()
Usage : $obj->_reset_peak_indices();
Function: Reset the peak indices.
Returns : Nothing.
Args : None.
Notes : When you create a sub_trace_object, the peak indices
will still be pointing to the apporpriate location _in the
original trace_. In order to fix this, the initial value must
be subtracted from each value here. ie. The first peak index
must be "1".
peak_index_at($position)
Title : peak_index_at($position)
Usage : $peak_index = $obj->peak_index_at($postition);
Function: Return the trace iindex point at this position
Returns : A scalar
Args : If used, the trace index at this position will be
set to the provided value.
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 be
used as an identifier of the quality sequence, and likely to have
"human" readability. The id is equivalent to the ID field of the
GenBank/EMBL databanks and the id field of the Swissprot/sptrembl
database. 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 (accession
field for example, or extending the sequence object) to solve
this. Notice that $seq->id() maps to this function, mainly for
legacy/convience issues.
This method sets the display_id for the Quality object.
Returns : A string
Args : If a scalar is provided, it is set as the new display_id for
the Quality object.
Status : Virtual
accession_number()
Title : accession_number()
Usage : $unique_biological_key = $obj->accession_number();
Function: Returns the unique biological id for a sequence, commonly
called the accession_number. For sequences from established
databases, the implementors should try to use the correct
accession number. Notice that primary_id() provides the unique id
for the implemetation, allowing multiple objects to have the same
accession number in a particular implementation. For sequences
with no accession number, this method should return "unknown".
This method sets the accession_number for the Quality
object.
Returns : A string (the value of accession_number)
Args : If a scalar is provided, it is set as the new accession_number
for the Quality 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 a
way the implementaiton can control clients can expect one id to
map to one object. For sequences with no accession number, this
method should return a stringified memory location.
This method sets the primary_id for the Quality
object.
Returns : A string. (the value of primary_id)
Args : If a scalar is provided, it is set as the new primary_id for
the Quality object.
desc()
Title : desc()
Usage : $qual->desc($newval); _or_
$description = $qual->desc();
Function: Get/set description text for this Quality object.
Returns : A string. (the value of desc)
Args : If a scalar is provided, it is set as the new desc for the
Quality object.
id()
Title : id()
Usage : $id = $qual->id();
Function: Return the ID of the quality. This should normally be (and
actually is in the implementation provided here) just a synonym
for display_id().
Returns : A string. (the value of id)
Args : If a scalar is provided, it is set as the new id for the
Quality object.
seq
Title : seq()
Usage : $string = $obj->seq(); _or_
$obj->seq("atctatcatca");
Function: Returns the sequence that is contained in the imbedded in the
PrimarySeq object within the Quality object
Returns : A scalar (the seq() value for the imbedded PrimarySeq object.)
Args : If a scalar is provided, the Quality object will
attempt to set that as the sequence for the imbedded PrimarySeq
object. Otherwise, the value of seq() for the PrimarySeq object
is returned.
Notes : This is probably not a good idea because you then should call
length() to make sure that the sequence and quality are of the
same length. Even then, how can you make sure that this sequence
belongs with that quality? I provided this to give you rope to
hang yourself with. Tie it to a strong device and use a good
knot.
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 object
within the Quality object.
Returns : A reference to an array containing the quality values in the
PrimaryQual object.
Args : If a scalar is provided, the Quality object will
attempt to set that as the quality for the imbedded PrimaryQual
object. Otherwise, the value of qual() for the PrimaryQual
object is returned.
Notes : This is probably not a good idea because you then should call
length() to make sure that the sequence and quality are of the
same length. Even then, how can you make sure that this sequence
belongs with that quality? I provided this to give you a strong
board with which to flagellate yourself.
length()
Title : length()
Usage : $length = $seqWqual->length();
Function: Get the length of the Quality sequence/quality.
Returns : Returns the length of the sequence and quality
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 Qualilty object that is imbedded in the
Quality object or if a reference to a PrimaryQual object
is provided, set this as the PrimaryQual object imbedded in the
Quality object.
Returns : A reference to a FAST::Bio::Seq::Quality object.
Identical to seq_obj.
seq_obj
Title : seq_obj()
Usage : $seqobj = $seqWqual->seq_obj(); _or_
$seqobj = $seqWqual->seq_obj($ref_to_primary_seq_obj);
Function: Get the PrimarySeq object that is imbedded in the
Quality object or if a reference to a PrimarySeq object is
provided, set this as the PrimarySeq object imbedded in the
Quality object.
Returns : A reference to a FAST::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 Quality object. Try to
match the descriptors in the PrimarySeq object and in the
PrimaryQual object if descriptors were not provided with
construction.
Returns : Nothing.
Args : $qual,$seq,$id,$acc,$pid,$desc,$given_id,$alphabet as found
in the new() method.
Notes : Really only intended to be called by the new() method. If
you 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 base
is 1 and the number is inclusive, ie 1-2 are the first two
bases 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 first
base is 1 and the number is inclusive, ie 1-2 are the first two
bases 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 the
first value is 1 and the number is inclusive, ie 1-2 are the
first two bases of the sequence. Start cannot be larger than
end 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 the
first value is 1 and the number is inclusive, ie 1-2 are the
first two bases of the sequence. Start cannot be larger than
end but can be equal.
Returns : A scalar.
Args : A position.
sub_peak_index($start,$end)
Title : sub_peak_index($start,$end)
Usage : @peak_indices = @{$obj->sub_peak_index(10,20);
Function: returns the trace index values from $start to $end, where the
first value is 1 and the number is inclusive, ie 1-2 are the
first two trace indices for this channel.
Returns : A reference to an array.
Args : a start position and an end position
sub_trace($start,$end)
Title : sub_trace($base_channel,$start,$end)
Usage : @trace_values = @{$obj->sub_trace('a',10,20)};
Function: returns the trace values from $start to $end, where the
first value is 1 and the number is inclusive, ie 1-2 are the
first two bases of the sequence. Start cannot be larger than
end but can be e_peak_index.
Returns : A reference to an array.
Args : a start position and an end position
trace_length()
Title : trace_length()
Usage : $trace_length = $obj->trace_length();
Function: Return the length of the trace if all four traces (atgc)
are the same. Otherwise, throw an error.
Returns : A scalar.
Args : none
sub_trace_object($start,$end)
Title : sub_trace_object($start,$end)
Usage : $smaller_object = $object->sub_trace_object('1','100');
Function: Get a subset of the sequence, its quality, and its trace.
Returns : A reference to a FAST::Bio::Seq::SequenceTrace object
Args : a start position and an end position
Notes :
- the start and end position refer to the positions of _bases_.
- for example, to get a sub SequenceTrace for bases 5-10,
use this routine.
- you will get the bases, qualities, and the trace values
- you can then use this object to synthesize a new scf
using seqIO::scf.
_synthesize_traces()
Title : _synthesize_traces()
Usage : $obj->_synthesize_traces();
Function: Synthesize false traces for this object.
Returns : Nothing.
Args : None.
Notes : This method is intended to be invoked when this
object is created with a SWQ object- that is to say that
there is a sequence and a set of qualities but there was
no actual trace data.
_dump_traces($transformed)
Title : _dump_traces("transformed")
Usage : &_dump_traces($ra,$rc,$rg,$rt);
Function: Used in debugging. Prints all traces one beside each other.
Returns : Nothing.
Args : References to the arrays containing the traces for A,C,G,T.
Notes : Beats using dumpValue, I'll tell ya. Much better then using
join' ' too.
- if a scalar is included as an argument (any scalar), this
procedure will dump the _delta'd trace. If you don't know what
that means you should not be using this.
_initialize_traces()
Title : _initialize_traces()
Usage : $trace_object->_initialize_traces();
Function: Creates empty arrays to hold synthetic trace values.
Returns : Nothing.
Args : None.
trace_value_at($channel,$position)
Title : trace_value_at($channel,$position)
Usage : $value = $trace_object->trace_value_at($channel,$position);
Function: What is the value of the trace for this base at this position?
Returns : A scalar represnting the trace value here.
Args : a base channel (a,t,g,c)
a position ( < $trace_object->trace_length() )
accuracies($channel,$position)
Title : trace_value_at($channel,$position)
Usage : $value = $trace_object->trace_value_at($channel,$position);
Function: What is the value of the trace for this base at this position?
Returns : A scalar representing the trace value here.
Args : a base channel (a,t,g,c)
a position ( < $trace_object->trace_length() )
set_accuracies()
Title : set_sccuracies()
Usage : $trace_object->set_accuracies();
Function: Take a sequence's quality and synthesize proper scf-style
base accuracies that can then be accessed with
accuracies("a") or something like it.
Returns : Nothing.
Args : None.
scf_dump()
Title : scf_dump()
Usage : $trace_object->scf_dump();
Function: Prints out the contents of the structures representing
the SequenceTrace in a manner similar to io_lib's scf_dump.
Returns : Nothing. Prints out the contents of the structures
used to represent the sequence and its trace.
Args : None.
Notes : Used in debugging, obviously.
_get_other_bases($this_base)
Title : _get_other_bases($this_base)
Usage : $other_bases = $trace_object->_get_other_bases($this_base);
Function: A utility routine to return bases other then the one provided.
I was doing this over and over so I put it here.
Returns : Three of a,t,g and c.
Args : A base (atgc)
Notes : $obj->_get_other_bases("a") returns "tgc"
accuracy_at($base,$position)
Title : accuracy_at($base,$position)
Usage : $accuracy = $trace_object->accuracy_at($base,$position);
Function:
Returns : Returns the accuracy of finding $base at $position.
Args : 1. a base channel (atgc) 2. a value to _set_ the accuracy
Notes : $obj->_get_other_bases("a") returns "tgc"