The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::RNA::Treekin::Record - Parse, query, and manipulate Treekin output.

SYNOPSIS

    use Bio::RNA::Treekin;

DESCRIPTION

Parses a regular output file of Treekin. Allows to query population data as well as additional info from the header. New minima can be generated. The stringification returns, again, a valid Treekin file which can be, e. g., visualized using Grace.

ATTRIBUTES

These attributes of the class allow to query various data from the header of the input file.

date

The time and date of the Treekin run.

sequence

The RNA sequence for which the simulation was computed.

method

The method used to build the transition matrix as documented for the --method switch of Treekin.

start_time

Initial time of the simulation.

stop_time

Time at which the simulation stops.

temperature

Temperature of the simulation in degrees Celsius.

basename

Name of the input file. May be <stdin> if data was read from standard input.

time_increment

Factor by which the time is multiplied in each simulation step (roughly, the truth is more complicated).

degeneracy

Whether to consider degeneracy in transition rates.

absorbing_state

The states specified as absorbing do not have any outgoing transitions and thus serve as "population sinks" during the simulation.

states_limit

Maximum number of states (???). Value is always (?) 2^31 = 2147483647.

info

A free text field containing additional comments.

Only available in some of the records of a BarMap multi-record file. Use predicate has_info to check whether this attribute is available.

init_population

The initial population specified by the user. This information is extracted from the cmd attribute.

Only available in BarMap's multi-record files. Use predicate has_init_population to check whether this attribute is available.

rates_file

The file that the rate matrix was read from.

Only available in BarMap's multi-record files. Use predicate has_rates_file to check whether this attribute is available.

file_index

Zero-based index given to the input files in the order they were read. Extracted from the rates_file attribute.

Use predicate has_file_index to check whether this attribute is available.

cmd

The command used to invoke Treekin. Only available in BarMap's multi-record files.

Use predicate has_cmd to check whether this attribute is available.

METHODS

These methods allow the construction, querying and manipulation of the record objects and its population data.

Bio::RNA::Treekin::Record->new($treekin_file)

Bio::RNA::Treekin::Record->new($treekin_handle)

Construct a new record from a (single) Treekin file.

$record->population_data_count

Return the number of population data records, i. e. the number of simulated time steps, including the start time.

$record->min_count

Return the number of minima.

$record->mins

Return the list of all contained minima, i. e. 1...$record->min_count

$record->keep_mins(@kept_minima)

Remove all minima but the ones from @kept_minima. The list is sorted and de-duplicated first.

$record->splice_mins(@kept_minima)

Like keep_mins(), but do not sort / de-duplicate, but use @kept_minima as is. This can be used to remove, duplicate or reorder minima.

$record->max_pop_of_min($minimum)

Get the maximum population value of all time points for a specific $minimum.

$record->pops_of_min($minimum)

Get a list of the populations at all time points (in chronological order) for a single $minimum.

$record->final_population

Get the last population data record, an object of class Bio::RNA::Treekin::PopulationDataRecord. It contains the population data for all minima at the stop_time.

$record->population($i)

Get the $i-th population data record, an object of class Bio::RNA::Treekin::PopulationDataRecord. $i is a zero-based index in chronological order.

$record->populations

Returns the list of all population data records. Useful for iterating.

$record->add_min

Add a single new minimum with all-zero entries. Data can then be appended to this new min using append_pop_data().

Returns the index of the new minimum.

$record->append_pop_data($pop_data_ref, $append_to_min_ref)

Given a list of population data records $pop_data_ref, append them to the population data of this record.

The columns of the added data can be re-arranged on the fly by providing a mapping $append_to_min_ref (a hash ref) giving for each minimum in $pop_data_ref (key) a minimum in the current population data (value) to which the new minimum should be swapped. If no data is provided for some minimum of this record, its population is set to zero in the newly added entries.

$record->stringify

"$record"

Returns the record as a Treekin file.

AUTHOR

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

BUGS

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

You can also do so by mailing to bug-bio-rna-treekin at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-RNA-Treekin. 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::Treekin

You can also look for information at:

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