| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package BioX::CLPM::Linker; |
|
2
|
1
|
|
|
1
|
|
1564
|
use base qw(BioX::CLPM::Base); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
87
|
|
|
3
|
|
|
|
|
|
|
use Class::Std; |
|
4
|
|
|
|
|
|
|
use Class::Std::Utils; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use warnings; |
|
7
|
|
|
|
|
|
|
use strict; |
|
8
|
|
|
|
|
|
|
use Carp; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use version; our $VERSION = qv('0.0.1'); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
{ |
|
13
|
|
|
|
|
|
|
my %linker_id_of :ATTR( :get :set :default<''> :init_arg ); |
|
14
|
|
|
|
|
|
|
my %name_of :ATTR( :get :set :default<''> :init_arg ); |
|
15
|
|
|
|
|
|
|
my %end1_of :ATTR( :get :set :default<''> :init_arg ); |
|
16
|
|
|
|
|
|
|
my %end2_of :ATTR( :get :set :default<''> :init_arg ); |
|
17
|
|
|
|
|
|
|
my %mass_of :ATTR( :get :set :default<''> :init_arg ); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# API |
|
20
|
|
|
|
|
|
|
sub ends { |
|
21
|
|
|
|
|
|
|
my ( $self ) = @_; |
|
22
|
|
|
|
|
|
|
return ( $self->get_end1(), $self->get_end2() ); |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# PRIV |
|
26
|
|
|
|
|
|
|
sub START { |
|
27
|
|
|
|
|
|
|
my ($self, $ident, $arg_ref) = @_; |
|
28
|
|
|
|
|
|
|
if ( $arg_ref ) { $self->_load( $arg_ref ); } |
|
29
|
|
|
|
|
|
|
return; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# PRIV |
|
33
|
|
|
|
|
|
|
sub _load { |
|
34
|
|
|
|
|
|
|
my ( $self, $arg_ref ) = @_; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Update new linker_id if exists |
|
37
|
|
|
|
|
|
|
if ( defined $arg_ref->{linker_id} ) { |
|
38
|
|
|
|
|
|
|
my $linker_id = $arg_ref->{linker_id}; |
|
39
|
|
|
|
|
|
|
$self->set_linker_id($linker_id); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Load other linker data from db |
|
42
|
|
|
|
|
|
|
my $sql = 'select name, end1, end2, mass '; |
|
43
|
|
|
|
|
|
|
$sql .= "from linkers where linker_id = '$linker_id'"; |
|
44
|
|
|
|
|
|
|
my ( $name, $end1, $end2, $mass ) = $self->sqlexec( $sql, '@' ); |
|
45
|
|
|
|
|
|
|
warn "LINKER _load() id $linker_id ( $name, $end1, $end2, $mass ) \n"; |
|
46
|
|
|
|
|
|
|
$self->set_name( $name ); |
|
47
|
|
|
|
|
|
|
$self->set_end1( $end1 ); |
|
48
|
|
|
|
|
|
|
$self->set_end2( $end2 ); |
|
49
|
|
|
|
|
|
|
$self->set_mass( $mass ); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
elsif ( defined $arg_ref->{linker_name} ) { |
|
52
|
|
|
|
|
|
|
my $linker_name = $arg_ref->{linker_name}; |
|
53
|
|
|
|
|
|
|
warn "LINKER _load() name $linker_name \n"; |
|
54
|
|
|
|
|
|
|
$self->set_name($linker_name); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Load other linker data from db |
|
57
|
|
|
|
|
|
|
my $sql = 'select name, end1, end2, mass '; |
|
58
|
|
|
|
|
|
|
$sql .= "from linkers where name = '$linker_name'"; |
|
59
|
|
|
|
|
|
|
my ( $linker_id, $end1, $end2, $mass ) = $self->sqlexec( $sql, '@' ); |
|
60
|
|
|
|
|
|
|
warn " ( $linker_id, $end1, $end2, $mass ) \n"; |
|
61
|
|
|
|
|
|
|
$self->set_linker_id( $linker_id ); |
|
62
|
|
|
|
|
|
|
$self->set_end1( $end1 ); |
|
63
|
|
|
|
|
|
|
$self->set_end2( $end2 ); |
|
64
|
|
|
|
|
|
|
$self->set_mass( $mass ); |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
|
71
|
|
|
|
|
|
|
__END__ |