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   73 use strict;
  11         24  
  11         363  
3 11     11   218 use base 'Bio::Phylo::Matrices::TypeSafeData';
  11         25  
  11         1438  
4 11     11   72 use Bio::Phylo::Util::CONSTANT qw'_CHARACTERS_ _NONE_';
  11         27  
  11         661  
5 11     11   62 use Bio::Phylo::Factory;
  11         25  
  11         81  
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 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   150 sub _validate { 1 }
52 0     0   0 sub _container { _NONE_ }
53 499     499   1067 sub _type { _CHARACTERS_ }
54 5     5   18 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
65             for any user or developer questions and discussions.
66              
67             =over
68              
69             =item L
70              
71             This object inherits from L, so the
72             methods defined therein are also applicable to characters objects
73             objects.
74              
75             =item L
76              
77             Also see the manual: L and L.
78              
79             =back
80              
81             =head1 CITATION
82              
83             If you use Bio::Phylo in published research, please cite it:
84              
85             B, B, B, B
86             and B, 2011. Bio::Phylo - phyloinformatic analysis using Perl.
87             I B<12>:63.
88             L
89              
90             =cut
91              
92             1;