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

NAME

Bio::Polloc::RuleIO - I/O interface for the sets of rules (Bio::Polloc::RuleI)

AUTHOR - Luis M. Rodriguez-R

Email lmrodriguezr at gmail dot com

IMPLEMENTS OR EXTENDS

PUBLIC METHODS

Methods provided by the package

new

The basic initialization method

Arguments

The same arguments of Bio::Polloc::Polloc::IO, plus:

-format

The format of the file

prefix_id

Sets/gets the prefix ID, unique for the RuleSet

Purpose

To allow the identification of children in a unique namespace

Arguments

A string, supposedly unique. Any colon (:) will be changed to '_'

Returns

The prefix ID.

init_id

format

add_rule

Appends rules to the rules set.

Arguments

One or more Bio::Polloc::RuleI objects

Returns

The index of the last rule

Throws

A Bio::Polloc::Polloc::Error exception if some object is not a Bio::Polloc::RuleI

get_rule

Gets the rule at the given index

Arguments

The index (int)

Returns

A Bio::Polloc::RuleI object or undef

get_rules

next_rule

Returns

A Bio::Polloc::RuleI object

groupcriteria

Sets/gets the group criteria objects.

Arguments

A Bio::Polloc::GroupCriteria array ref (optional)

Returns

A Bio::Polloc::GroupCriteria array ref or undef

grouprules

Alias of groupcriteria() (for backwards-compatibility).

addgrouprules

Adds a grouprules object

Arguments

A Bio::Polloc::GroupCriteria object

Throws

A Bio::Polloc::Polloc::Error if not a proper object

execute

Executes the executable rules only over the whole list of genomes

Arguments

Any argument supported/required by the rules, plus:

-advance "sub ref"

A reference to a method to be called to report the advance of the execution. The method must accept four arguments, namely:

  1. The number of loci detected so far

  2. The number of genomes scanned so far

  3. The total number of genomes to scan

  4. The ID of the running rule

Returns

A Bio::Polloc::LociGroup object.

safe_value

Sets/gets a parameter of arbitrary name and value

Purpose

To provide a safe interface for setting values from the parsed file

Arguments

-param

The parameter's name (case insensitive)

-value

The value of the parameter (optional)

Returns

The value of the parameter or undef

parameter

Purpose

Gets/sets some generic parameter. It is intended to provide an interface between Bio::Polloc::RuleIO's general configuration and Bio::Polloc::RuleI, regardless of the format.

Arguments

The key (str) and the value (mix, optional)

Returns

The value (mix or undef)

Throws

A Bio::Polloc::Polloc::NotImplementedException if not implemented

read

genomes

Gets/sets the genomes to be used as analysis base.

Arguments

A reference to an array of Bio::Polloc::Genome objects.

INTERNAL METHODS

Methods intended to be used only within the scope of Bio::Polloc::*

_register_rule_parse

_increase_index

_next_child_id

_initialize

_qualify_format

_end_rules_loop