NAME

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

SYNOPSIS

    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();

DESCRIPTION

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.

METHODS

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

Constructor of the mapping entry class.

Supported arguments:
index

Required. Index of the minimum described by this entry.

to

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

Non-argument:
from

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

$entry->index

Index of the minimum this entry is representing.

$entry->to_type

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

$entry->to

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

$entry->to($to_min_entry)

Sets the to attribute to point to $to_min_entry.

$entry->add_from(@from_entries)

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.

$entry->get_from

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

AUTHOR

Felix Kuehnl, <felix at bioinf.uni-leipzig.de>

BUGS

Please report any bugs or feature requests by raising an issue at https://github.com/xileF1337/Bio-RNA-BarMap/issues.

You can also do so by mailing to bug-bio-rna-barmap at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-RNA-BarMap. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

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:

https://www.tbi.univie.ac.at/RNA/bar_map/

LICENSE AND COPYRIGHT

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 http://www.gnu.org/licenses/.