File Coverage

blib/lib/Bio/ViennaNGS/FeatureChain.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             # -*-CPerl-*-
2             # Last changed Time-stamp: <2014-12-20 00:32:41 mtw>
3              
4             package Bio::ViennaNGS::FeatureChain;
5              
6 1     1   1387 use 5.12.0;
  1         3  
  1         33  
7 1     1   3 use version; our $VERSION = qv('0.12_07');
  1         1  
  1         4  
8              
9             #use namespace::autoclean;
10 1     1   312 use Moose;
  0            
  0            
11             with 'MooseX::Clone';
12             use MooseX::InstanceTracking;
13              
14             has 'type' => (
15             is => 'rw',
16             isa => 'Str', # [exon,intron,SJ,promoter,TSS,...]
17             );
18              
19             has 'chain' => (
20             is => 'rw',
21             traits => ['Array', 'Clone' => {to=>'ArrayRef'}],
22             isa => 'ArrayRef[Bio::ViennaNGS::Feature]',
23             required => '1',
24             builder => 'build_chain',
25             auto_deref => 1
26             );
27              
28             sub build_chain {
29             my $self = shift;
30             my $featurelist = shift; ## We expect features to be pre-sorted, So
31             ## I simply read in an arrayref of Feature
32             ## Objects
33             return ($featurelist);
34             }
35              
36             sub print_chain{
37             my $self = shift;
38             return 0 if (!$self->chain);
39             my $out;
40             foreach my $feature (@{$self->chain}){
41             $out .= join("\t",
42             "chr".$feature->chromosome,
43             $feature->start,
44             $feature->end,
45             $feature->name,
46             $feature->score,
47             $feature->strand);
48             $out .= "\t".$feature->extension if ($feature->extension);
49             $out .= "\n";
50             }
51             return $out;
52             }
53              
54             #sub clone {
55             # my ( $self, %params ) = @_;
56             # $self->meta->clone_object($self, %params);
57             # return $self;
58             #}
59              
60             no Moose;
61              
62             1;