Bio::Phylo::Matrices::Character - A character (column) in a matrix


Bio-Phylo documentation Contained in the Bio-Phylo distribution.

Index


Code Index:

NAME

Top

Bio::Phylo::Matrices::Character - A character (column) in a matrix

SYNOPSIS

Top

 # No direct usage

DESCRIPTION

Top

Objects of this type represent a single character in a matrix. By default, a matrix will adjust the number of such objects it requires automatically as its contents grow or shrink. The main function, at present, for objects of this type is to facilitate NeXML serialization of characters and their annotations.

METHODS

Top

SERIALIZERS

to_xml()

Serializes characters to nexml format.

 Type    : Format convertor
 Title   : to_xml
 Usage   : my $xml = $characters->to_xml;
 Function: Converts characters object into a nexml element structure.
 Returns : Nexml block (SCALAR).
 Args    : NONE

SEE ALSO

Top

Bio::Phylo::Matrices::TypeSafeData

This object inherits from Bio::Phylo::Matrices::TypeSafeData, so the methods defined therein are also applicable to characters objects objects.

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.

CITATION

Top

If you use Bio::Phylo in published research, please cite it:

Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63

REVISION

Top

 $Id: Character.pm 1660 2011-04-02 18:29:40Z rvos $


Bio-Phylo documentation Contained in the Bio-Phylo distribution.
package Bio::Phylo::Matrices::Character;
use strict;
use base 'Bio::Phylo::Matrices::TypeSafeData';
use Bio::Phylo::Util::CONSTANT qw'_CHARACTER_ _CHARACTERS_';

sub to_xml {
    my $self = shift;
    if ( my $to = $self->get_type_object ) {
        if ( $to->get_type !~ m/continuous/i ) {
            $self->set_attributes( 'states' => $to->get_xml_id );
        }
    }
    return $self->SUPER::to_xml;
}
sub _validate  { 1 }
sub _container { _CHARACTERS_ }
sub _type      { _CHARACTER_ }
sub _tag       { 'char' }

# podinherit_insert_token

1;