File Coverage

blib/lib/Bio/Phylo/Matrices/Characters.pm
Criterion Covered Total %
statement 18 26 69.2
branch n/a
condition n/a
subroutine 8 10 80.0
pod 1 1 100.0
total 27 37 72.9


line stmt bran cond sub pod time code
1             package Bio::Phylo::Matrices::Characters;
2 11     11   74 use strict;
  11         25  
  11         327  
3 11     11   57 use warnings;
  11         25  
  11         321  
4 11     11   54 use base 'Bio::Phylo::Matrices::TypeSafeData';
  11         24  
  11         1322  
5 11     11   71 use Bio::Phylo::Util::CONSTANT qw'_CHARACTERS_ _NONE_';
  11         23  
  11         608  
6 11     11   224 use Bio::Phylo::Factory;
  11         25  
  11         68  
7              
8             =head1 NAME
9              
10             Bio::Phylo::Matrices::Characters - Container of character objects
11              
12             =head1 SYNOPSIS
13              
14             # No direct usage
15              
16             =head1 DESCRIPTION
17              
18             Objects of this type hold a list of L<Bio::Phylo::Matrices::Character> objects,
19             i.e. columns in a matrix. By default, a matrix will be initialized to hold
20             one object of this type (which can be retrieved using $matrix->get_characters).
21             Its main function is to facilitate NeXML serialization of matrix objects, though
22             this may expand in the future.
23              
24             =head1 METHODS
25              
26             =head2 SERIALIZERS
27              
28             =over
29              
30             =item to_xml()
31              
32             Serializes characters to nexml format.
33              
34             Type : Format convertor
35             Title : to_xml
36             Usage : my $xml = $characters->to_xml;
37             Function: Converts characters object into a nexml element structure.
38             Returns : Nexml block (SCALAR).
39             Args : NONE
40              
41             =cut
42              
43             sub to_xml {
44 0     0 1 0 my $self = shift;
45 0         0 my $xml = '';
46 0         0 for my $ent ( @{ $self->get_entities } ) {
  0         0  
47 0         0 $xml .= $ent->to_xml;
48             }
49 0         0 $xml .= $self->sets_to_xml;
50 0         0 return $xml;
51             }
52 68     68   135 sub _validate { 1 }
53 0     0   0 sub _container { _NONE_ }
54 499     499   989 sub _type { _CHARACTERS_ }
55 5     5   15 sub _tag { 'chars' }
56              
57             =back
58              
59             =cut
60              
61             # podinherit_insert_token
62              
63             =head1 SEE ALSO
64              
65             There is a mailing list at L<https://groups.google.com/forum/#!forum/bio-phylo>
66             for any user or developer questions and discussions.
67              
68             =over
69              
70             =item L<Bio::Phylo::Matrices::TypeSafeData>
71              
72             This object inherits from L<Bio::Phylo::Matrices::TypeSafeData>, so the
73             methods defined therein are also applicable to characters objects
74             objects.
75              
76             =item L<Bio::Phylo::Manual>
77              
78             Also see the manual: L<Bio::Phylo::Manual> and L<http://rutgervos.blogspot.com>.
79              
80             =back
81              
82             =head1 CITATION
83              
84             If you use Bio::Phylo in published research, please cite it:
85              
86             B<Rutger A Vos>, B<Jason Caravas>, B<Klaas Hartmann>, B<Mark A Jensen>
87             and B<Chase Miller>, 2011. Bio::Phylo - phyloinformatic analysis using Perl.
88             I<BMC Bioinformatics> B<12>:63.
89             L<http://dx.doi.org/10.1186/1471-2105-12-63>
90              
91             =cut
92              
93             1;