NAME

Bio::RNA::BarMap - Parse and query BarMap mappings.

SYNOPSIS

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

    # Parse a BarMap output file.
    my $barmap_file = 'N1M7_barmap_1.out';     # e.g. the test data in t/data/
    my $mapping = Bio::RNA::BarMap::Mapping->new($barmap_file);

    # Print mapped Barriers files.
    say join q{ }, $mapping->mapped_files;

    # Map a file.
    my $from_file = '8.bar';            # one of the mapped .bar files
    my $to_file = $mapping->map_file($from_file);   # last file maps to undef
    say "$from_file is mapped to ", $to_file // "nothing";

    # Map minimum 2 from file 8.bar to the next file.
    my $from_min = 2;
    my $to_min = $mapping->map_min_step($from_file, $from_min);

    # Map to an arbitrary file (only forward direction!)
    $to_file = '15.bar';
    $to_min = $mapping->map_min($from_file, $from_min, $to_file);

    # Verify mapping type: is the mapping exact (->) or approximate (~>)?
    my ($type, $to_min2) = $mapping->map_min_step($from_file, $from_min);
    say "Min $from_min from file '$from_file' is mapped ",
         $type->is_exact  ? 'exactly' : 'approximately', " to min $to_min2";
    say "Mapping arrow: ", $type->arrow;

DESCRIPTION

This module provides auxiliary classes to parse, query and print the mapping file generated by the RNA kinetics simulation tool BarMap, developed at the Institute of Theoretical Biochemistry (TBI) in Vienna.

Note that this module is not developed and maintained by the authors of BarMap.

CLASSES & METHODS

Bio::RNA::BarMap provides several classes for working with BarMap's output. The most relevant is Bio::RNA::BarMap::Mapping, which is used to parse the mapping file generated by BarMap. The constructor new() takes a path or handle to a BarMap file and creates a new mapping object, which is used to perform all kinds of queries on the mapping file.

The mapping of a single state to the next Barriers file can be either exact or approximate, as is indicated by a straight (->) or curved (~>) arrow in the mapping file. To provide this information, the map_min() and map_min_step() methods of the mapping object -- when called in a list context -- return not only the target minimum of the mapping, but also an object of type Bio::RNA::BarMap::Mapping::Type. The type object can be queried using its methods is_exact() and is_approx(), and also converted back to its arrow representation using arrow().

For more information, please refer to the documentation of the individual classes.

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/.