NAME
Bio::Phylo::Matrices::Datum - An object-oriented module for storing single observations.
SYNOPSIS
use Bio::Phylo::Matrices::Matrix;
#instantiating a datum object...
my $datum = Bio::Phylo::Matrices::Datum->new(
-name=>'Homo_sapiens,
-type=>DNA,
-desc=>'Cytochrome B, mtDNA',
-pos=>1,
-weight=>2,
-char=>'C'
);
#...and linking it to a taxon object
$datum->set_taxon(Bio::Phylo::Taxa::Taxon->new(-name=>'Homo_sapiens'));
DESCRIPTION
The datum object models a single observation, which can be crossreferenced with a taxon object.
METHODS
CONSTRUCTOR
- new()
-
Type : Constructor Title : new Usage : my $datum = new Bio::Phylo::Matrices::Datum; Function: Instantiates a Bio::Phylo::Matrices::Datum object. Returns : A Bio::Phylo::Matrices::Datum object. Args : none.
MUTATORS
- set_name()
-
Type : Mutator Title : set_name Usage : $datum->set_name($name); Function: Assigns a datums's name (i.e. the name of the taxon it refers to). Returns : Args : $name must not contain [;|,|:|(|)]
- set_taxon()
-
Type : Mutator Title : set_taxon Usage : $datum->set_taxon($taxon); Function: Assigns the taxon a datum refers to. Returns : Args : $taxon must be a Bio::Phylo::Taxa::Taxon object.
- set_desc()
-
Type : Mutator Title : set_desc Usage : $datum->set_desc($desc); Function: Assigns a description of the current datum. Returns : Args : The $desc argument is a string of arbitrary length.
- set_weight()
-
Type : Mutator Title : set_weight Usage : $datum->set_weight($weight); Function: Assigns a datums's weight. Returns : Args : The $weight argument may be a number in any of Perl's number formats.
- set_type()
-
Type : Mutator Title : set_type Usage : $datum->set_type($type); Function: Assigns a datums's type. Returns : Args : $type must be one of [DNA|RNA|STANDARD|PROTEIN| NUCLEOTIDE|CONTINUOUS]. If DNA, RNA or NUCLEOTIDE is defined, the subsequently set char is validated against the IUPAC nucleotide one letter codes. If PROTEIN is defined, the char is validated against IUPAC one letter amino acid codes. Likewise, a STANDARD char has to be a single integer [0-9], while for CONTINUOUS all of Perl's number formats are allowed.
- set_char()
-
Type : Mutator Title : set_char Usage : $datum->set_char($char); Function: Assigns a datums's character value. Returns : Args : The $char argument is checked against the allowed ranges for the various character types: IUPAC nucleotide (for types of DNA|RNA|NUCLEOTIDE), IUPAC single letter amino acid codes (for type PROTEIN), integers (STANDARD) or any of perl's decimal formats (CONTINUOUS).
- set_position()
-
Type : Mutator Title : set_position Usage : $datum->set_position($pos); Function: Assigns a datums's position. Returns : Args : $pos must be an integer.
ACCESSORS
- get_name()
-
Type : Accessor Title : get_name Usage : $name = $datum->get_name(); Function: Retrieves a datums's name (i.e. the name of the taxon it refers to). Returns : SCALAR Args :
- get_taxon()
-
Type : Accessor Title : get_taxon Usage : $taxon = $datum->get_taxon(); Function: Retrieves the taxon a datum refers to. Returns : Phylo::Taxa::Taxon object Args :
- get_desc()
-
Type : Accessor Title : get_desc Usage : $desc = $datum->get_desc(); Function: Retrieves a description of the current datum. Returns : SCALAR Args :
- get_weight()
-
Type : Accessor Title : get_weight Usage : $weight = $datum->get_weight(); Function: Retrieves a datums's weight. Returns : SCALAR Args :
- get_type()
-
Type : Accessor Title : get_type Usage : $type = $datum->get_type(); Function: Retrieves a datums's type. Returns : One of [DNA|RNA|STANDARD|PROTEIN|NUCLEOTIDE|CONTINUOUS] Args :
- get_char()
-
Type : Accessor Title : get_char Usage : $char = $datum->get_char(); Function: Retrieves a datums's character value. Returns : A single character. Args :
- get_position()
-
Type : Accessor Title : get_position Usage : $pos = $datum->get_position(); Function: Retrieves a datums's position. Returns : a SCALAR integer. Args :
CONTAINER
- container()
-
Type : Internal method Title : container Usage : $datum->container; Function: Returns : SCALAR Args :
- container_type()
-
Type : Internal method Title : container_type Usage : $datum->container_type; Function: Returns : SCALAR Args :
AUTHOR
Rutger Vos, <rvosa@sfu.ca>
http://www.sfu.ca/~rvosa/
BUGS
Please report any bugs or feature requests to bug-bio-phylo@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-Phylo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
The author would like to thank Jason Stajich for many ideas borrowed from BioPerl http://www.bioperl.org, and CIPRES http://www.phylo.org and FAB* http://www.sfu.ca/~fabstar for comments and requests.
COPYRIGHT & LICENSE
Copyright 2005 Rutger Vos, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.