Bio::C...:Chain(3pm)
π« NAME π«
Bio::Coordinate::Chain β bestie, it maps locations through a whole chain of coordinate mappers π¦β¨
This is the Bio::C...:Chain page from the User Contributed Perl Documentation, and we're gonna get you fluent in it, no cap π
πΈ VERSION πΈ
version 1.007001 β that's the one, that's our girl π
β¨ SYNOPSIS β¨
# create Bio::Coordinate::Pairs, or any MapperIs, somehow
$pair1; $pair2;
# add them into a Chain
$collection = Bio::Coordinate::Chain->new;
$collection->add_mapper($pair1);
$collection->add_mapper($pair2);
# create a position and map it
$pos = Bio::Location::Simple->new (-start => 5, -end => 9 );
$match = $collection->map($pos);
if ($match) {
sprintf "Matches at %d-%d\n", $match->start, $match->end,
} else {
print "No match\n";
}
π§ DESCRIPTION π§
Okay so the whole premise here? You already built a bunch of mappers. Multiple. A little squad of them π This class assumes exactly that β you've got several mappers and you wanna link them together so that the output of the previous mapper becomes the input of the next mapper. Chain them up like friendship bracelets and boom, you can build arbitrarily complex mappers out of simpler components. It's giving β¨compositionβ¨, it's giving main character energy π
β οΈ Huge disclaimer incoming: Chain does not do any sanity checking on its mappers. Not a single vibe check. You β yes you, bestie β are solely responsible for making sure that input and output coordinate systems, direction of mapping, and parameters internal to mappers all make sense when chained together. It will not save you. It will not warn you. π
To put it bluntly (their words, not mine, but fr fr): the present class is just a glorified foreach loop over an array of mappers calling the map method. That's it. That's the whole thing π
And then, iconic: it would be neat to an internal function that would generate a new single step mapper from those included in the chain. It should speed things up considerably. Any volunteers? ππββοΈ (Not me, not today.)
π METHODS π
π map π
- Title :
map - Usage :
$newpos = $obj->map($pos); - Function: Map the location through all the mappers in the chain. Every single one. No skipping π
- Example :
- Returns : new Location in the output coordiante system
- Args : a
Bio::Location::Simpleobject
π¦ sort π¦
You do not really want to sort your chain, do you! π This function does nothing other than a warning. That's the entire personality. It warns at you and dips. Not me writing a method that only complains β periodt.
π Inherited methods π
β add_mapper β
- Title :
add_mapper - Usage :
$obj->add_mapper($mapper) - Function: Pushes one
Bio::Coodinate::MapperIinto the list of mappers. Sets_is_sorted()to false. - Example :
- Returns :
1when succeeds,0for failure. - Args : mapper object
π mappers π
- Title :
mappers - Usage :
$obj->mappers(); - Function: Returns or sets a list of mappers.
- Example :
- Returns : array of mappers
- Args : array of mappers
π each_mapper π
- Title :
each_mapper - Usage :
$obj->each_mapper(); - Function: Returns a list of mappers.
- Example :
- Returns : array of mappers
- Args : none
π₯ swap π₯
- Title :
swap - Usage :
$obj->swap; - Function: Swap the direction of mapping;
input <-> output - Example :
- Returns :
1 - Args :
πΈ test πΈ
- Title :
test - Usage :
$obj->test; - Function: test that both components of all pairs are of the same length. Ran automatically.
- Example :
- Returns : boolean
- Args :
π 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 the Bioperl mailing list. Your participation is much appreciated, genuinely π«Ά
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. Why? Because many experienced and reponsive experts will be able look at the problem and quickly address it β a whole group chat of geniuses, we love to see it π Please include a thorough description of the problem with code and data examples if at all possible. Receipts, bestie, receipts π§Ύβ¨
π 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/%%7Bdist%7D
π AUTHOR π
Heikki Lehvaslaiho <heikki@bioperl.org> β the icon who wrote this π
π 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.
π CONTRIBUTOR π
Ewan Birney</purpose> <birney@ebi.ac.uk> β shoutout, contributing legend π
And that's a wrap, bestie! π This page is perl v5.32.0, dated 2020-11-24, and it lives in Bio::C...:Chain(3pm) β go forth and chain those mappers responsibly, mwah πβ¨
π¦ 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