line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::RNA::BarMap; |
2
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
342151
|
use 5.012; |
|
5
|
|
|
|
|
59
|
|
5
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
131
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
2907
|
use Bio::RNA::BarMap::Mapping; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
193
|
|
8
|
5
|
|
|
5
|
|
102
|
use Bio::RNA::BarMap::Mapping::Type; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
216
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
1; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
__END__ |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=pod |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=encoding UTF-8 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Bio::RNA::BarMap - Parse and query I<BarMap> mappings. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use v5.12; # for 'say()' and '//' a.k.a. logical defined-or |
25
|
|
|
|
|
|
|
use Bio::RNA::BarMap; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Parse a BarMap output file. |
28
|
|
|
|
|
|
|
my $barmap_file = 'N1M7_barmap_1.out'; # e.g. the test data in t/data/ |
29
|
|
|
|
|
|
|
my $mapping = Bio::RNA::BarMap::Mapping->new($barmap_file); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Print mapped Barriers files. |
32
|
|
|
|
|
|
|
say join q{ }, $mapping->mapped_files; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Map a file. |
35
|
|
|
|
|
|
|
my $from_file = '8.bar'; # one of the mapped .bar files |
36
|
|
|
|
|
|
|
my $to_file = $mapping->map_file($from_file); # last file maps to undef |
37
|
|
|
|
|
|
|
say "$from_file is mapped to ", $to_file // "nothing"; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Map minimum 2 from file 8.bar to the next file. |
40
|
|
|
|
|
|
|
my $from_min = 2; |
41
|
|
|
|
|
|
|
my $to_min = $mapping->map_min_step($from_file, $from_min); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Map to an arbitrary file (only forward direction!) |
44
|
|
|
|
|
|
|
$to_file = '15.bar'; |
45
|
|
|
|
|
|
|
$to_min = $mapping->map_min($from_file, $from_min, $to_file); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# Verify mapping type: is the mapping exact (->) or approximate (~>)? |
48
|
|
|
|
|
|
|
my ($type, $to_min2) = $mapping->map_min_step($from_file, $from_min); |
49
|
|
|
|
|
|
|
say "Min $from_min from file '$from_file' is mapped ", |
50
|
|
|
|
|
|
|
$type->is_exact ? 'exactly' : 'approximately', " to min $to_min2"; |
51
|
|
|
|
|
|
|
say "Mapping arrow: ", $type->arrow; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This module provides auxiliary classes to parse, query and print the mapping |
56
|
|
|
|
|
|
|
file generated by the RNA kinetics simulation tool I<BarMap>, developed |
57
|
|
|
|
|
|
|
at the Institute of Theoretical Biochemistry (TBI) in Vienna. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Note that this module is B<not> developed and maintained by the authors of |
60
|
|
|
|
|
|
|
I<BarMap>. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 CLASSES & METHODS |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Bio::RNA::BarMap provides several classes for working with I<BarMap>'s output. |
65
|
|
|
|
|
|
|
The most relevant is L<Bio::RNA::BarMap::Mapping>, which is used to parse the |
66
|
|
|
|
|
|
|
mapping file generated by I<BarMap>. The constructor C<new()> takes a path or |
67
|
|
|
|
|
|
|
handle to a I<BarMap> file and creates a new mapping object, which is used to |
68
|
|
|
|
|
|
|
perform all kinds of queries on the mapping file. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
The mapping of a single state to the next I<Barriers> file can be either exact |
71
|
|
|
|
|
|
|
or approximate, as is indicated by a straight (C<-E<gt>>) or curved |
72
|
|
|
|
|
|
|
(C<~E<gt>>) arrow in the mapping file. To provide this information, the |
73
|
|
|
|
|
|
|
C<map_min()> and C<map_min_step()> methods of the mapping object -- when |
74
|
|
|
|
|
|
|
called in a list context -- return not only the target minimum of the mapping, |
75
|
|
|
|
|
|
|
but also an object of type L<Bio::RNA::BarMap::Mapping::Type>. The type object |
76
|
|
|
|
|
|
|
can be queried using its methods C<is_exact()> and C<is_approx()>, and also |
77
|
|
|
|
|
|
|
converted back to its arrow representation using C<arrow()>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
For more information, please refer to the documentation of the individual |
80
|
|
|
|
|
|
|
classes. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Felix Kuehnl, C<< <felix at bioinf.uni-leipzig.de> >> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 BUGS |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Please report any bugs or feature requests by raising an issue at |
91
|
|
|
|
|
|
|
L<https://github.com/xileF1337/Bio-RNA-BarMap/issues>. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
You can also do so by mailing to C<bug-bio-rna-barmap at rt.cpan.org>, |
94
|
|
|
|
|
|
|
or through the web interface at |
95
|
|
|
|
|
|
|
L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-RNA-BarMap>. I will be |
96
|
|
|
|
|
|
|
notified, and then you'll automatically be notified of progress on your bug as |
97
|
|
|
|
|
|
|
I make changes. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SUPPORT |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
perldoc Bio::RNA::BarMap |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
You can also look for information at the official BarMap website: |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
L<https://www.tbi.univie.ac.at/RNA/bar_map/> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=over 4 |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * Github: the official repository |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L<https://github.com/xileF1337/Bio-RNA-BarMap> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Bio-RNA-BarMap> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Bio-RNA-BarMap> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item * CPAN Ratings |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
L<https://cpanratings.perl.org/d/Bio-RNA-BarMap> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item * Search CPAN |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
L<https://metacpan.org/release/Bio-RNA-BarMap> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=back |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Copyright 2019-2021 Felix Kuehnl. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify |
142
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
143
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
144
|
|
|
|
|
|
|
(at your option) any later version. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
147
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
148
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
149
|
|
|
|
|
|
|
GNU General Public License for more details. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
152
|
|
|
|
|
|
|
along with this program. If not, see L<http://www.gnu.org/licenses/>. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
# End of Bio/RNA/BarMap.pm |
158
|
|
|
|
|
|
|
|