Geo/Sample.pm

filter: Statementstmt 37.5% 21 / 56 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 6 totaltotal 29.8% 26 / 87 CC 9 SCAR 23.8
CC
9
Cov
30%
load_transcripts
30.0
START
6.0
value
6.0
CRAP 10.8
« Geo/Base.pm ↑ Summary Geo/Item.pm »
1 package NCBIx::Geo::Sample;
2 1 ▶use base qw(NCBIx::Geo::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use version; our $VERSION = qv('1.0.0');
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 {
11 1 my %accn_of :ATTR( :get<accn> :set<accn> :default<''> :init_arg<accn> );
12 1 my %data_dir_of :ATTR( :get<data_dir> :set<data_dir> :default<''> :init_arg<data_dir> );
13 1 my %transcripts_of :ATTR( :get<transcripts> :set<transcripts> :default<''> :init_arg<transcripts> );
14
15 0 ▶ sub START {
Subroutine START: not called CC=2 SCAR=17.9
Pod undocumented
16 0 my ($self, $ident, $arg_ref) = @_;
17
18 0 ▶ if ( defined $arg_ref->{accn} ) { $self->load_transcripts(); }
Branch: 1 branch
BranchTrueFalseTotal
if (defined $arg_ref->{"accn"}) 0 0 0
19  
20 0 return;
21 }
22  
23 0 ▶ sub transcript_ids {
Subroutine transcript_ids: not called CC=1 SCAR=6.9
Pod undocumented
24 0 my ( $self, $arg_ref ) = @_;
25 0 return join( ';', keys %{ $self->get_transcripts() } );
26 }
27  
28 0 ▶ sub value {
Subroutine value: not called CC=2 SCAR=17.9
Pod undocumented
29 0 my ( $self, $arg_ref ) = @_;
30 0 ▶ my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : '';
Branch: 1 branch
BranchTrueFalseTotal
defined $arg_ref->{'transcript_id'} ? : 0 0 0
31 0 return $self->get_transcripts()->{$transcript_id}->{value};
32 }
33  
34 0 ▶ sub call {
Subroutine call: not called CC=2 SCAR=17.9
Pod undocumented
35 0 my ( $self, $arg_ref ) = @_;
36 0 ▶ my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : '';
Branch: 1 branch
BranchTrueFalseTotal
defined $arg_ref->{'transcript_id'} ? : 0 0 0
37 0 return $self->get_transcripts()->{$transcript_id}->{call};
38 }
39  
40 0 ▶ sub p_value {
Subroutine p_value: not called CC=2 SCAR=17.9
Pod undocumented
41 0 my ( $self, $arg_ref ) = @_;
42 0 ▶ my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : '';
Branch: 1 branch
BranchTrueFalseTotal
defined $arg_ref->{'transcript_id'} ? : 0 0 0
43 0 return $self->get_transcripts()->{$transcript_id}->{p_value};
44 }
45  
46 0 ▶ sub load_transcripts {
Subroutine load_transcripts: not called CC=5 SCAR=34.0
Pod undocumented
47 0 my ( $self, $arg_ref ) = @_;
48 0 my $sample_accn = $self->get_accn();
49 0 my $transcripts = {};
50  
51 # Calculate call data file_name and file_path_name
52 0 my $file = $sample_accn . '.html';
53 0 my $path_name = $self->get_data_dir() . $file;
54  
55 0 my $text = $self->_get_file_text({ file => $path_name });
56 0 $text =~ m#<pre>(.*)</pre>#six;
57 0 $text = $1;
58 0 my @lines = split( /\n/, $text );
59  
60 0 foreach my $line ( @lines ) {
61 0 ▶ if ( $line =~ m/^#/ ) { next; }
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^#/) 0 0 0
62 0 ▶ if ( $line =~ m/^</ ) { next; }
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^</) 0 0 0
63 0 ▶ if ( $line =~ m/^$/ ) { next; }
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^$/) 0 0 0
64  
65 0 my ( $transcript_id, $value, $call, $p_value ) = split( /\t/, $line );
66 0 $transcripts->{ $transcript_id } = { value => $value, call => $call, p_value => $p_value };
67 }
68  
69 0 $self->set_transcripts( $transcripts );
70 }
71  
72 }
73  
74 1 1; # Magic true value required at end of module
75 __END__
« Geo/Base.pm ↑ Summary Geo/Item.pm »