Bio::S...ceTrace(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Bio::S...ceTrace(3pm) β€” User Contributed Perl Documentation πŸ’–

okay bestie, gather round, because this one is Bio::Seq::SequenceTrace and it's lowkey iconic. it's a Bioperl object that packages a sequence together with its trace. that's the whole vibe. let's get into it 🧚✨


✨ NAME ✨

Bio::Seq::SequenceTrace β€” a Bioperl object packaging a sequence with its trace. periodt.


🌸 SYNOPSIS 🌸

# example code here

yeah, that's literally it. the example is just a placeholder comment. no cap. moving on πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This object stores a sequence with its trace. that's the whole thing, she's simple, she's focused, she contains multitudes (a sequence + a trace) 🫢


πŸ’Œ FEEDBACK πŸ’Œ

πŸ“¬ Mailing Lists

User feedback is, like, integral to the evolution of this and every other Bioperl module β€” no notes, it's true. so send your comments and suggestions preferably to one of the Bioperl mailing lists. your participation is much appreciated, fr fr πŸ₯Ή

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. like, pls don't DM the maintainer, bestie. there are so many experienced and reponsive experts who will be able to 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 β€” receipts matter.

πŸ› Reporting Bugs

Report bugs to the Bioperl bug tracking system, so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ 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 _ (iykyk, that underscore is the secret handshake 🀫).


🌟 new()

  • Title: new()
  • Usage:
$st = Bio::Seq::SequenceTrace->new
    (    -swq =>   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 Bio::Seq::SequenceTrace object from basic constructors.
  • Returns: a new Bio::Seq::SequenceTrace object
  • Arguments: I think that these are all describes in the usage above. (that's the author talking, not me, bestie 😭)

🌈 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: (blank β€” yeah, there's nothing here, leave it)
  • 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() (yes that says "rest", it's in the original, we don't touch it πŸ’€)
  • 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 appropriate 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 index 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: Whatever the 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 implementation, 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 implementation 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. πŸ’€ (that's a warning, bestie, not a suggestion)

πŸŽ€ 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. 🫠 (again β€” warning, not a to-do list)

πŸ“ 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 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 Bio::PrimarySeq object.

okay bestie, buckle up β€” here come the methods, and there are a lot of them, so hydrate πŸ’§ and let's go.


πŸŽ€ _set_descriptors

  • Title β€” _set_descriptors()
  • Usage β€”
$seqWqual->_qual_obj($qual,$seq,$id,$acc,$pid,$desc,$given_id,
   $alphabet);
  • Function β€” sets the descriptors for the Quality object. It tries to match up the descriptors that live in the PrimarySeq object and in the PrimaryQual object, but only if nobody handed over descriptors at construction time.
  • Returns β€” Nothing. Nada. Zero. πŸ’€
  • Args β€” $qual,$seq,$id,$acc,$pid,$desc,$given_id,$alphabet exactly as they show up in the new() method.
  • Notes β€” this one is really only meant to be called by new(). If you wanna invoke something similar yourself, go use set_common_descriptors() instead, okay? iykyk.

🌸 subseq($start,$end)

  • Title β€” subseq($start,$end)
  • Usage β€” $subsequence = $obj->subseq($start,$end);
  • Function β€” hands you the subseq from start to end, where the first base counts as 1 and the range is inclusive β€” so like, 1-2 means the first two bases of the sequence. periodt.
  • 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, first base is 1, range is inclusive, so 1-2 = 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, first value is 1 and the range is inclusive (1-2 = the first two bases of the sequence). Start cannot be larger than end, but it 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 β€” returns the quality value at the given location, first value is 1, range is inclusive (1-2 = the first two bases of the sequence). Start cannot be larger than end, but it 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, first value is 1 and the range is inclusive (1-2 = 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, first value is 1 and the range is inclusive (1-2 = 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 β€” returns the length of the trace if all four traces (atgc) are the same. Otherwise? It throws an error. no chill, no mercy.
  • 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 β€” grabs a subset of the sequence, its quality, and its trace. it's giving ✨mini-me✨.
  • Returns β€” A reference to a 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 β€” synthesizes false traces for this object. fake it till you make it bestie πŸ’….
  • Returns β€” Nothing.
  • Args β€” None.
  • Notes β€” this method is meant to be invoked when this object gets created with a SWQ object β€” meaning, there's a sequence and a set of qualities but there was no actual trace data. so we invent some. iconic behaviour honestly.

πŸ”₯ _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. cute lil lineup 🫢.
  • 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 than 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. read the room, bestie.

🌸 _initialize_traces()

  • Title β€” _initialize_traces()
  • Usage β€” $trace_object->_initialize_traces();
  • Function β€” creates empty arrays to hold synthetic trace values. clean slate energy ✨.
  • 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? asking for a friend.
  • Returns β€” A scalar representing 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 β€” takes a sequence's quality and synthesizes proper scf-style base accuracies that you can then access 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. it 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 little utility routine to return bases other than the one provided. I was doing this over and over so I put it here. we love a shortcut πŸ’….
  • 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".

and that's a wrap on the whole page, bestie 🫢 that was a lot of methods and you read every single one β€” main character energy fr fr. this gem ships with perl v5.32.1 and the page is dated 2021-08-15 (and yes, it's filed under Bio::S...ceTrace(3pm) in the user-contributed perl documentation). go forth and trace some sequences, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from