Bio::T...t::Trim(3pm)
π Bio::Tools::Alignment::Trim(3pm) π
okay so we're reading the manual page for Bio::Tools::Alignment::Trim from the User Contributed Perl Documentation, and bestie, it's a whole vibe. it's giving "one guy wrote this at 3am for himself and it works". let's get into it π¦
β¨ NAME β¨
Bio::Tools::Alignment::Trim β a kludge to do specialized trimming of sequence based on quality. π
πΈ SYNOPSIS πΈ
use Bio::Tools::Alignment::Trim;
$o_trim = Bio::Tools::Alignment::Trim->new();
$o_trim->set_reverse_designator("R");
$o_trim->set_forward_designator("F");
π DESCRIPTION π
so this is a specialized module, and when i say specialized i mean it was designed by Chad for Chad to trim sequences based on a highly specialized list of requirements. like, literally the brief was "write something that will trim sequences 'just like the people in the lab would do manually'". that's the spec. that's the whole spec. π
the author settled on a sliding-window-average style of search, which is β his words β ugly and slow, but it does exactly what he wanted it to do. no notes. well, one note:
Mental note: rewrite this. π
and honestly the most important thing to keep in mind here is the context this module was written in: it exists strictly to support the projects that Consed.pm was designed for. that's it. that's the scope. don't come at it expecting anything else. π
π«Ά FEEDBACK π«Ά
π¬ Mailing Lists
user feedback is an integral part of the evolution of this and other Bioperl modules, 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
pls direct your usage questions and support issues to the mailing list:
bioperl-l@bioperl.org
...rather than going straight to the module maintainer. there are so many experienced and responsive experts there who can look at the problem and quickly address it, and going through the list is just the move. if at all possible, include a thorough description of the problem with code and data examples. the more deets the better, bestie. β¨
π 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-at-dieselwurks.com
π APPENDIX π
the rest of this documentation details each of the object methods. internal methods are usually preceded with a _ (iykyk π§).
π new()
- Title:
new() - Usage:
$o_trim = Bio::Tools::Alignment::Trim->new(); - Function: Construct the
Bio::Tools::Alignment::Trimobject. No parameters are required to create this object. As far as the author is concerned, it is strictly a bundle of functions. - Returns: A reference to a
Bio::Tools::Alignment::Trimobject. - Args: (optional)
-windowsize(default10)-phreds(default20)
π set_designators($forward_designator,$reverse_designator)
- Title:
set_designators(<forward>,<reverse>) - Usage:
$o_trim->set_designators("F","R") - Function: Set the string by which the system determines whether a given sequence represents a forward or a reverse read.
- Returns: Nothing.
- Args: two scalars: one representing the forward designator and one representing the reverse designator.
π¦ set_forward_designator($designator)
- Title:
set_forward_designator($designator) - Usage:
$o_trim->set_forward_designator("F") - Function: Set the string by which the system determines if a given sequence is a forward read.
- Returns: Nothing.
- Args: A string representing the forward designator of this project.
πΈ set_reverse_designator($reverse_designator)
- Title:
set_reverse_designator($reverse_designator) - Function: Set the string by which the system determines if a given sequence is a reverse read.
- Usage:
$o_trim->set_reverse_designator("R") - Returns: Nothing.
- Args: A string representing the forward designator of this project.
π get_designators()
- Title:
get_designators() - Usage:
$o_trim->get_designators() - Returns: A string describing the current designators.
- Args: None
- Notes: Really for informational purposes only. Duh.
π trim_leading_polys()
- Title:
trim_leading_polys() - Usage:
$o_trim->trim_leading_polys() - Function: Not implemented. Does nothing.
- Returns: Nothing.
- Args: None.
- Notes: This function is not implemented. Part of something the author wanted to do but never got around to doing.
π dump_hash()
- Title:
dump_hash() - Usage:
$o_trim->dump_hash() - Function: Unimplemented.
- Returns: Nothing.
- Args: None.
- Notes: Does nothing.
π₯ trim_singlet($sequence,$quality,$name,$class)
- Title:
trim_singlet($sequence,$quality,$name,$class) - Usage:
($r_trim_points,$trimmed_sequence) =
@{$o_trim->trim_singlet($sequence,$quality,$name,$class)};
- Function: Trim a singlet based on its quality.
- Returns: a reference to an array containing the forward and reverse trim points and the trimmed sequence.
- Args:
$sequence: A sequence (SCALAR, please)$quality: A scalar of space-delimited quality values.$name: the name of the sequence$class: The class of the sequence. One ofqw(singlet singleton doublet pair multiplet)
- Notes: At the time this was written the bioperl objects
SeqWithQualityandPrimaryQualdid not exist. That's what's up with the clumsy passing of references and so on. The author says he'll rewrite this next time he has to work with it. He also wasn't sure whether this function should return just the trim points or the points and the sequence β he decided he always wanted both, so that's how it got implemented.- Note that the size of the sliding windows is set during construction of the
Bio::Tools::Alignment::Trimobject.
- Note that the size of the sliding windows is set during construction of the
π§ trim_doublet($sequence,$quality,$name,$class)
- Title:
trim_doublet($sequence,$quality,$name,$class) - Usage:
($r_trim_points,$trimmed_sequence) =
@{$o_trim->trim_singlet($sequence,$quality,$name,$class)};
- Function: Trim a singlet based on its quality.
- Returns: a reference to an array containing the forward and reverse
- Args:
$sequence: A sequence$quality: A scalar of space-delimited quality values.$name: the name of the sequence$class: The class of the sequence. One ofqw(singlet singleton doublet pair multiplet)
- Notes: At the time this was written the bioperl objects
SeqWithQualityandPrimaryQualdid not exist. That's what's up with the clumsy passing of references and so on. The author says he'll rewrite this next time he has to work with it. He also wasn't sure whether this function should return just the trim points or the points and the sequence β he decided he always wanted both, so that's how it got implemented.
β chop_sequence($name,$class,$sequence,@points)
- Title:
chop_sequence($name,$class,$sequence,@points) - Usage:
($start_point,$end_point,$chopped_sequence) =
$o_trim->chop_sequence($name,$class,$sequence,@points);
- Function: Chop a sequence based on its name, class, and sequence.
- Returns: an array containing three scalars:
- the start trim point
- the end trim point
- the chopped sequence
- Args:
$name: the name of the sequence$class: The class of the sequence. One ofqw(singlet singleton doublet pair multiplet)$sequence: A sequence@points: An array containing two elements β the first contains the start trim point and the second contains the end trim point.
π _get_start($r_quals,$windowsize,$phreds,$offset)
- Title:
_get_start($r_quals,$windowsize,$phreds,$offset) - Usage:
$start_base = $self->_get_start($r_windows,5,20); - Function: Provide the start trim point for this sequence.
- Returns: a scalar representing the start of the sequence
- Args:
$r_quals: A reference to an array containing quality values. In context, this array of values has been smoothed by the sliding window-look ahead algorithm.$windowsize: The size of the window used when the sliding window look-ahead average was calculated.$phreds:<fill in what this does here>$offset:<fill in what this does here>
π _get_end($r_qual,$windowsize,$phreds,$count)
- Title:
_get_end($r_qual,$windowsize,$phreds,$count) - Usage:
my $end_base = &_get_end($r_windows,20,20,$start_base); - Function: Get the end trim point for this sequence.
- Returns: A scalar representing the end trim point for this sequence.
- Args:
$r_qual: A reference to an array containing quality values. In context, this array of values has been smoothed by the sliding window-look ahead algorithm.$windowsize: The size of the window used when the sliding window look-ahead average was calculated.$phreds:<fill in what this does here>$count: Start looking for the end of the sequence here.
π count_doublet_trailing_zeros($r_qual)
- Title:
count_doublet_trailing_zeros($r_qual) - Usage:
my $start_of_trailing_zeros = &count_doublet_trailing_zeros(\@qual); - Function: Find out when the trailing zero qualities start.
- Returns: A scalar representing where the zeros start.
- Args: A reference to an array of quality values.
- Notes: Again, this should be rewritten to use
PrimaryQualobjects. A more detailed explanation of why phrap puts these zeros here should be written and placed here. Please email and hassle the author. π§
π _sliding_window($r_quals,$windowsize)
- Title:
_sliding_window($r_quals,$windowsize) - Usage:
my $r_windows = &_sliding_window(\@qual,$windowsize); - Function: Create a sliding window, look-forward-average on an array of quality values. Used to smooth out differences in qualities.
- Returns: A reference to an array containing the smoothed values.
- Args:
$r_quals: A reference to an array containing quality values.$windowsize: The size of the sliding window.
- Notes: This was written before
PrimaryQualobjects existed. They should use that object but this hasn't been rewritten yet.
π¦ _print_formatted_qualities
- Title:
_print_formatted_qualities(\@quals) - Usage:
&_print_formatted_qualities(\@quals); - Returns: Nothing. Prints.
- Args: A reference to an array containing quality values.
- Notes: An internal procedure used in debugging. Prints out an array nicely. β¨
π _get_end_old($r_qual,$windowsize,$phreds,$count)
- Title:
_get_end_old($r_qual,$windowsize,$phreds,$count) - Usage: Deprecated. Don't use this!
- Returns: Deprecated. Don't use this!
- Args: Deprecated. Don't use this!
and that's the whole page, bestie π«Ά this one ships as perl v5.32.1, dated 2021-08-15, under the Bio::T...t::Trim(3pm) manual name β so if you're out here reading it, you're reading a certified classic. go trim something. slay. π
π
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms