Bio::Seq::QualI(3pm)

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

NAME 🌸

Bestie, meet Bio::Seq::QualI β€” the interface definition for a Bio::Seq::Qual. That's the whole name, periodt. πŸ’…


SYNOPSIS ✨

okay so imagine you somehow got a Bio::Seq::Qual compliant object. Here's the vibe check:

# get a Bio::Seq::Qual compliant object somehow

# to test this is a seq object

$obj->isa("Bio::Seq::QualI")
   || $obj->throw("$obj does not implement the Bio::Seq::QualI interface");

# accessors

$string    = $obj->qual();
$substring = $obj->subqual(12,50);
$display   = $obj->display_id(); # for human display
$id        = $obj->primary_id(); # unique id for this object,
                                 # implementation defined
$unique_key= $obj->accession_number();
                   # unique biological id

That's the whole synopsis, no cap. 🫢


DESCRIPTION πŸ¦‹

This object defines an abstract interface to basic quality information. PrimaryQual is an object just for the quality and its name(s), nothing more. There's a pure perl implementation of this in Bio::Seq::PrimaryQual. If you just want to use Bio::Seq::PrimaryQual objects, then please read that module first. This module defines the interface, and it's of more interest to people who want to wrap their own Perl Objects/RDBs/FileSystems etc in a way that they "are" bioperl quality objects, even though it is not using Perl to store the sequence etc.

This interface defines what bioperl considers necessary to "be" a sequence of qualities, without providing an implementation of this. (An implementation is provided in Bio::Seq::PrimaryQual.) If you want to provide a Bio::Seq::PrimaryQual 'compliant' object which in fact wraps another object/database/out-of-perl experience, then this is the correct thing to wrap, generally by providing a wrapper class which would inherit from your object and this Bio::Seq::QualI interface. The wrapper class then would have methods lists in the "Implementation Specific Functions" which would provide these methods for your object.


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://github.com/bioperl/bioperl-live/issues


AUTHOR - Chad Matsalia πŸ‘‘

This module is heavily based on Bio::Seq::PrimarySeq and is modeled after or outright copies sections of it. Thanks Ewan!

Email bioinformatics@dieselwurks.com


APPENDIX 🧚

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

Implementation Specific Functions πŸ”₯

These functions are the ones that a specific implementation must define.

✨ qual() ✨

  • Title: qual()
  • Usage: @quality_values = @{$obj->qual()};
  • Function: Returns the quality as a reference to an array containing the quality values. The individual elements of the quality array are not validated and can be any numeric value.
  • Returns: A reference to an array.
  • Status: (empty in the original, bestie)

🌸 subqual($start,$end) 🌸

  • Title: subqual($start,$end)
  • Usage: @subset_of_quality_values = @{$obj->subseq(10,40)};
  • 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

πŸ’… display_id() πŸ’…

  • Title: display_id()
  • Usage:
