Variation/AAChange.pm

filter: Statementstmt 86.0% 129 / 150 Branchbran 62.8% 88 / 140 Conditioncond 40.7% 55 / 135 MC/DCmcdc 15.7% 11 / 70 Subroutinesub 100% 9 / 9 Podpod 100% 5 / 5 totaltotal 58.3% 297 / 509 CC 119 SCAR 51.2
CC
119
Cov
64%
label
368.5
trivname
55.5
new
30.0
CRAP 166.6
« Variation/SeqDiff.pm ↑ Summary Variation/IO/flat.pm »
1 #
2 # BioPerl module for Bio::Variation::AAChange
3 #
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 #
6 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
7 #
8 # Copyright Heikki Lehvaslaiho
9 #
10 # You may distribute this module under the same terms as perl itself
11  
12 # POD documentation - main docs before the code
13  
14 =head1 NAME
15  
16 Bio::Variation::AAChange - Sequence change class for polypeptides
17  
18 =head1 SYNOPSIS
19  
20 $aamut = Bio::Variation::AAChange->new
21 ('-start' => $start,
22 '-end' => $end,
23 '-length' => $len,
24 '-proof' => $proof,
25 '-isMutation' => 1,
26 '-mut_number' => $mut_number
27 );
28  
29 my $a1 = Bio::Variation::Allele->new;
30 $a1->seq($ori) if $ori;
31 $aamut->allele_ori($a1);
32 my $a2 = Bio::Variation::Allele->new;
33 $a2->seq($mut) if $mut;
34 $aachange->add_Allele($a2);
35 $aachange->allele_mut($a2);
36  
37 print "\n";
38  
39 # add it to a SeqDiff container object
40 $seqdiff->add_Variant($rnachange);
41  
42 # and create links to and from RNA level variant objects
43 $aamut->RNAChange($rnachange);
44 $rnachange->AAChange($rnachange);
45  
46 =head1 DESCRIPTION
47  
48 The instantiable class Bio::Variation::RNAChange describes basic
49 sequence changes at polypeptide level. It uses methods defined in
50 superclass Bio::Variation::VariantI, see L<Bio::Variation::VariantI>
51 for details.
52  
53 If the variation described by a AAChange object has a known
54 Bio::Variation::RNAAChange object, create the link with method
55 AAChange(). See L<Bio::Variation::AAChange> for more information.
56  
57 =head1 FEEDBACK
58  
59 =head2 Mailing Lists
60  
61 User feedback is an integral part of the evolution of this and other
62 Bioperl modules. Send your comments and suggestions preferably to the
63 Bioperl mailing lists Your participation is much appreciated.
64  
65 bioperl-l@bioperl.org - General discussion
66 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
67  
68 =head2 Support
69  
70 Please direct usage questions or support issues to the mailing list:
71  
72 I<bioperl-l@bioperl.org>
73  
74 rather than to the module maintainer directly. Many experienced and
75 reponsive experts will be able look at the problem and quickly
76 address it. Please include a thorough description of the problem
77 with code and data examples if at all possible.
78  
79 =head2 Reporting Bugs
80  
81 Report bugs to the Bioperl bug tracking system to help us keep track
82 the bugs and their resolution. Bug reports can be submitted via the
83 web:
84  
85 https://github.com/bioperl/bioperl-live/issues
86  
87 =head1 AUTHOR - Heikki Lehvaslaiho
88  
89 Email: heikki-at-bioperl-dot-org
90  
91 =head1 APPENDIX
92  
93 The rest of the documentation details each of the object
94 methods. Internal methods are usually preceded with a _
95  
96 =cut
97  
98  
99 # Let the code begin...
100  
101  
102 package Bio::Variation::AAChange;
103 5 $Bio::Variation::AAChange::VERSION = '1.7.5';
104 5 ▶use vars qw($MATRIX);
Subroutine BEGIN: called CC=1 SCAR=0.0
105 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
106  
107 # Object preamble - inheritance
108  
109 5 ▶use base qw(Bio::Variation::VariantI);
Subroutine BEGIN: called CC=1 SCAR=0.0
110  
111 5 ▶BEGIN {
Subroutine BEGIN: called CC=5 SCAR=16.1
112  
113 5 my $matrix = << "__MATRIX__";
114 # Matrix made by matblas from blosum62.iij
115 # * column uses minimum score
116 # BLOSUM Clustered Scoring Matrix in 1/2 Bit Units
117 # Blocks Database = /data/blocks_5.0/blocks.dat
118 # Cluster Percentage: >= 62
119 # Entropy = 0.6979, Expected = -0.5209
120 A R N D C Q E G H I L K M F P S T W Y V B Z X *
121 A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0 -2 -1 0 -4
122 R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3 -1 0 -1 -4
123 N -2 0 6 1 -3 0 0 0 1 -3 -3 0 -2 -3 -2 1 0 -4 -2 -3 3 0 -1 -4
124 D -2 -2 1 6 -3 0 2 -1 -1 -3 -4 -1 -3 -3 -1 0 -1 -4 -3 -3 4 1 -1 -4
125 C 0 -3 -3 -3 9 -3 -4 -3 -3 -1 -1 -3 -1 -2 -3 -1 -1 -2 -2 -1 -3 -3 -2 -4
126 Q -1 1 0 0 -3 5 2 -2 0 -3 -2 1 0 -3 -1 0 -1 -2 -1 -2 0 3 -1 -4
127 E -1 0 0 2 -4 2 5 -2 0 -3 -3 1 -2 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4
128 G 0 -2 0 -1 -3 -2 -2 6 -2 -4 -4 -2 -3 -3 -2 0 -2 -2 -3 -3 -1 -2 -1 -4
129 H -2 0 1 -1 -3 0 0 -2 8 -3 -3 -1 -2 -1 -2 -1 -2 -2 2 -3 0 0 -1 -4
130 I -1 -3 -3 -3 -1 -3 -3 -4 -3 4 2 -3 1 0 -3 -2 -1 -3 -1 3 -3 -3 -1 -4
131 L -1 -2 -3 -4 -1 -2 -3 -4 -3 2 4 -2 2 0 -3 -2 -1 -2 -1 1 -4 -3 -1 -4
132 K -1 2 0 -1 -3 1 1 -2 -1 -3 -2 5 -1 -3 -1 0 -1 -3 -2 -2 0 1 -1 -4
133 M -1 -1 -2 -3 -1 0 -2 -3 -2 1 2 -1 5 0 -2 -1 -1 -1 -1 1 -3 -1 -1 -4
134 F -2 -3 -3 -3 -2 -3 -3 -3 -1 0 0 -3 0 6 -4 -2 -2 1 3 -1 -3 -3 -1 -4
135 P -1 -2 -2 -1 -3 -1 -1 -2 -2 -3 -3 -1 -2 -4 7 -1 -1 -4 -3 -2 -2 -1 -2 -4
136 S 1 -1 1 0 -1 0 0 0 -1 -2 -2 0 -1 -2 -1 4 1 -3 -2 -2 0 0 0 -4
137 T 0 -1 0 -1 -1 -1 -1 -2 -2 -1 -1 -1 -1 -2 -1 1 5 -2 -2 0 -1 -1 0 -4
138 W -3 -3 -4 -4 -2 -2 -3 -2 -2 -3 -2 -3 -1 1 -4 -3 -2 11 2 -3 -4 -3 -2 -4
139 Y -2 -2 -2 -3 -2 -1 -2 -3 2 -1 -1 -2 -1 3 -3 -2 -2 2 7 -1 -3 -2 -1 -4
140 V 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4 -3 -2 -1 -4
141 B -2 -1 3 4 -3 0 1 -1 0 -3 -4 0 -3 -3 -2 0 -1 -4 -3 -3 4 1 -1 -4
142 Z -1 0 0 1 -3 3 4 -2 0 -3 -3 1 -1 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4
143 X 0 -1 -1 -1 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 0 0 -2 -1 -1 -1 -1 -1 -4
144 * -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1
145 __MATRIX__
146  
147 5 my %blosum = ();
148 5 $matrix =~ /^ +(.+)$/m;
149 5 my @aas = split / +/, $1;
150 5 foreach my $aa (@aas) {
151 120 my $tmp = $aa;
152 120 ▶ $tmp = "\\$aa" if $aa eq '*';
Branch: 1 branch
BranchTrueFalseTotal
if $aa eq "*" 5 115 120
153 120 $matrix =~ /^($tmp) +([-+]?\d.*)$/m;
154 120 ▶ my @scores = split / +/, $2 if defined $2;
Branch: 1 branch
BranchTrueFalseTotal
if defined $2 120 0 120
155 120 my $count = 0;
156 120 foreach my $ak (@aas) {
157 2880 $blosum{$aa}->{$aas[$count]} = $scores[$count];
158 2880 $count++;
159 }
160 }
161 sub _matrix;
162 5 $MATRIX = \%blosum;
163 }
164  
165 14 ▶sub new {
Subroutine new: called CC=23 SCAR=34.0
Pod documented
166 14 my($class,@args) = @_;
167 14 my $self = $class->SUPER::new(@args);
168  
169 14 my ($start, $end, $length, $strand, $primary, $source,
170 $frame, $score, $gff_string,
171 $allele_ori, $allele_mut, $upstreamseq, $dnstreamseq,
172 $label, $status, $proof, $re_changes, $region, $region_value,
173 $region_dist,
174 $numbering, $mut_number, $ismutation) =
175 $self->_rearrange([qw(START
176 END
177 LENGTH
178 STRAND
179 PRIMARY
180 SOURCE
181 FRAME
182 SCORE
183 GFF_STRING
184 ALLELE_ORI
185 ALLELE_MUT
186 UPSTREAMSEQ
187 DNSTREAMSEQ
188 LABEL
189 STATUS
190 PROOF
191 RE_CHANGES
192 REGION
193 REGION_VALUE
194 REGION_DIST
195 NUMBERING
196 MUT_NUMBER
197 ISMUTATION
198 )],@args);
199  
200 14 $self->primary_tag("Variation");
201  
202 14 $self->{ 'alleles' } = [];
203  
204 14 ▶ $start && $self->start($start);
Branch: 1 branch
BranchTrueFalseTotal
$start and $self->start($start) 12 2 14
205 14 ▶ $end && $self->end($end);
Branch: 1 branch
BranchTrueFalseTotal
$end and $self->end($end) 12 2 14
206 14 ▶ $length && $self->length($length);
Branch: 1 branch
BranchTrueFalseTotal
$length and $self->length($length) 12 2 14
207 14 ▶ $strand && $self->strand($strand);
Branch: 1 branch
BranchTrueFalseTotal
$strand and $self->strand($strand) 0 14 14
208 14 ▶ $primary && $self->primary_tag($primary);
Branch: 1 branch
BranchTrueFalseTotal
$primary and $self->primary_tag($primary) 0 14 14
209 14 ▶ $source && $self->source_tag($source);
Branch: 1 branch
BranchTrueFalseTotal
$source and $self->source_tag($source) 0 14 14
210 14 ▶ $frame && $self->frame($frame);
Branch: 1 branch
BranchTrueFalseTotal
$frame and $self->frame($frame) 0 14 14
211 14 ▶ $score && $self->score($score);
Branch: 1 branch
BranchTrueFalseTotal
$score and $self->score($score) 0 14 14
212 14 ▶ $gff_string && $self->_from_gff_string($gff_string);
Branch: 1 branch
BranchTrueFalseTotal
$gff_string and $self->_from_gff_string($gff_string) 0 14 14
213  
214 14 ▶ $allele_ori && $self->allele_ori($allele_ori);
Branch: 1 branch
BranchTrueFalseTotal
$allele_ori and $self->allele_ori($allele_ori) 0 14 14
215 14 ▶ $allele_mut && $self->allele_mut($allele_mut);
Branch: 1 branch
BranchTrueFalseTotal
$allele_mut and $self->allele_mut($allele_mut) 0 14 14
216 14 ▶ $upstreamseq && $self->upstreamseq($upstreamseq);
Branch: 1 branch
BranchTrueFalseTotal
$upstreamseq and $self->upstreamseq($upstreamseq) 0 14 14
217 14 ▶ $dnstreamseq && $self->dnstreamseq($dnstreamseq);
Branch: 1 branch
BranchTrueFalseTotal
$dnstreamseq and $self->dnstreamseq($dnstreamseq) 0 14 14
218  
219 14 ▶ $label && $self->label($label);
Branch: 1 branch
BranchTrueFalseTotal
$label and $self->label($label) 0 14 14
220 14 ▶ $status && $self->status($status);
Branch: 1 branch
BranchTrueFalseTotal
$status and $self->status($status) 0 14 14
221 14 ▶ $proof && $self->proof($proof);
Branch: 1 branch
BranchTrueFalseTotal
$proof and $self->proof($proof) 12 2 14
222 14 ▶ $region && $self->region($region);
Branch: 1 branch
BranchTrueFalseTotal
$region and $self->region($region) 0 14 14
223 14 ▶ $region_value && $self->region_value($region_value);
Branch: 1 branch
BranchTrueFalseTotal
$region_value and $self->region_value($region_value) 0 14 14
224 14 ▶ $region_dist && $self->region_dist($region_dist);
Branch: 1 branch
BranchTrueFalseTotal
$region_dist and $self->region_dist($region_dist) 0 14 14
225 14 ▶ $numbering && $self->numbering($numbering);
Branch: 1 branch
BranchTrueFalseTotal
$numbering and $self->numbering($numbering) 0 14 14
226 14 ▶ $mut_number && $self->mut_number($mut_number);
Branch: 1 branch
BranchTrueFalseTotal
$mut_number and $self->mut_number($mut_number) 12 2 14
227 14 ▶ $ismutation && $self->isMutation($ismutation);
Branch: 1 branch
BranchTrueFalseTotal
$ismutation and $self->isMutation($ismutation) 0 14 14
228  
229 14 return $self; # success - we hope!
230 }
231  
232 =head2 RNAChange
233  
234 Title : RNAChange
235 Usage : $mutobj = $self->RNAChange;
236 : $mutobj = $self->RNAChange($objref);
237 Function: Returns or sets the link-reference to a mutation/change object.
238 If there is no link, it will return undef
239 Returns : an obj_ref or undef
240  
241 =cut
242  
243 46 ▶sub RNAChange {
Subroutine RNAChange: called CC=4 SCAR=15.2
Pod documented
244 46 my ($self,$value) = @_;
245 46 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 13 33 46
246 13 ▶ if( ! $value->isa('Bio::Variation::RNAChange') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $value->isa('Bio::Variation::RNAChange')) { } 0 13 13
247 0 $self->throw("Is not a Bio::Variation::RNAChange object but a [$self]");
248 0 return;
249 }
250 else {
251 13 $self->{'RNAChange'} = $value;
252 }
253 }
254 46 ▶ unless (exists $self->{'RNAChange'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'RNAChange'}) { } 46 0 46
255 0 return;
256 } else {
257 46 return $self->{'RNAChange'};
258 }
259 }
260  
261  
262  
263 =head2 label
264  
265 Title : label
266 Usage : $obj->label();
267 Function:
268  
269 Sets and returns mutation event label(s). If value is not
270 set, or no argument is given returns false. Each
271 instantiable subclass of L<Bio::Variation::VariantI> needs
272 to implement this method. Valid values are listed in
273 'Mutation event controlled vocabulary' in
274 http://www.ebi.ac.uk/mutations/recommendations/mutevent.html.
275  
276 Example :
277 Returns : string
278 Args : string
279  
280 =cut
281  
282  
283 14 ▶sub label {
Subroutine label: called CC=50 SCAR=59.1
Pod documented
284 14 my ($self) = @_;
285 14 my ($o, $m, $type);
286 14 ▶ $o = $self->allele_ori->seq if $self->allele_ori and $self->allele_ori->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $self->allele_ori and $self->allele_ori->seq 14 0 14
Condition33%1/3
$self->allele_ori and $self->allele_ori->seq
!ll&&!rl&&r
0014
MC/DC0%0/2
$self->allele_ori and $self->allele_ori->seq
$self->allele_ori $self->allele_ori->seq
Truth table33%1/3
A and B
A= $self->allele_oriB= $self->allele_ori->seq
ABresult
0X0
100
111
287 14 ▶ $m = $self->allele_mut->seq if $self->allele_mut and $self->allele_mut->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $self->allele_mut and $self->allele_mut->seq 13 1 14
Condition66%2/3
$self->allele_mut and $self->allele_mut->seq
!ll&&!rl&&r
0113
MC/DC50%1/2
$self->allele_mut and $self->allele_mut->seq
$self->allele_mut $self->allele_mut->seq
Truth table66%2/3
A and B
A= $self->allele_mutB= $self->allele_mut->seq
ABresult
0X0
100
111
288  
289 14 ▶ if ($self->start == 1 ) {
Branch: 8 branches
BranchTrueFalseTotal
if ($self->start == 1) { } 0 14 14
elsif ($o and substr($o, 0, 1) eq '*') { } 0 14 14
elsif ($o and $m and $o eq $m) { } 0 14 14
elsif ($m and $m eq '*') { } 2 12 14
elsif ($o and $m and $o eq $m) { } 0 12 12
elsif (not $m or $o and $m and length $o > length $m and substr($m, -1, 1) ne '*') { } 1 11 12
elsif (not $o or $o and $m and length $o < length $m and substr($m, -1, 1) ne '*') { } 1 10 11
elsif ($o and $m and $o ne $m and length $o == 1 and length $m == 1) { } 7 3 10
290 0 ▶ if ($o and substr($o, 0, 1) ne substr($m, 0, 1)) {
Branch: 2 branches
BranchTrueFalseTotal
if ($o and substr($o, 0, 1) ne substr($m, 0, 1)) { } 0 0 0
elsif ($o and $m and $o eq $m) { } 0 0 0
Condition0%0/3
$o and substr($o, 0, 1) ne substr($m, 0, 1)
!ll&&!rl&&r
000
MC/DC0%0/2
$o and substr($o, 0, 1) ne substr($m, 0, 1)
$o substr($o, 0, 1) ne substr($m, 0, 1)
Truth table0%0/3
A and B
A= $oB= substr($o, 0, 1) ne substr($m, 0, 1)
ABresult
0X0
100
111
291 0 $type = 'no translation';
292 }
293 ▶ elsif ($o and $m and $o eq $m ) {
Condition0%0/6
$o and $m and $o eq $m
!ll&&!rl&&r
000
$o and $m
!ll&&!rl&&r
000
MC/DC0%0/3
$o and $m and $o eq $m
$o $m $o eq $m
Truth table0%0/4
A and B and C
A= $oB= $mC= $o eq $m
ABCresult
0XX0
10X0
1100
1111
294 0 $type = 'silent';
295 }
296 # more ...
297 }
298 ▶ elsif ($o and substr($o, 0, 1) eq '*' ) {
Condition33%1/3
$o and substr($o, 0, 1) eq "*"
!ll&&!rl&&r
0140
MC/DC0%0/2
$o and substr($o, 0, 1) eq "*"
$o substr($o, 0, 1) eq "*"
Truth table33%1/3
A and B
A= $oB= substr($o, 0, 1) eq "*"
ABresult
0X0
100
111
299 0 ▶ if ($m and substr($o, 0, 1) ne substr($m, 0, 1)) {
Branch: 2 branches
BranchTrueFalseTotal
if ($m and substr($o, 0, 1) ne substr($m, 0, 1)) { } 0 0 0
elsif ($m and $o eq $m) { } 0 0 0
Condition0%0/3
$m and substr($o, 0, 1) ne substr($m, 0, 1)
!ll&&!rl&&r
000
MC/DC0%0/2
$m and substr($o, 0, 1) ne substr($m, 0, 1)
$m substr($o, 0, 1) ne substr($m, 0, 1)
Truth table0%0/3
A and B
A= $mB= substr($o, 0, 1) ne substr($m, 0, 1)
ABresult
0X0
100
111
300 0 $type = 'post-elongation';
301 }
302 ▶ elsif ($m and $o eq $m ) {
Condition0%0/3
$m and $o eq $m
!ll&&!rl&&r
000
MC/DC0%0/2
$m and $o eq $m
$m $o eq $m
Truth table0%0/3
A and B
A= $mB= $o eq $m
ABresult
0X0
100
111
303 0 $type = 'silent, conservative';
304 }
305 }
306 ▶ elsif ($o and $m and $o eq $m) {
Condition66%4/6
$o and $m and $o eq $m
!ll&&!rl&&r
1130
$o and $m
!ll&&!rl&&r
0113
MC/DC0%0/3
$o and $m and $o eq $m
$o $m $o eq $m
Truth table50%2/4
A and B and C
A= $oB= $mC= $o eq $m
ABCresult
0XX0
10X0
1100
1111
307 0 $type = 'silent, conservative';
308 }
309 ▶ elsif ($m and $m eq '*') {
Condition100%3/3
$m and $m eq "*"
!ll&&!rl&&r
1112
MC/DC100%2/2
$m and $m eq "*"
$m $m eq "*"
Truth table100%3/3
A and B
A= $mB= $m eq "*"
ABresult
0X0
100
111
310 2 $type = 'truncation';
311 }
312 ▶ elsif ($o and $m and $o eq $m) {
Condition66%4/6
$o and $m and $o eq $m
!ll&&!rl&&r
1110
$o and $m
!ll&&!rl&&r
0111
MC/DC0%0/3
$o and $m and $o eq $m
$o $m $o eq $m
Truth table50%2/4
A and B and C
A= $oB= $mC= $o eq $m
ABCresult
0XX0
10X0
1100
1111
313 0 $type = 'silent, conservative';
314 }
315 ▶ elsif (not $m or
Condition41%5/12
not $m or $o and $m and length $o > length $m and substr($m, -1, 1) ne "*"
l!l&&r!l&&!r
1011
$o and $m and length $o > length $m and substr($m, -1, 1) ne "*"
!ll&&!rl&&r
1100
$o and $m and length $o > length $m
!ll&&!rl&&r
0110
$o and $m
!ll&&!rl&&r
0011
MC/DC20%1/5
not $m or $o and $m and length $o > length $m and substr($m, -1, 1) ne "*"
not $m $o $m length $o > length $m substr($m, -1, 1) ne "*"
Truth table33%2/6
not(A) or B and C and D and E
A= not $mB= $oC= $mD= length $o > length $mE= substr($m, -1, 1) ne "*"
ABCDEresult
1XXXX1
011111
00XXX0
010XX0
0110X0
011100
316 ($o and $m and length($o) > length($m) and
317 substr($m, -1, 1) ne '*')) {
318 1 $type = 'deletion';
319 1 ▶ if ($o and $m and $o !~ $m and $o !~ $m) {
Branch: 1 branch
BranchTrueFalseTotal
if ($o and $m and not $o =~ /$m/ and not $o =~ /$m/) 0 1 1
Condition33%3/9
$o and $m and not $o =~ /$m/ and not $o =~ /$m/
!ll&&!rl&&r
100
$o and $m and not $o =~ /$m/
!ll&&!rl&&r
100
$o and $m
!ll&&!rl&&r
010
MC/DC0%0/4
$o and $m and not $o =~ /$m/ and not $o =~ /$m/
$o $m not $o =~ /$m/ not $o =~ /$m/
Truth table20%1/5
A and B and not(C) and not(D)
A= $oB= $mC= not $o =~ /$m/D= not $o =~ /$m/
ABCDresult
0XXX0
10XX0
110X0
11100
11111
320 0 $type .= ', complex';
321 }
322 }
323 ▶ elsif (not $o or
Condition66%8/12
not $o or $o and $m and length $o < length $m and substr($m, -1, 1) ne "*"
l!l&&r!l&&!r
0110
$o and $m and length $o < length $m and substr($m, -1, 1) ne "*"
!ll&&!rl&&r
731
$o and $m and length $o < length $m
!ll&&!rl&&r
074
$o and $m
!ll&&!rl&&r
0011
MC/DC40%2/5
not $o or $o and $m and length $o < length $m and substr($m, -1, 1) ne "*"
not $o $o $m length $o < length $m substr($m, -1, 1) ne "*"
Truth table50%3/6
not(A) or B and C and D and E
A= not $oB= $oC= $mD= length $o < length $mE= substr($m, -1, 1) ne "*"
ABCDEresult
1XXXX1
011111
00XXX0
010XX0
0110X0
011100
324 ($o and $m and length($o) < length($m) and
325 substr($m, -1, 1) ne '*' ) ) {
326 1 $type = 'insertion';
327 1 ▶ if ($o and $m and $o !~ $m and $o !~ $m) {
Branch: 1 branch
BranchTrueFalseTotal
if ($o and $m and not $o =~ /$m/ and not $o =~ /$m/) 1 0 1
Condition33%3/9
$o and $m and not $o =~ /$m/ and not $o =~ /$m/
!ll&&!rl&&r
001
$o and $m and not $o =~ /$m/
!ll&&!rl&&r
001
$o and $m
!ll&&!rl&&r
001
MC/DC0%0/4
$o and $m and not $o =~ /$m/ and not $o =~ /$m/
$o $m not $o =~ /$m/ not $o =~ /$m/
Truth table20%1/5
A and B and not(C) and not(D)
A= $oB= $mC= not $o =~ /$m/D= not $o =~ /$m/
ABCDresult
0XXX0
10XX0
110X0
11100
11111
328 1 $type .= ', complex';
329 }
330 }
331 ▶ elsif ($o and $m and $o ne $m and
Condition41%5/12
$o and $m and $o ne $m and length $o == 1 and length $m == 1
!ll&&!rl&&r
037
$o and $m and $o ne $m and length $o == 1
!ll&&!rl&&r
0010
$o and $m and $o ne $m
!ll&&!rl&&r
0010
$o and $m
!ll&&!rl&&r
0010
MC/DC20%1/5
$o and $m and $o ne $m and length $o == 1 and length $m == 1
$o $m $o ne $m length $o == 1 length $m == 1
Truth table33%2/6
A and B and C and D and E
A= $oB= $mC= $o ne $mD= length $o == 1E= length $m == 1
ABCDEresult
0XXXX0
10XXX0
110XX0
1110X0
111100
111111
332 length $o == 1 and length $m == 1 ) {
333 7 $type = 'substitution';
334 7 my $value = $self->similarity_score;
335 7 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 7 0 7
336 7 ▶ my $cons = ($value < 0) ? 'nonconservative' : 'conservative';
Branch: 1 branch
BranchTrueFalseTotal
$value < 0 ? : 2 5 7
337 7 $type .= ", ". $cons;
338 }
339 } else {
340 3 $type = 'out-of-frame translation, truncation';
341 }
342 14 $self->{'label'} = $type;
343 14 return $self->{'label'};
344 }
345  
346  
347 =head2 similarity_score
348  
349 Title : similarity_score
350 Usage : $self->similarity_score
351 Function: Measure for evolutionary conservativeness
352 of single amino substitutions. Uses BLOSUM62.
353 Negative numbers are noncoservative changes.
354 Returns : integer, undef if not single amino acid change
355  
356 =cut
357  
358 8 ▶sub similarity_score {
Subroutine similarity_score: called CC=11 SCAR=32.1
Pod documented
359 8 my ($self) = @_;
360 8 my ($o, $m, $type);
361 8 ▶ $o = $self->allele_ori->seq if $self->allele_ori and $self->allele_ori->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $self->allele_ori and $self->allele_ori->seq 8 0 8
Condition33%1/3
$self->allele_ori and $self->allele_ori->seq
!ll&&!rl&&r
008
MC/DC0%0/2
$self->allele_ori and $self->allele_ori->seq
$self->allele_ori $self->allele_ori->seq
Truth table33%1/3
A and B
A= $self->allele_oriB= $self->allele_ori->seq
ABresult
0X0
100
111
362 8 ▶ $m = $self->allele_mut->seq if $self->allele_mut and $self->allele_mut->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $self->allele_mut and $self->allele_mut->seq 8 0 8
Condition33%1/3
$self->allele_mut and $self->allele_mut->seq
!ll&&!rl&&r
008
MC/DC0%0/2
$self->allele_mut and $self->allele_mut->seq
$self->allele_mut $self->allele_mut->seq
Truth table33%1/3
A and B
A= $self->allele_mutB= $self->allele_mut->seq
ABresult
0X0
100
111
363 8 ▶ return unless $o and $m and length $o == 1 and length $m == 1;
Branch: 1 branch
BranchTrueFalseTotal
unless $o and $m and length $o == 1 and length $m == 1 0 8 8
Condition33%3/9
$o and $m and length $o == 1 and length $m == 1
!ll&&!rl&&r
008
$o and $m and length $o == 1
!ll&&!rl&&r
008
$o and $m
!ll&&!rl&&r
008
MC/DC0%0/4
$o and $m and length $o == 1 and length $m == 1
$o $m length $o == 1 length $m == 1
Truth table20%1/5
A and B and C and D
A= $oB= $mC= length $o == 1D= length $m == 1
ABCDresult
0XXX0
10XX0
110X0
11100
11111
364 8 ▶ return unless $o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i and
Branch: 1 branch
BranchTrueFalseTotal
unless $o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i and $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i 0 8 8
Condition33%1/3
$o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i and $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i
!ll&&!rl&&r
008
MC/DC0%0/2
$o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i and $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i
$o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i
Truth table33%1/3
A and B
A= $o =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/iB= $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i
ABresult
0X0
100
111
365 $m =~ /[ARNDCQEGHILKMFPSTWYVBZX*]/i;
366 8 return $MATRIX->{"\U$o"}->{"\U$m"};
367 }
368  
369 =head2 trivname
370  
371 Title : trivname
372 Usage : $self->trivname
373 Function:
374  
375 Given a Bio::Variation::AAChange object with linked
376 Bio::Variation::RNAChange and Bio::Variation::DNAMutation
377 objects, this subroutine creates a string corresponding to
378 the 'trivial name' of the mutation. Trivial name is
379 specified in Antonorakis & MDI Nomenclature Working Group:
380 Human Mutation 11:1-3, 1998.
381  
382 Returns : string
383  
384 =cut
385  
386  
387 14 ▶sub trivname {
Subroutine trivname: called CC=31 SCAR=40.2
Pod documented
388 14 my ($self,$value) = @_;
389 14 ▶ if( defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 14 14
390 0 $self->{'trivname'} = $value;
391 } else {
392 14 my ( $aaori, $aamut,$aamutsymbol, $aatermnumber, $aamutterm) =
393 ('', '', '', '', '');
394 14 ▶ my $o = $self->allele_ori->seq if $self->allele_ori and $self->allele_ori->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $self->allele_ori and $self->allele_ori->seq 14 0 14
Condition33%1/3
$self->allele_ori and $self->allele_ori->seq
!ll&&!rl&&r
0014
MC/DC0%0/2
$self->allele_ori and $self->allele_ori->seq
$self->allele_ori $self->allele_ori->seq
Truth table33%1/3
A and B
A= $self->allele_oriB= $self->allele_ori->seq
ABresult
0X0
100
111
395 #my $m = $self->allele_mut->seq if $self->allele_mut and $self->allele_mut->seq;
396  
397 14 ▶ $aaori = substr ($o, 0, 1) if $o;
Branch: 1 branch
BranchTrueFalseTotal
if $o 14 0 14
398 14 $aaori =~ tr/\*/X/;
399  
400 14 my $sep;
401 14 ▶ if ($self->isMutation) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->isMutation) { } 12 2 14
402 12 $sep = '>';
403 } else {
404 2 $sep = '|';
405 }
406 14 my $trivname = $aaori. $self->start;
407 14 ▶ $trivname .= $sep if $sep eq '|';
Branch: 1 branch
BranchTrueFalseTotal
if $sep eq "|" 2 12 14
408  
409 14 my @alleles = $self->each_Allele;
410 14 foreach my $allele (@alleles) {
411 15 ▶ my $m = $allele->seq if $allele->seq;
Branch: 1 branch
BranchTrueFalseTotal
if $allele->seq 14 1 15
412  
413 15 $self->allele_mut($allele);
414 #$trivname .= $sep. uc $m if $m;
415  
416 15 ▶ $aamutterm = substr ($m, -1, 1) if $m;
Branch: 1 branch
BranchTrueFalseTotal
if $m 14 1 15
417 15 ▶ if ($self->RNAChange->label =~ /initiation codon/ and
Branch: 6 branches
BranchTrueFalseTotal
if ($self->RNAChange->label =~ /initiation codon/ and ($o and $m and $o ne $m)) { } 0 15 15
elsif (length $o == 1 and length $m == 1) { } 10 5 15
elsif ($self->RNAChange->label =~ /deletion/) { } 2 3 5
elsif ($self->RNAChange->label =~ /insertion/) { } 2 1 3
elsif ($self->RNAChange->label =~ /complex/) { } 1 0 1
elsif ($self->label =~ /truncation/) { } 0 0 0
Condition11%1/9
$self->RNAChange->label =~ /initiation codon/ and ($o and $m and $o ne $m)
!ll&&!rl&&r
1500
$o and $m and $o ne $m
!ll&&!rl&&r
000
$o and $m
!ll&&!rl&&r
000
MC/DC0%0/4
$self->RNAChange->label =~ /initiation codon/ and ($o and $m and $o ne $m)
$self->RNAChange->label =~ /initiation codon/ $o $m $o ne $m
Truth table20%1/5
A and B and C and D
A= $self->RNAChange->label =~ /initiation codon/B= $oC= $mD= $o ne $m
ABCDresult
0XXX0
10XX0
110X0
11100
11111
418 ( $o and $m and $o ne $m)) {
419 0 $aamut = 'X';
420 }
421 ▶ elsif (CORE::length($o) == 1 and CORE::length($m) == 1 ) {
Condition100%3/3
length $o == 1 and length $m == 1
!ll&&!rl&&r
1410
MC/DC100%2/2
length $o == 1 and length $m == 1
length $o == 1 length $m == 1
Truth table100%3/3
A and B
A= length $o == 1B= length $m == 1
ABresult
0X0
100
111
422 10 $aamutsymbol = '';
423 10 $aamut = $aamutterm;
424 }
425 elsif ($self->RNAChange->label =~ /deletion/) {
426 2 $aamutsymbol = 'del';
427 2 ▶ if ($aamutterm eq '*') {
Branch: 1 branch
BranchTrueFalseTotal
if ($aamutterm eq "*") 1 1 2
428 1 $aatermnumber = $self->start + length($m) -1;
429 1 $aamut = 'X'. $aatermnumber;
430 }
431 2 ▶ if ($self->RNAChange && $self->RNAChange->label =~ /inframe/){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->RNAChange and $self->RNAChange->label =~ /inframe/) 1 1 2
Condition66%2/3
$self->RNAChange and $self->RNAChange->label =~ /inframe/
!ll&&!rl&&r
011
MC/DC50%1/2
$self->RNAChange and $self->RNAChange->label =~ /inframe/
$self->RNAChange $self->RNAChange->label =~ /inframe/
Truth table66%2/3
A and B
A= $self->RNAChangeB= $self->RNAChange->label =~ /inframe/
ABresult
0X0
100
111
432 1 $aamut = '-'. length($self->RNAChange->allele_ori->seq)/3 ;
433 }
434 }
435 elsif ($self->RNAChange->label =~ /insertion/) {
436 2 $aamutsymbol = 'ins';
437 2 ▶ if (($aamutterm eq '*') && (length($m)-1 != 0)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aamutterm eq "*" and length($m) - 1 != 0) 1 1 2
Condition66%2/3
$aamutterm eq "*" and length($m) - 1 != 0
!ll&&!rl&&r
101
MC/DC50%1/2
$aamutterm eq "*" and length($m) - 1 != 0
$aamutterm eq "*" length($m) - 1 != 0
Truth table66%2/3
A and B
A= $aamutterm eq "*"B= length($m) - 1 != 0
ABresult
0X0
100
111
438 1 $aatermnumber = $self->start + length($m)-1;
439 1 $aamut = $aatermnumber. 'X';
440 }
441 2 ▶ if ($self->RNAChange->label =~ /inframe/){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->RNAChange->label =~ /inframe/) 1 1 2
442 1 $aamut = '+'. int length($self->RNAChange->allele_mut->seq)/3 ;
443 }
444 }
445 elsif ($self->RNAChange->label =~ /complex/ ) {
446 1 my $diff = length($m) - length($o);
447 1 ▶ if ($diff >= 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($diff >= 0) { } 1 0 1
448 1 $aamutsymbol = 'ins';
449 } else {
450 0 $aamutsymbol = 'del' ;
451 }
452 1 ▶ if (($aamutterm eq '*') && (length($m)-1 != 0)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aamutterm eq "*" and length($m) - 1 != 0) 1 0 1
Condition33%1/3
$aamutterm eq "*" and length($m) - 1 != 0
!ll&&!rl&&r
001
MC/DC0%0/2
$aamutterm eq "*" and length($m) - 1 != 0
$aamutterm eq "*" length($m) - 1 != 0
Truth table33%1/3
A and B
A= $aamutterm eq "*"B= length($m) - 1 != 0
ABresult
0X0
100
111
453 1 $aatermnumber = $self->start + length($m)-1;
454 1 $aamut = $aatermnumber. 'X';
455 }
456 1 ▶ if ($self->RNAChange->label =~ /inframe/){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->RNAChange->label =~ /inframe/) 0 1 1
457  
458 0 ▶ if ($diff >= 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($diff >= 0) { } 0 0 0
459 0 $aamut = '+'. $diff ;
460 } else {
461 0 $aamut = $diff ;
462 }
463 }
464 }
465 elsif ($self->label =~ /truncation/) {
466 0 $aamut = $m;
467 } else {
468 0 $aamutsymbol = '';
469 0 $aamut = $aamutterm;
470 }
471 15 $aamut =~ tr/\*/X/;
472 15 $trivname .= $aamutsymbol. $aamut. $sep;
473 }
474 14 chop $trivname;
475 14 $self->{'trivname'} = $trivname;
476 }
477 14 return $self->{'trivname'};
478 }
479  
480 5 1;
« Variation/SeqDiff.pm ↑ Summary Variation/IO/flat.pm »