line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NCBIx::Geo::Sample; |
2
|
1
|
|
|
1
|
|
6
|
use base qw(NCBIx::Geo::Base); |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
82
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
6
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use version; our $VERSION = qv('1.0.0'); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
{ |
11
|
|
|
|
|
|
|
my %accn_of :ATTR( :get :set :default<''> :init_arg ); |
12
|
|
|
|
|
|
|
my %data_dir_of :ATTR( :get :set :default<''> :init_arg ); |
13
|
|
|
|
|
|
|
my %transcripts_of :ATTR( :get :set :default<''> :init_arg ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub START { |
16
|
0
|
|
|
0
|
0
|
|
my ($self, $ident, $arg_ref) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
if ( defined $arg_ref->{accn} ) { $self->load_transcripts(); } |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub transcript_ids { |
24
|
0
|
|
|
0
|
0
|
|
my ( $self, $arg_ref ) = @_; |
25
|
0
|
|
|
|
|
|
return join( ';', keys %{ $self->get_transcripts() } ); |
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub value { |
29
|
0
|
|
|
0
|
0
|
|
my ( $self, $arg_ref ) = @_; |
30
|
0
|
0
|
|
|
|
|
my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : ''; |
31
|
0
|
|
|
|
|
|
return $self->get_transcripts()->{$transcript_id}->{value}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub call { |
35
|
0
|
|
|
0
|
0
|
|
my ( $self, $arg_ref ) = @_; |
36
|
0
|
0
|
|
|
|
|
my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : ''; |
37
|
0
|
|
|
|
|
|
return $self->get_transcripts()->{$transcript_id}->{call}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub p_value { |
41
|
0
|
|
|
0
|
0
|
|
my ( $self, $arg_ref ) = @_; |
42
|
0
|
0
|
|
|
|
|
my $transcript_id = defined $arg_ref->{transcript_id} ? $arg_ref->{transcript_id} : ''; |
43
|
0
|
|
|
|
|
|
return $self->get_transcripts()->{$transcript_id}->{p_value}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub load_transcripts { |
47
|
0
|
|
|
0
|
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#(.*) #six; |
57
|
0
|
|
|
|
|
|
$text = $1; |
58
|
0
|
|
|
|
|
|
my @lines = split( /\n/, $text ); |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
foreach my $line ( @lines ) { |
61
|
0
|
0
|
|
|
|
|
if ( $line =~ m/^#/ ) { next; } |
|
0
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
if ( $line =~ m/^ ) { next; } |
|
0
|
|
|
|
|
|
|
63
|
0
|
0
|
|
|
|
|
if ( $line =~ m/^$/ ) { next; } |
|
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; # Magic true value required at end of module |
75
|
|
|
|
|
|
|
__END__ |