File Coverage

blib/lib/Bio/RNA/Barriers.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1             package Bio::RNA::Barriers;
2             our $VERSION = '0.02';
3              
4 12     12   1222995 use 5.012;
  12         164  
5 12     12   76 use strict;
  12         22  
  12         281  
6 12     12   62 use warnings;
  12         25  
  12         429  
7              
8 12     12   6116 use Bio::RNA::Barriers::Minimum;
  12         55  
  12         633  
9 12     12   9146 use Bio::RNA::Barriers::RateMatrix;
  12         51  
  12         521  
10 12     12   8250 use Bio::RNA::Barriers::Results;
  12         46  
  12         646  
11              
12             1; # End of Bio::RNA::Barriers
13              
14              
15             __END__
16              
17             =pod
18              
19             =encoding UTF-8
20              
21             =head1 NAME
22              
23             Bio::RNA::Barriers - Parse, query and manipulate output of I<Barriers>
24              
25             =cut
26              
27             =head1 SYNOPSIS
28              
29             use Bio::RNA::Barriers;
30              
31             ##### Working with the Barriers results file (*.bar) #####
32             $bardat = Bio::RNA::Barriers::Results->new('bar_file.bar');
33              
34             print "There are ", $bardat->min_count, " minima.";
35              
36             my $min3 = $bardat->get_min(3);
37             print $min3->grad_struct_count,
38             " structures lead to basin 3 via a gradient walk.\n"
39             if $min3->has_bsize;
40              
41             my $mfe_min = $bardat->get_global_min();
42             print "$mfe_min\n"; # prints minimum as in the results file
43              
44              
45             ##### Working with the rate matrix files (rates.{out,bin}) #####
46             my $rate_matrix = Bio::RNA::Barriers::RateMatrix->new(
47             file_name => '/path/to/rates.bin',
48             file_type => 'BIN',
49             );
50              
51             print "$rate_matrix"; # prints entire matrix in text format
52             print 'Dimension of rate matrix is ', $rate_matrix->dim, "\n";
53             print 'Rate from state 1 to state 3 is ',
54             $rate_matrix->rate_from_to(1, 3),
55             "\n";
56              
57             $rate_matrix->remove_states(1, 5, 5, 3); # state 2 becomes state 1 etc.
58             $rate_matrix->keep_states(1..3); # keep only states {1, 2, 3}.
59             $rate_matrix->keep_connected(); # remove disconnected states
60              
61             open my $out_fh_bin, '>', '/path/to/output/rates.bin';
62             $rate_matrix->print_as_bin($out_fh_bin); # write binary output
63              
64              
65             =head1 DESCRIPTION
66              
67             This module provides auxiliary classes to parse, query, manipulate and print
68             the files generated by I<Barriers>, a tool to compute RNA energy landscapes
69             and folding kinetics developed at Theoretical Biochemistry Group (TBI) at the
70             University of Vienna. Note that this module is B<not> written and maintained
71             by the authors of I<Barriers>.
72              
73             Supports the result file (written to STDOUT by I<Barriers>) as well as rate
74             matrices in binary and text format. Properties like the number of minima or,
75             for each minima, their fathers and children, connectedness, and basin sizes
76             can be queried.
77              
78             Rate matrices can be manipulated easily, e. g. to remove or keep certain
79             states or to convert between binary and text representation.
80              
81              
82             =head1 CLASSES
83              
84             This module provides two major classes to handle the results:
85             L<Bio::RNA::Barriers::Results> and L<Bio::RNA::Barriers::Minimum>, where the
86             first is an aggregate results object containing objects from the second.
87             Usually you want to pass a file name or handle to a I<Barriers> file to the
88             constructor of the results class (i. e.,
89             C<< Bio::RNA::Barriers::Results->new() >>), and the rest is taken care of
90             automatically.
91              
92             For rate matrices, L<Bio::RNA::Barriers::RateMatrix> is provided. It can parse
93             both text and binary matrices. Make sure to correctly set the file type
94             argument when passing the path or handle to the constructor.
95              
96             For a description of the available methods, please refer to the documentation
97             of each individual class, i. e. run C<perldoc Bio::RNA::Barriers::Results>
98             etc.
99              
100              
101             =head1 AUTHOR
102              
103             Felix Kuehnl, C<< <felix at bioinf.uni-leipzig.de> >>
104              
105             =head1 BUGS
106              
107             Please report any bugs or feature requests by raising an issue at
108             L<https://github.com/xileF1337/Bio-RNA-Barriers/issues>.
109              
110             You can also do so by mailing to C<bug-bio-rna-barmap at rt.cpan.org>,
111             or through the web interface at
112             L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-RNA-BarMap>. I will be
113             notified, and then you'll automatically be notified of progress on your bug as
114             I make changes.
115              
116              
117             =head1 SUPPORT
118              
119             You can find documentation for this module with the perldoc command.
120              
121             perldoc Bio::RNA::Barriers
122              
123              
124             You can also look for information at the official Barriers website:
125              
126             L<https://www.tbi.univie.ac.at/RNA/Barriers/>
127              
128              
129             =over 4
130              
131             =item * Github: the official repository
132              
133             L<https://github.com/xileF1337/Bio-RNA-Barriers>
134              
135             =item * RT: CPAN's request tracker (report bugs here)
136              
137             L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Bio-RNA-Barriers>
138              
139             =item * AnnoCPAN: Annotated CPAN documentation
140              
141             L<http://annocpan.org/dist/Bio-RNA-Barriers>
142              
143             =item * CPAN Ratings
144              
145             L<https://cpanratings.perl.org/d/Bio-RNA-Barriers>
146              
147             =item * Search CPAN
148              
149             L<https://metacpan.org/release/Bio-RNA-Barriers>
150              
151             =back
152              
153              
154             =head1 LICENSE AND COPYRIGHT
155              
156             Copyright 2019-2021 Felix Kuehnl.
157              
158             This program is free software: you can redistribute it and/or modify
159             it under the terms of the GNU General Public License as published by
160             the Free Software Foundation, either version 3 of the License, or
161             (at your option) any later version.
162              
163             This program is distributed in the hope that it will be useful,
164             but WITHOUT ANY WARRANTY; without even the implied warranty of
165             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
166             GNU General Public License for more details.
167              
168             You should have received a copy of the GNU General Public License
169             along with this program. If not, see L<http://www.gnu.org/licenses/>.
170              
171              
172             =cut
173              
174             # End of Bio/RNA/Barriers.pm