File Coverage

blib/lib/Bio/Phylo/Matrices/Characters.pm
Criterion Covered Total %
statement 15 23 65.2
branch n/a
condition n/a
subroutine 7 9 77.7
pod 1 1 100.0
total 23 33 69.7


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