$id_string = $obj->display_id() _or_
$id_string = $obj->display_id($new_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
  • Returns: A string
  • Args: If an arg is provided, it will replace the existing display_id in the object.

🧬 accession_number() 🧬

  • Title: accession_number()
  • Usage:
$unique_biological_key = $obj->accession_number(); _or_
$unique_biological_key = $obj->accession_number($new_acc_num);
  • 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".
  • Returns: A string.
  • Args: If an arg is provided, it will replace the existing accession_number in the object.

πŸ”‘ primary_id() πŸ”‘

  • Title: primary_id()
  • Usage:
$unique_implementation_key = $obj->primary_id(); _or_
$unique_implementation_key = $obj->primary_id($new_prim_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.
  • Returns: A string
  • Args: If an arg is provided, it will replace the existing primary_id in the object.

πŸ†• can_call_new() πŸ†•

  • Title: can_call_new()
  • Usage:
if( $obj->can_call_new ) {
    $newobj = $obj->new( %param );
}
  • Function: can_call_new returns 1 or 0 depending on whether an implementation allows new constructor to be called. If a new constructor is allowed, then it should take the followed hashed constructor list.
$myobject->new( -qual => $quality_as_string,
                -display_id  => $id,
                -accession_number => $accession,
                );
  • Example: (none)
  • Returns: 1 or 0
  • Args: (none)

πŸ“ 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.

Optional Implementation Functions πŸ’–

The following functions rely on the above functions. A implementing class does not need to provide these functions, as they will be provided by this class, but is free to override these functions.

All of revcom(), trunc(), and translate() create new sequence objects. They will call new() on the class of the sequence object instance passed as argument, unless can_call_new() returns FALSE. In the latter case a Bio::PrimarySeq object will be created. Implementors which really want to control how objects are created (eg, for object persistence over a database, or objects in a CORBA framework), they are encouraged to override these methods

πŸ”„ revcom πŸ”„

  • Title: revcom
  • Usage: @rev = @{$qual->revcom()};
  • Function: Produces a new Bio::Seq::QualI implementing object which is reversed from the original quality array. The id is the same id as the original sequence, and the accession number is also identical. If someone wants to track that this sequence has been reversed, it needs to define its own extensions

To do an inplace edit of an object you can go:

$qual = $qual->revcom();

This of course, causes Perl to handle the garbage collection of the old object, but it is roughly speaking as efficient as an inplace edit.

  • Returns: A new (fresh) Bio::Seq::PrimaryQualI object
  • Args: none

βœ‚οΈ trunc() βœ‚οΈ

  • Title: trunc
  • Usage: $subseq = $myseq->trunc(10,100);
  • Function: Provides a truncation of a sequence,
  • Returns: a fresh Bio::Seq::QualI implementing object
  • Args: Two integers denoting first and last base of the sub-sequence.

πŸ§ͺ translate() πŸ§ͺ

  • Title: translate()
  • Usage:
$protein_seq_obj = $dna_seq_obj->translate
#if full CDS expected:
$protein_seq_obj = $cds_seq_obj->translate(undef,undef,undef,undef,1);
  • Function: Completely useless in this interface.
  • Returns: Nothing.
  • Args: Nothing.

πŸ†” id() πŸ†”

  • Title: id()
  • Usage: $id = $qual->id()
  • Function: ID of the quality. This should normally be (and actually is in the implementation provided here) just a synonym for display_id().
  • Example: (none)
  • 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 quality values but no validation is done when the PrimaryQual object is constructed and non-digits could be put into this array. Is this a bug? Just enough rope...
  • Returns: A scalar (the number of elements in the quality array).
  • Args: None.

πŸ“ desc() πŸ“

  • Title: desc()
  • Usage:
$qual->desc($newval);
$description = $seq->desc();
  • Function: Get/set description text for a qual object
  • Example: (none)
  • Returns: value of desc
  • Args: newvalue (optional)

okay bestie, that's part 1 done β€” more coming, don't go anywhere πŸ’–

🫣 Private functions 🫣

okay so these are the private functions for the PrimarySeqI interface. and bestie, listen β€” you do not need to implement these. like, at all. they're not for you. they're behind the velvet rope. πŸ’…


✨ _attempt_to_load_Seq ✨

this one is giving mystery because literally every field is empty, no cap. here's the whole thing, exactly as it is:

  • Title β€” _attempt_to_load_Seq
  • Usage β€” (nothing, bestie, it's blank πŸ«₯)
  • Function β€” (also blank 🌸)
  • Example β€” (blank again, i know 😭)
  • Returns β€” (blank ✨)
  • Args β€” (blank πŸŽ€)

so yeah. that's the whole vibe. it exists, it's private, and the docs are not gonna elaborate. respect the mystery πŸ¦‹


aaaand that's a wrap on the whole page, bestie!! πŸŽ€ you made it to the end, which is honestly main character energy πŸ‘‘ this version was baked by perl v5.32.1 on 2021-08-15, and the page itself is Bio::Seq::QualI(3pm). go forth and slay your quals πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from