Bio::C...e::Pair(3pm)
π Bio::Coordinate::Pair π
okay bestie, so this is Bio::Coordinate::Pair, version 1.007001 β the Perl module that lets two coordinate systems hold hands and match up. it's in the User Contributed Perl Documentation family, and it's lowkey iconic for mapping one continuous stretch of coordinates onto another. let's get into it π¦
β¨ NAME β¨
Bio::Coordinate::Pair β Continuous match between two coordinate sets. periodt.
πΈ VERSION πΈ
version 1.007001. no cap, that's the one. π
π SYNOPSIS π
here's the vibe, verbatim, so you can copy-paste and slay:
use Bio::Location::Simple;
use Bio::Coordinate::Pair;
my $match1 = Bio::Location::Simple->new
(-seq_id => 'propeptide', -start => 21, -end => 40, -strand=>1 );
my $match2 = Bio::Location::Simple->new
(-seq_id => 'peptide', -start => 1, -end => 20, -strand=>1 );
my $pair = Bio::Coordinate::Pair->new(-in => $match1,
-out => $match2
);
# location to match
$pos = Bio::Location::Simple->new
(-start => 25, -end => 25, -strand=> -1 );
# results are in a Bio::Coordinate::Result
# they can be Matches and Gaps; are Bio::LocationIs
$res = $pair->map($pos);
$res->isa('Bio::Coordinate::Result');
$res->each_match == 1;
$res->each_gap == 0;
$res->each_Location == 1;
$res->match->start == 5;
$res->match->end == 5;
$res->match->strand == -1;
$res->match->seq_id eq 'peptide';
so like, you set up your in-location and your out-location, build the pair, then throw a position at map() and it hands you back a Bio::Coordinate::Result full of matches and gaps. that's the whole arc. main character energy fr fr. π₯
π DESCRIPTION π
This class represents a one continuous match between two coordinate systems, and those systems are represented by Bio::Location::Simple objects. The relationship is directed and reversible β it goes both ways, like a situationship that actually works out. π
It implements methods to ensure internal consistency, and it maps continuous and split locations from one coordinate system to another.
The map() method returns Bio::Coordinate::Results with Bio::Coordinate::Result::Gaps. The calling code has to deal with them β process them or ignore them, your call bestie, but they're there. π
π§ METHODS π§
π new
literally just new. that's the whole entry. constructor behavior, bestie. β¨
π in
Title : in
Usage : $obj->in('peptide');
Function: Set and read the input coordinate system.
Example :
Returns : value of input system
Args : new value (optional), Bio::LocationI
sets and reads your input coordinate system. the arg is optional and it's a Bio::LocationI. π
π out
Title : out
Usage : $obj->out('peptide');
Function: Set and read the output coordinate system.
Example :
Returns : value of output system
Args : new value (optional), Bio::LocationI
same energy as in, but for the output side. set it, read it, live your truth. π
π swap
Title : swap
Usage : $obj->swap;
Function: Swap the direction of mapping; input <-> output
Example :
Returns : 1
Args :
flips the whole thing around β input becomes output, output becomes input. input <-> output, reversible, we love a flexible queen. returns 1. π
π strand
Title : strand
Usage : $obj->strand;
Function: Get strand value for the pair
Example :
Returns : ( 1 | 0 | -1 )
Args :
gives you the strand value for the pair β 1, 0, or -1. that's it, that's the whole thing. π§¬
π test
Title : test
Usage : $obj->test;
Function: test that both components are of the same length
Example :
Returns : ( 1 | undef )
Args :
checks that both components are the same length. returns 1 or undef. vibe check: passed or not passed. π
π map
Title : map
Usage : $newpos = $obj->map($pos);
Function: Map the location from the input coordinate system
to a new value in the output coordinate system.
Example :
Returns : new Bio::LocationI in the output coordinate system or undef
Args : Bio::LocationI object
the star of the show β¨ β takes a location from the input coordinate system and maps it to a new value in the output coordinate system. returns a new Bio::LocationI in the output coordinate system, or undef. arg is a Bio::LocationI object.
π οΈ INTERNAL METHODS π οΈ
π¦ _map
Title : _map
Usage : $newpos = $obj->_map($simpleloc);
Function: Internal method that does the actual mapping. Called
multiple times by map() if the location to be mapped is a
split location
Example :
Returns : new location in the output coordinate system or undef
Args : Bio::Location::Simple
this one's internal bestie, so don't come for it β it does the actual mapping under the hood. map() calls it multiple times if the location you're mapping is a split location. returns a new location in the output coordinate system, or undef. arg is a Bio::Location::Simple. π«Ά
π 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 the Bioperl mailing list. Your participation is much appreciated. fr fr, they mean it. π₯Ή
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.
ngl, going straight to the maintainer is not the move β the list has the experts, and they'll clock your problem fast. include code and data examples or it's giving vague. π
π· Reporting bugs
Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/%%7Bdist%7D
π AUTHOR π
Heikki Lehvaslaiho <heikki@bioperl.org>
β COPYRIGHT β
This software is copyright (c) by Heikki Lehvaslaiho.
This software is available under the same terms as the perl 5 programming language system itself.
and that's the whole page, bestie π
β written for perl v5.32.0, dated 2020-11-24, and that's the manual name Bio::Coordinate::Pair(3pm) doing its thing. go map some coordinates, you've got this πβ¨π¦
π¦ where this page comes from
- debian bookworm: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbio-coordinate-perl 1.7.1-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms