File Coverage

blib/lib/BioX/CLPM/Fragments/Simple.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package BioX::CLPM::Fragments::Simple;
2             #use base qw(BioX::CLPM::Base);
3 1     1   1919 use Class::Std;
  0            
  0            
4             use Class::Std::Utils;
5              
6             use warnings;
7             use strict;
8             use Carp;
9              
10             use version; our $VERSION = qv('0.0.1');
11              
12             {
13             my %fragment_id_of :ATTR( :get :set :default<''> :init_arg );
14             my %sequence_id_of :ATTR( :get :set :default<''> :init_arg );
15             my %sequence_of :ATTR( :get :set :default<''> :init_arg );
16             my %mass_of :ATTR( :get :set :default<''> :init_arg );
17             my %counts_of :ATTR( :get :set :default<{}> :init_arg );
18            
19             sub START {
20             my ($self, $ident, $arg_ref) = @_;
21             #if ( defined $arg_ref->{fragment_id} ) { $self->_load( $arg_ref ); }
22             return;
23             }
24              
25             sub _load {
26             my ($self, $ident, $arg_ref) = @_;
27             my $fragment_id = defined $arg_ref->{fragment_id} ?
28             $arg_ref->{fragment_id} :
29             $self->get_fragment_id();
30            
31             if ( defined $arg_ref->{fragment_id} ) {
32             $self->set_fragment_id($fragment_id);
33             }
34            
35             my $sql = 'select sequence_id, sequence, mass ';
36             $sql .= "from fragments where fragment_id = '$fragment_id'";
37             my ( $sequence_id, $sequence, $mass) = $self->data->sqlexec( $sql, '@' );
38             $self->set_sequence_id($sequence_id);
39             $self->set_sequence($sequence);
40             $self->set_mass($mass);
41             }
42             }
43              
44             1; # Magic true value required at end of module
45             __END__