Bio::RNA::BarMap::Mapping::MinMappingEntry - Store BarMap mappings of a single minimum.


    use v5.12;              # for 'say()' and '//' a.k.a. logical defined-or
    use Bio::RNA::BarMap;

    my $entry = Bio::RNA::BarMap::Mapping::MinMappingEntry->new(
        index   => 3,               # of minimum of this entry
        to      => $to_min,         # the mininimum this one is mapped to

    # Query the entry.
    if ($entry->has_to) {           # maps to something
        say 'This minimum maps ',
            $entry->$to_type->is_exact ? 'exactly' : 'approximately',
            ' to minimum ', $entry->to->index;

    $entry->add_from($from_min_1, $from_min_2);     # add mins mapping to self
    say "Minima mapped to this minimum:",
    join q{, }, map {$_->index $entry->get_from();


Internal class used to store the mapping of a single minimum. Both the forward direction ("target minimum", to()) and the reverse direction ("source minima", get_from()) are provided. While the target minimum is unique, but not necessarily defined (cf. has_to()), there may be zero to many source minima, and so these are stored in a set internally. Use add_from() to add to this set.


Bio::RNA::BarMap::Mapping::MinMappingEntry->new(arg_name => $arg_val, ...)

Constructor of the mapping entry class.

Supported arguments:

Required. Index of the minimum described by this entry.


Optional. Reference to mapping entry object describing the minimum that this minimum is mapped to.


To add source minima (i. e. minima that are mapped to this minimum), use the method add_from() instead.


Index of the minimum this entry is representing.


Type of the "to" mapping, either exact or approximate. Object of type Bio::RNA::BarMap::Mapping::Type.


Returns the entry this minimum is being mapped to. May be undef.


Sets the to attribute to point to $to_min_entry.


Adds entries to the set of source minima, i. e. those that are mapped to this minimum. This method makes sure that the stored references are properly weakened and no memory leaks arise.


Returns the entries of minima that are mapped to this minimum, as stored in the source minima set.


Felix Kuehnl, <felix at>


Please report any bugs or feature requests by raising an issue at

You can also do so by mailing to bug-bio-rna-barmap at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Bio::RNA::BarMap

You can also look for information at the official BarMap website:


Copyright 2019-2021 Felix Kuehnl.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see