File Coverage

blib/lib/Bio/ViennaNGS/FeatureChain.pm
Criterion Covered Total %
statement 12 24 50.0
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 0 2 0.0
total 16 36 44.4


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