Bio-Community
view release on metacpan or search on metacpan
lib/Bio/Community/IO/Driver/biom.pm view on Meta::CPAN
address it. Please include a thorough description of the problem with code and
data examples if at all possible.
If you have found a bug, please report it on the BioPerl bug tracking system
to help us keep track the bugs and their resolution:
L<https://redmine.open-bio.org/projects/bioperl/>
=head1 COPYRIGHT
Copyright 2011-2014 by Florent Angly <florent.angly@gmail.com>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.
=cut
package Bio::Community::IO::Driver::biom;
use Moose;
use Method::Signatures;
use namespace::autoclean;
use Bio::Community::Member;
use Bio::Community::TaxonomyUtils;
use JSON::XS qw( decode_json encode_json );
use DateTime;
use constant BIOM_NAME => 'Biological Observation Matrix 1.0';
use constant BIOM_URL => 'http://biom-format.org/documentation/format_versions/biom-1.0.html';
use constant BIOM_MATRIX_TYPE => 'sparse'; # sparse or dense
use constant BIOM_TYPE => 'OTU table';
# "XYZ table" where XYZ is Pathway, Gene, Function, Ortholog, Metabolite or Taxon
extends 'Bio::Community::IO';
with 'Bio::Community::Role::IO';
our $multiple_communities = 1; # format supports several communities per file
our $explicit_ids = 1; # IDs are explicitly recorded
our $default_sort_members = 0; # unsorted
our $default_abundance_type = 'count'; # absolute count (positive integer)
our $default_missing_string = 0; # empty members get a '0'
has 'matrix_type' => (
is => 'rw',
isa => 'Maybe[BiomMatrixType]',
required => 0,
init_arg => '-matrix_type',
default => undef,
lazy => 1,
reader => 'get_matrix_type',
writer => 'set_matrix_type',
predicate => '_has_matrix_type',
);
has 'matrix_element_type' => (
is => 'rw',
#isa => 'Str', # either int, float or unicode
required => 0,
init_arg => undef,
default => undef,
lazy => 1,
reader => '_get_matrix_element_type',
writer => '_set_matrix_element_type',
);
has '_json' => (
is => 'rw',
#isa => 'JSON::XS',
required => 0,
init_arg => undef,
default => undef,
lazy => 1,
predicate => '_has_json',
reader => '_get_json',
writer => '_set_json',
);
has '_max_line' => (
is => 'rw',
#isa => 'StrictlyPositiveInt',
required => 0,
init_arg => undef,
lazy => 1,
default => 0,
reader => '_get_max_line',
writer => '_set_max_line',
);
has '_max_col' => (
is => 'rw',
#isa => 'StrictlyPositiveInt',
required => 0,
init_arg => undef,
lazy => 1,
default => 0,
reader => '_get_max_col',
writer => '_set_max_col',
);
has '_line' => (
is => 'rw',
isa => 'PositiveInt',
required => 0,
init_arg => undef,
default => 0,
lazy => 1,
reader => '_get_line',
writer => '_set_line',
);
has '_col' => (
is => 'rw',
( run in 1.766 second using v1.01-cache-2.11-cpan-39bf76dae61 )