-
Notifications
You must be signed in to change notification settings - Fork 2
/
Evidence.pm
executable file
·94 lines (76 loc) · 1.95 KB
/
Evidence.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/local/bin/perl
package Evidence;
use strict;
use Data::Dumper;
sub new {
my $packagename = shift;
my $self = {};
bless ($self, $packagename);
$self->_init();
return ($self);
}
sub _init {
my $self = shift;
$self->{FEAT_NAME} = undef; #string
$self->{FEAT_TYPE} = undef; #string
$self->{METHOD} = undef; #string
$self->{ACCESSION} = undef; #string
$self->{DESCRIPTION} = undef; #string
$self->{PER_ID} = undef; #float
$self->{SCORE} = undef; #float
$self->{E_VALUE} = undef; #float
$self->{ELEMENT_NUM} = undef; #int
$self->{ASMBL_COORDS} = undef; #set to coordset
$self->{MATCH_COORDS} = undef; #set to coordset
$self->{RELATIVE_COORDS} = undef; #set to coordset
$self->{DB_NAME} = undef; #string
$self->{PREDICTION_TOOL}; #string
$self->{EV_CLASS} = undef; #string [SEQUENCE_DB_MATCH | COMPUT_PREDICTION]
}
sub set_evidence_coords {
my $self = shift;
my $coord_type = shift; #[ASMBL_COORDS|MATCH_COORDS|RELATIVE_COORDS]
my ($end5, $end3) = @_;
$self->{$coord_type} = Coordset->new($end5,$end3);
}
sub toString () {
my $self = shift;
my $text = "\n\nEvidence: \n";
foreach my $key (keys %$self) {
my $value = $self->{$key};
unless ($value) { next;}
if ((ref $value) =~ /Coordset/) {
$text .= $value->toString() . "\n";
} else {
$text .= "$key = $value\n";
}
}
return ($text);
}
##########################################################
package Coordset;
use strict;
sub new {
my $packagename = shift;
my $self = {};
bless ($self, $packagename);
if (@_) {
$self->set_coords(@_);
}
return ($self);
}
sub set_coords {
my $self = shift;
my ($end5, $end3) = @_;
$self->{end5} = $end5;
$self->{end3} = $end3;
}
sub get_coords {
my $self = shift;
return ($self->{end5},$self->{end3});
}
sub toString {
my $self = shift;
return ("end5: $self->{end5}, end3: $self->{end3}");
}
1; #EOM