line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BioX::SeqUtils::Promoter::Sequence; |
2
|
|
|
|
|
|
|
#################################################################### |
3
|
|
|
|
|
|
|
# Charles Stephen Embry # |
4
|
|
|
|
|
|
|
# MidSouth Bioinformatics Center # |
5
|
|
|
|
|
|
|
# University of Arkansas Little Rock # |
6
|
|
|
|
|
|
|
#################################################################### |
7
|
1
|
|
|
1
|
|
2248
|
use base qw(BioX::SeqUtils::Promoter::Base); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
157
|
|
8
|
|
|
|
|
|
|
use Class::Std; |
9
|
|
|
|
|
|
|
use Class::Std::Utils; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use warnings; |
12
|
|
|
|
|
|
|
use strict; |
13
|
|
|
|
|
|
|
use Carp; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use version; our $VERSION = qv('0.1.1'); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
{ |
18
|
|
|
|
|
|
|
my %base_list_of :ATTR( :get :set :default<[]> :init_arg ); |
19
|
|
|
|
|
|
|
my %color_list_of :ATTR( :get :set :default<[]> :init_arg ); |
20
|
|
|
|
|
|
|
my %label_of :ATTR( :get |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub BUILD { |
26
|
|
|
|
|
|
|
my ($self, $ident, $arg_ref) = @_; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub START { |
33
|
|
|
|
|
|
|
my ($self, $ident, $arg_ref) = @_; |
34
|
|
|
|
|
|
|
#assigned default value |
35
|
|
|
|
|
|
|
my $sequence = defined $arg_ref->{sequence} ? $arg_ref->{sequence} : ''; |
36
|
|
|
|
|
|
|
#splits a list on every character |
37
|
|
|
|
|
|
|
my @sequence = split('',$sequence); |
38
|
|
|
|
|
|
|
#reference a list |
39
|
|
|
|
|
|
|
$self->set_base_list(\@sequence); |
40
|
|
|
|
|
|
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get_sequence { |
44
|
|
|
|
|
|
|
my ($self, $arg_ref) = @_; |
45
|
|
|
|
|
|
|
my $base_list = $self->get_base_list(); |
46
|
|
|
|
|
|
|
#returns the list of nucleotides as a single string |
47
|
|
|
|
|
|
|
return join('',@$base_list); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_labels { |
51
|
|
|
|
|
|
|
my ($self, $arg_ref) = @_; |
52
|
|
|
|
|
|
|
my $label = $self->get_label(); |
53
|
|
|
|
|
|
|
return join('',@$label); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
sub add_segment { |
56
|
|
|
|
|
|
|
my ($self, $arg_ref) = @_; |
57
|
|
|
|
|
|
|
#takes a sequence and adds it to base_list |
58
|
|
|
|
|
|
|
my $sequence = defined $arg_ref->{sequence} ? $arg_ref->{sequence} : ''; |
59
|
|
|
|
|
|
|
my @sequence = split('',$sequence); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $base_list = $self->get_base_list(); |
62
|
|
|
|
|
|
|
my @base_list = @$base_list; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
push @base_list, @sequence; |
65
|
|
|
|
|
|
|
$self->set_base_list(\@base_list); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub set_color { |
69
|
|
|
|
|
|
|
my ($self, $arg_ref) = @_; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $bases = defined $arg_ref->{bases} ? $arg_ref->{bases} : ''; |
72
|
|
|
|
|
|
|
my $colors = defined $arg_ref->{colors} ? $arg_ref->{colors} : ''; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my $color_list = $self->get_color_list({colors => $colors}); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my $count = @$bases; |
77
|
|
|
|
|
|
|
for (my $i = 0; $i< $count; $i++) { |
78
|
|
|
|
|
|
|
my $base = $bases->[$i]; |
79
|
|
|
|
|
|
|
my $color = $colors->[$i]; |
80
|
|
|
|
|
|
|
$color_list->[$base] = $color; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
$self->set_color_list($color_list); |
85
|
|
|
|
|
|
|
#color list will be used to give each character from a mulitple alignment file a color |
86
|
|
|
|
|
|
|
return; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub add_tag { |
90
|
|
|
|
|
|
|
my ($self, $arg_ref) = @_; |
91
|
|
|
|
|
|
|
my $tag = defined $arg_ref->{tag} ? $arg_ref->{tag} : ''; |
92
|
|
|
|
|
|
|
my @tag = split('',$tag); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
my $label = $self->get_label(); |
95
|
|
|
|
|
|
|
my @label = @$label; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
push @label, @tag; |
98
|
|
|
|
|
|
|
$self->set_label(\@label); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
105
|
|
|
|
|
|
|
__END__ |