Variation/SeqDiff.pm

filter: Statementstmt 54.9% 168 / 306 Branchbran 50.5% 88 / 174 Conditioncond 3.3% 1 / 30 MC/DCmcdc 0.0% 0 / 16 Subroutinesub 83.8% 26 / 31 Podpod 100% 26 / 26 totaltotal 53.0% 309 / 583 CC 103 SCAR 59.1
CC
103
Cov
50%
alignment
1332.0
new
25.8
add_Gene
12.0
CRAP 367.1
↑ Summary Variation/AAChange.pm »
1 # bioperl module for Bio::Variation::SeqDiff
2 #
3 # Please direct questions and support issues to <bioperl-l@bioperl.org>
4 #
5 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
6 #
7 # Copyright Heikki Lehvaslaiho
8 #
9 # You may distribute this module under the same terms as perl itself
10 #
11 # POD documentation - main docs before the code
12  
13 # cds_end definition?
14  
15 =head1 NAME
16  
17 Bio::Variation::SeqDiff - Container class for mutation/variant descriptions
18  
19 =head1 SYNOPSIS
20  
21 $seqDiff = Bio::Variation::SeqDiff->new (
22 -id => $M20132,
23 -alphabet => 'rna',
24 -gene_symbol => 'AR'
25 -chromosome => 'X',
26 -numbering => 'coding'
27 );
28 # get a DNAMutation object somehow
29 $seqDiff->add_Variant($dnamut);
30 print $seqDiff->sys_name(), "\n";
31  
32 =head1 DESCRIPTION
33  
34 SeqDiff stores Bio::Variation::VariantI object references and
35 descriptive information common to all changes in a sequence. Mutations
36 are understood to be any kind of sequence markers and are expected to
37 occur in the same chromosome. See L<Bio::Variation::VariantI> for details.
38  
39 The methods of SeqDiff are geared towards describing mutations in
40 human genes using gene-based coordinate system where 'A' of the
41 initiator codon has number 1 and the one before it -1. This is
42 according to conventions of human genetics.
43  
44 There will be class Bio::Variation::Genotype to describe markers in
45 different chromosomes and diploid genototypes.
46  
47 Classes implementing Bio::Variation::VariantI interface are
48 Bio::Variation::DNAMutation, Bio::Variation::RNAChange, and
49 Bio::Variation::AAChange. See L<Bio::Variation::VariantI>,
50 L<Bio::Variation::DNAMutation>, L<Bio::Variation::RNAChange>, and
51 L<Bio::Variation::AAChange> for more information.
52  
53 Variant objects can be added using two ways: an array passed to the
54 constructor or as individual Variant objects with add_Variant
55 method.
56  
57  
58 =head1 FEEDBACK
59  
60 =head2 Mailing Lists
61  
62 User feedback is an integral part of the evolution of this and other
63 Bioperl modules. Send your comments and suggestions preferably to the
64 Bioperl mailing lists Your participation is much appreciated.
65  
66 bioperl-l@bioperl.org - General discussion
67 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
68  
69  
70 =head2 Support
71  
72 Please direct usage questions or support issues to the mailing list:
73  
74 I<bioperl-l@bioperl.org>
75  
76 rather than to the module maintainer directly. Many experienced and
77 reponsive experts will be able look at the problem and quickly
78 address it. Please include a thorough description of the problem
79 with code and data examples if at all possible.
80  
81 =head2 Reporting Bugs
82  
83 Report bugs to the Bioperl bug tracking system to help us keep track
84 the bugs and their resolution. Bug reports can be submitted via the
85 web:
86  
87 https://github.com/bioperl/bioperl-live/issues
88  
89 =head1 AUTHOR - Heikki Lehvaslaiho
90  
91 Email: heikki-at-bioperl-dot-org
92  
93 =head1 CONTRIBUTORS
94  
95 Eckhard Lehmann, ecky@e-lehmann.de
96  
97 =head1 APPENDIX
98  
99 The rest of the documentation details each of the object
100 methods. Internal methods are usually preceded with a _
101  
102 =cut
103  
104 # Let the code begin...
105  
106 package Bio::Variation::SeqDiff;
107 6 $Bio::Variation::SeqDiff::VERSION = '1.7.5';
108 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
109 6 ▶use Bio::Tools::CodonTable;
Subroutine BEGIN: called CC=1 SCAR=0.0
110 6 ▶use Bio::PrimarySeq;
Subroutine BEGIN: called CC=1 SCAR=0.0
111  
112 6 ▶use base qw(Bio::Root::Root);
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114  
115 =head2 new
116  
117 Title : new
118 Usage : $seqDiff = Bio::Variation::SeqDiff->new;
119 Function: generates a new Bio::Variation::SeqDiff
120 Returns : reference to a new object of class SeqDiff
121 Args :
122  
123 =cut
124  
125 19 ▶sub new {
Subroutine new: called CC=19 SCAR=32.5
Pod documented
126 19 my($class,@args) = @_;
127 19 my $self = $class->SUPER::new(@args);
128  
129 19 my($id, $sysname, $trivname, $chr, $gene_symbol,
130 $desc, $alphabet, $numbering, $offset, $rna_offset, $rna_id, $cds_end,
131 $dna_ori, $dna_mut, $rna_ori, $rna_mut, $aa_ori, $aa_mut
132 #@variants, @genes
133 ) =
134 $self->_rearrange([qw(ID
135 SYSNAME
136 TRIVNAME
137 CHR
138 GENE_SYMBOL
139 DESC
140 ALPHABET
141 NUMBERING
142 OFFSET
143 RNA_OFFSET
144 RNA_ID
145 CDS_END
146 DNA_ORI
147 DNA_MUT
148 RNA_ORI
149 AA_ORI
150 AA_MUT
151 )],
152 @args);
153
154 #my $make = $self->SUPER::_initialize(@args);
155
156 19 ▶ $id && $self->id($id);
Branch: 1 branch
BranchTrueFalseTotal
$id and $self->id($id) 15 4 19
157 19 ▶ $sysname && $self->sysname($sysname);
Branch: 1 branch
BranchTrueFalseTotal
$sysname and $self->sysname($sysname) 0 19 19
158 19 ▶ $trivname && $self->trivname($trivname);
Branch: 1 branch
BranchTrueFalseTotal
$trivname and $self->trivname($trivname) 0 19 19
159 19 ▶ $chr && $self->chromosome($chr);
Branch: 1 branch
BranchTrueFalseTotal
$chr and $self->chromosome($chr) 0 19 19
160 19 ▶ $gene_symbol && $self->gene_symbol($chr);
Branch: 1 branch
BranchTrueFalseTotal
$gene_symbol and $self->gene_symbol($chr) 0 19 19
161 19 ▶ $desc && $self->description($desc);
Branch: 1 branch
BranchTrueFalseTotal
$desc and $self->description($desc) 0 19 19
162 19 ▶ $alphabet && $self->alphabet($alphabet);
Branch: 1 branch
BranchTrueFalseTotal
$alphabet and $self->alphabet($alphabet) 0 19 19
163 19 ▶ $numbering && $self->numbering($numbering);
Branch: 1 branch
BranchTrueFalseTotal
$numbering and $self->numbering($numbering) 0 19 19
164 19 ▶ $offset && $self->offset($offset);
Branch: 1 branch
BranchTrueFalseTotal
$offset and $self->offset($offset) 15 4 19
165 19 ▶ $rna_offset && $self->rna_offset($rna_offset);
Branch: 1 branch
BranchTrueFalseTotal
$rna_offset and $self->rna_offset($rna_offset) 0 19 19
166 19 ▶ $rna_id && $self->rna_id($rna_id);
Branch: 1 branch
BranchTrueFalseTotal
$rna_id and $self->rna_id($rna_id) 0 19 19
167 19 ▶ $cds_end && $self->cds_end($cds_end);
Branch: 1 branch
BranchTrueFalseTotal
$cds_end and $self->cds_end($cds_end) 0 19 19
168  
169 19 ▶ $dna_ori && $self->dna_ori($dna_ori);
Branch: 1 branch
BranchTrueFalseTotal
$dna_ori and $self->dna_ori($dna_ori) 0 19 19
170 19 ▶ $dna_mut && $self->dna_mut($dna_mut);
Branch: 1 branch
BranchTrueFalseTotal
$dna_mut and $self->dna_mut($dna_mut) 0 19 19
171 19 ▶ $rna_ori && $self->rna_ori($rna_ori);
Branch: 1 branch
BranchTrueFalseTotal
$rna_ori and $self->rna_ori($rna_ori) 0 19 19
172 19 ▶ $rna_mut && $self->rna_mut($rna_mut);
Branch: 1 branch
BranchTrueFalseTotal
$rna_mut and $self->rna_mut($rna_mut) 0 19 19
173 19 ▶ $aa_ori && $self->aa_ori ($aa_ori);
Branch: 1 branch
BranchTrueFalseTotal
$aa_ori and $self->aa_ori($aa_ori) 0 19 19
174 19 ▶ $aa_mut && $self->aa_mut ($aa_mut);
Branch: 1 branch
BranchTrueFalseTotal
$aa_mut and $self->aa_mut($aa_mut) 0 19 19
175  
176 19 $self->{ 'variants' } = [];
177 #@variants && push(@{$self->{'variants'}},@variants);
178  
179 19 $self->{ 'genes' } = [];
180 #@genes && push(@{$self->{'genes'}},@genes);
181  
182 19 return $self; # success - we hope!
183 }
184  
185  
186 =head2 id
187  
188 Title : id
189 Usage : $obj->id(H0001); $id = $obj->id();
190 Function:
191  
192 Sets or returns the id of the seqDiff.
193 Should be used to give the collection of variants a UID
194 without semantic associations.
195  
196 Example :
197 Returns : value of id, a scalar
198 Args : newvalue (optional)
199  
200 =cut
201  
202  
203 53 ▶sub id {
Subroutine id: called CC=2 SCAR=6.9
Pod documented
204 53 my ($self,$value) = @_;
205 53 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 17 36 53
206 17 $self->{'id'} = $value;
207 }
208 else {
209 36 return $self->{'id'};
210 }
211 }
212  
213  
214 =head2 sysname
215  
216 Title : sysname
217 Usage : $obj->sysname('5C>G'); $sysname = $obj->sysname();
218 Function:
219  
220 Sets or returns the systematic name of the seqDiff. The
221 name should follow the HUGO Mutation Database Initiative
222 approved nomenclature. If called without first setting the
223 value, will generate it from L<Bio::Variation::DNAMutation>
224 objects attached.
225  
226 Example :
227 Returns : value of sysname, a scalar
228 Args : newvalue (optional)
229  
230 =cut
231  
232  
233 32 ▶sub sysname {
Subroutine sysname: called CC=7 SCAR=19.5
Pod documented
234 32 my ($self,$value) = @_;
235 32 ▶ if (defined $value) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $value) { } 1 31 32
elsif (not defined $self->{'sysname'}) { } 15 16 31
236 1 $self->{'sysname'} = $value;
237 }
238 elsif (not defined $self->{'sysname'}) {
239  
240 15 my $sysname = '';
241 15 my $c = 0;
242 15 foreach my $mut ($self->each_Variant) {
243 44 ▶ if( $mut->isa('Bio::Variation::DNAMutation') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mut->isa("Bio::Variation::DNAMutation")) 16 28 44
244 16 $c++;
245 16 ▶ if ($c == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c == 1) { } 15 1 16
246 15 $sysname = $mut->sysname ;
247 }
248 else {
249 1 $sysname .= ";". $mut->sysname;
250 }
251 }
252 }
253 15 ▶ $sysname = "[". $sysname. "]" if $c > 1;
Branch: 1 branch
BranchTrueFalseTotal
if $c > 1 1 14 15
254 15 $self->{'sysname'} = $sysname;
255 }
256 32 return $self->{'sysname'};
257 }
258  
259  
260 =head2 trivname
261  
262 Title : trivname
263 Usage : $obj->trivname('[A2G;T56G]'); $trivname = $obj->trivname();
264 Function:
265  
266 Sets or returns the trivial name of the seqDiff.
267 The name should follow the HUGO Mutation Database Initiative
268 approved nomenclature. If called without first setting the
269 value, will generate it from L<Bio::Variation::AAChange>
270 objects attached.
271  
272 Example :
273 Returns : value of trivname, a scalar
274 Args : newvalue (optional)
275  
276 =cut
277  
278  
279 28 ▶sub trivname {
Subroutine trivname: called CC=7 SCAR=19.5
Pod documented
280 28 my ($self,$value) = @_;
281 28 ▶ if (defined $value) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $value) { } 1 27 28
elsif (not defined $self->{'trivname'}) { } 15 12 27
282 1 $self->{'trivname'} = $value;
283 }
284 elsif (not defined $self->{'trivname'}) {
285
286 15 my $trivname = '';
287 15 my $c = 0;
288 15 foreach my $mut ($self->each_Variant) {
289 44 ▶ if( $mut->isa('Bio::Variation::AAChange') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mut->isa("Bio::Variation::AAChange")) 12 32 44
290 12 $c++;
291 12 ▶ if ($c == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c == 1) { } 11 1 12
292 11 $trivname = $mut->trivname ;
293 }
294 else {
295 1 $trivname .= ";". $mut->trivname;
296 }
297 }
298 }
299 15 ▶ $trivname = "[". $trivname. "]" if $c > 1;
Branch: 1 branch
BranchTrueFalseTotal
if $c > 1 1 14 15
300 15 $self->{'trivname'} = $trivname;
301 }
302  
303 else {
304 12 return $self->{'trivname'};
305 }
306 }
307  
308  
309 =head2 chromosome
310  
311 Title : chromosome
312 Usage : $obj->chromosome('X'); $chromosome = $obj->chromosome();
313 Function:
314  
315 Sets or returns the chromosome ("linkage group") of the seqDiff.
316  
317 Example :
318 Returns : value of chromosome, a scalar
319 Args : newvalue (optional)
320  
321 =cut
322  
323  
324 3 ▶sub chromosome {
Subroutine chromosome: called CC=2 SCAR=6.9
Pod documented
325 3 my ($self,$value) = @_;
326 3 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 2 1 3
327 2 $self->{'chromosome'} = $value;
328 }
329 else {
330 1 return $self->{'chromosome'};
331 }
332 }
333  
334  
335 =head2 gene_symbol
336  
337 Title : gene_symbol
338 Usage : $obj->gene_symbol('FOS'); $gene_symbol = $obj->gene_symbol;
339 Function:
340  
341 Sets or returns the gene symbol for the studied CDS.
342  
343 Example :
344 Returns : value of gene_symbol, a scalar
345 Args : newvalue (optional)
346  
347 =cut
348  
349  
350 2 ▶sub gene_symbol {
Subroutine gene_symbol: called CC=2 SCAR=6.9
Pod documented
351 2 my ($self,$value) = @_;
352 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
353 1 $self->{'gene_symbol'} = $value;
354 }
355 else {
356 1 return $self->{'gene_symbol'};
357 }
358 }
359  
360  
361  
362 =head2 description
363  
364 Title : description
365 Usage : $obj->description('short description'); $descr = $obj->description();
366 Function:
367  
368 Sets or returns the short description of the seqDiff.
369  
370 Example :
371 Returns : value of description, a scalar
372 Args : newvalue (optional)
373  
374 =cut
375  
376  
377 2 ▶sub description {
Subroutine description: called CC=2 SCAR=6.9
Pod documented
378 2 my ($self,$value) = @_;
379 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
380 1 $self->{'description'} = $value;
381 }
382 else {
383 1 return $self->{'description'};
384 }
385 }
386  
387  
388 =head2 alphabet
389  
390 Title : alphabet
391 Usage : if( $obj->alphabet eq 'dna' ) { /Do Something/ }
392 Function: Returns the type of primary reference sequence being one of
393 'dna', 'rna' or 'protein'. This is case sensitive.
394  
395 Returns : a string either 'dna','rna','protein'.
396 Args : none
397  
398  
399 =cut
400  
401 139 ▶sub alphabet {
Subroutine alphabet: called CC=3 SCAR=11.2
Pod documented
402 139 my ($self,$value) = @_;
403 139 my %type = (dna => 1,
404 rna => 1,
405 protein => 1);
406 139 ▶ if( defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 15 124 139
407 15 ▶ if ($type{$value}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type{$value}) { } 15 0 15
408 15 $self->{'alphabet'} = $value;
409 } else {
410 0 $self->throw("$value is not valid alphabet value!");
411 }
412 }
413 139 return $self->{'alphabet'};
414 }
415  
416  
417 =head2 numbering
418  
419 Title : numbering
420 Usage : $obj->numbering('coding'); $numbering = $obj->numbering();
421 Function:
422  
423 Sets or returns the string giving the numbering schema used
424 to describe the variants.
425  
426 Example :
427 Returns : value of numbering, a scalar
428 Args : newvalue (optional)
429  
430 =cut
431  
432  
433  
434 2 ▶sub numbering {
Subroutine numbering: called CC=2 SCAR=6.9
Pod documented
435 2 my ($self,$value) = @_;
436 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
437 1 $self->{'numbering'} = $value;
438 }
439 else {
440 1 return $self->{'numbering'};
441 }
442 }
443  
444  
445 =head2 offset
446  
447 Title : offset
448 Usage : $obj->offset(124); $offset = $obj->offset();
449 Function:
450  
451 Sets or returns the offset from the beginning of the DNA sequence
452 to the coordinate start used to describe variants. Typically
453 the beginning of the coding region of the gene.
454 The cds_start should be 1 + offset.
455  
456 Example :
457 Returns : value of offset, a scalar
458 Args : newvalue (optional)
459  
460 =cut
461  
462  
463  
464 68 ▶sub offset {
Subroutine offset: called CC=3 SCAR=11.3
Pod documented
465 68 my ($self,$value) = @_;
466 68 ▶ if (defined $value) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $value) { } 16 52 68
elsif (not defined $self->{'offset'}) { } 0 52 52
467 16 $self->{'offset'} = $value;
468 }
469 elsif (not defined $self->{'offset'} ) {
470 0 return $self->{'offset'} = 0;
471 }
472 else {
473 52 return $self->{'offset'};
474 }
475 }
476  
477  
478 =head2 cds_start
479  
480 Title : cds_start
481 Usage : $obj->cds_start(123); $cds_start = $obj->cds_start();
482 Function:
483  
484 Sets or returns the cds_start from the beginning of the DNA
485 sequence to the coordinate start used to describe
486 variants. Typically the beginning of the coding region of
487 the gene. Needs to be and is implemented as 1 + offset.
488  
489 Example :
490 Returns : value of cds_start, a scalar
491 Args : newvalue (optional)
492  
493 =cut
494  
495  
496  
497 0 ▶sub cds_start {
Subroutine cds_start: not called CC=2 SCAR=17.9
Pod documented
498 0 my ($self,$value) = @_;
499 0 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 0 0
500 0 $self->{'offset'} = $value - 1;
501 }
502 else {
503 0 return $self->{'offset'} + 1;
504 }
505 }
506  
507  
508 =head2 cds_end
509  
510 Title : cds_end
511 Usage : $obj->cds_end(321); $cds_end = $obj->cds_end();
512 Function:
513  
514 Sets or returns the position of the last nucleotitide of the
515 termination codon. The coordinate system starts from cds_start.
516  
517 Example :
518 Returns : value of cds_end, a scalar
519 Args : newvalue (optional)
520  
521 =cut
522  
523  
524  
525 0 ▶sub cds_end {
Subroutine cds_end: not called CC=2 SCAR=17.9
Pod documented
526 0 my ($self,$value) = @_;
527 0 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 0 0
528 0 $self->{'cds_end'} = $value;
529 }
530 else {
531 0 return $self->{'cds_end'};
532 #$self->{'cds_end'} = CORE::length($self->SeqDiff->rna_ori)/3;
533 }
534 }
535  
536  
537 =head2 rna_offset
538  
539 Title : rna_offset
540 Usage : $obj->rna_offset(124); $rna_offset = $obj->rna_offset();
541 Function:
542  
543 Sets or returns the rna_offset from the beginning of the RNA sequence
544 to the coordinate start used to describe variants. Typically
545 the beginning of the coding region of the gene.
546  
547 Example :
548 Returns : value of rna_offset, a scalar
549 Args : newvalue (optional)
550  
551 =cut
552  
553  
554  
555 2 ▶sub rna_offset {
Subroutine rna_offset: called CC=3 SCAR=11.3
Pod documented
556 2 my ($self,$value) = @_;
557 2 ▶ if (defined $value) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
elsif (not defined $self->{'rna_offset'}) { } 0 1 1
558 1 $self->{'rna_offset'} = $value;
559 }
560 elsif (not defined $self->{'rna_offset'} ) {
561 0 return $self->{'rna_offset'} = 0;
562 }
563 else {
564 1 return $self->{'rna_offset'};
565 }
566 }
567  
568  
569 =head2 rna_id
570  
571 Title : rna_id
572 Usage : $obj->rna_id('transcript#3'); $rna_id = $obj->rna_id();
573 Function:
574  
575 Sets or returns the ID for original RNA sequence of the seqDiff.
576  
577 Example :
578 Returns : value of rna_id, a scalar
579 Args : newvalue (optional)
580  
581 =cut
582  
583  
584 6 ▶sub rna_id {
Subroutine rna_id: called CC=2 SCAR=6.9
Pod documented
585 6 my ($self,$value) = @_;
586 6 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 5 6
587 1 $self->{'rna_id'} = $value;
588 }
589 else {
590 5 return $self->{'rna_id'};
591 }
592 }
593  
594  
595  
596 =head2 add_Variant
597  
598 Title : add_Variant
599 Usage : $obj->add_Variant($variant)
600 Function:
601  
602 Pushes one Bio::Variation::Variant into the list of variants.
603 At the same time, creates a link from the Variant to SeqDiff
604 using its SeqDiff method.
605  
606 Example :
607 Returns : 1 when succeeds, 0 for failure.
608 Args : Variant object
609  
610 =cut
611  
612 46 ▶sub add_Variant {
Subroutine add_Variant: called CC=3 SCAR=12.3
Pod documented
613 46 my ($self,$value) = @_;
614 46 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 46 0 46
615 46 ▶ if( ! $value->isa('Bio::Variation::VariantI') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $value->isa('Bio::Variation::VariantI')) { } 0 46 46
616 0 $self->throw("Is not a VariantI complying object but a [$self]");
617 0 return 0;
618 }
619 else {
620 46 push(@{$self->{'variants'}},$value);
621 46 $value->SeqDiff($self);
622 46 return 1;
623 }
624 }
625 else {
626 0 return 0;
627 }
628 }
629  
630  
631 =head2 each_Variant
632  
633 Title : each_Variant
634 Usage : $obj->each_Variant();
635 Function:
636  
637 Returns a list of Variants.
638  
639 Example :
640 Returns : list of Variants
641 Args : none
642  
643 =cut
644  
645 91 ▶sub each_Variant{
Subroutine each_Variant: called CC=1 SCAR=0.0
Pod documented
646 91 my ($self,@args) = @_;
647
648 91 return @{$self->{'variants'}};
649 }
650  
651  
652  
653 =head2 add_Gene
654  
655 Title : add_Gene
656 Usage : $obj->add_Gene($gene)
657 Function:
658  
659 Pushes one L<Bio::LiveSeq::Gene> into the list of genes.
660  
661 Example :
662 Returns : 1 when succeeds, 0 for failure.
663 Args : Bio::LiveSeq::Gene object
664  
665 See L<Bio::LiveSeq::Gene> for more information.
666  
667 =cut
668  
669  
670 0 ▶sub add_Gene {
Subroutine add_Gene: not called CC=3 SCAR=24.8
Pod documented
671 0 my ($self,$value) = @_;
672 0 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 0 0
673 0 ▶ if( ! $value->isa('Bio::LiveSeq::Gene') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $value->isa('Bio::LiveSeq::Gene')) { } 0 0 0
674 0 $value->throw("Is not a Bio::LiveSeq::Gene object but a [$value]");
675 0 return 0;
676 }
677 else {
678 0 push(@{$self->{'genes'}},$value);
679 0 return 1;
680 }
681 }
682 else {
683 0 return 0;
684 }
685 }
686  
687  
688 =head2 each_Gene
689  
690 Title : each_Gene
691 Usage : $obj->each_Gene();
692 Function:
693  
694 Returns a list of L<Bio::LiveSeq::Gene>s.
695  
696 Example :
697 Returns : list of Genes
698 Args : none
699  
700 =cut
701  
702 0 ▶sub each_Gene{
Subroutine each_Gene: not called CC=1 SCAR=6.9
Pod documented
703 0 my ($self,@args) = @_;
704  
705 0 return @{$self->{'genes'}};
706 }
707  
708  
709 =head2 dna_ori
710  
711 Title : dna_ori
712 Usage : $obj->dna_ori('atgctgctgctgct'); $dna_ori = $obj->dna_ori();
713 Function:
714  
715 Sets or returns the original DNA sequence string of the seqDiff.
716  
717 Example :
718 Returns : value of dna_ori, a scalar
719 Args : newvalue (optional)
720  
721 =cut
722  
723  
724 2 ▶sub dna_ori {
Subroutine dna_ori: called CC=2 SCAR=6.9
Pod documented
725 2 my ($self,$value) = @_;
726 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
727 1 $self->{'dna_ori'} = $value;
728 }
729 else {
730 1 return $self->{'dna_ori'};
731 }
732 }
733  
734  
735 =head2 dna_mut
736  
737 Title : dna_mut
738 Usage : $obj->dna_mut('atgctggtgctgct'); $dna_mut = $obj->dna_mut();
739 Function:
740  
741 Sets or returns the mutated DNA sequence of the seqDiff.
742 If sequence has not been set generates it from the
743 original sequence and DNA mutations.
744  
745 Example :
746 Returns : value of dna_mut, a scalar
747 Args : newvalue (optional)
748  
749 =cut
750  
751  
752 1 ▶sub dna_mut {
Subroutine dna_mut: called CC=3 SCAR=12.0
Pod documented
753 1 my ($self,$value) = @_;
754 1 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 1 1
755 0 $self->{'dna_mut'} = $value;
756 }
757 else {
758 1 ▶ $self->_set_dnamut() unless $self->{'dna_mut'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"dna_mut"} 1 0 1
759 1 return $self->{'dna_mut'};
760 }
761 }
762  
763 1 ▶sub _set_dnamut {
Subroutine _set_dnamut: called CC=9 SCAR=24.1
764 1 my $self = shift;
765  
766 1 ▶ return unless $self->{'dna_ori'} && $self->each_Variant;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"dna_ori"} and $self->each_Variant 0 1 1
Condition33%1/3
$self->{"dna_ori"} and $self->each_Variant
!ll&&!rl&&r
001
MC/DC0%0/2
$self->{"dna_ori"} and $self->each_Variant
$self->{"dna_ori"} $self->each_Variant
Truth table33%1/3
A and B
A= $self->{"dna_ori"}B= $self->each_Variant
ABresult
0X0
100
111
767  
768 1 $self->{'dna_mut'} = $self->{'dna_ori'};
769 1 foreach ($self->each_Variant) {
770 2 ▶ next unless $_->isa('Bio::Variation::DNAMutation');
Branch: 1 branch
BranchTrueFalseTotal
unless $_->isa("Bio::Variation::DNAMutation") 0 2 2
771 2 ▶ next unless $_->isMutation;
Branch: 1 branch
BranchTrueFalseTotal
unless $_->isMutation 0 2 2
772  
773 2 my ($s, $la, $le);
774 #lies the mutation less than 25 bases after the start of sequence?
775 2 ▶ if ($_->start < 25) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_->start < 25) { } 2 0 2
776 2 $s = 0; $la = $_->start - 1;
777 } else {
778 0 $s = $_->start - 25; $la = 25;
779 }
780  
781 #is the mutation an insertion?
782 2 ▶ $_->end($_->start) unless $_->allele_ori->seq;
Branch: 1 branch
BranchTrueFalseTotal
unless $_->allele_ori->seq 0 2 2
783  
784 #does the mutation end greater than 25 bases before the end of
785 #sequence?
786 2 ▶ if (($_->end + 25) > length($self->{'dna_mut'})) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_->end + 25 > length $self->{'dna_mut'}) { } 2 0 2
787 2 $le = length($self->{'dna_mut'}) - $_->end;
788 } else {
789 0 $le = 25;
790 }
791  
792 2 $_->dnStreamSeq(substr($self->{'dna_mut'}, $s, $la));
793 2 $_->upStreamSeq(substr($self->{'dna_mut'}, $_->end, $le));
794  
795 2 my $s_ori = $_->dnStreamSeq . $_->allele_ori->seq . $_->upStreamSeq;
796 2 my $s_mut = $_->dnStreamSeq . $_->allele_mut->seq . $_->upStreamSeq;
797  
798 2 (my $str = $self->{'dna_mut'}) =~ s/$s_ori/$s_mut/;
799 2 $self->{'dna_mut'} = $str;
800 }
801 }
802  
803  
804 =head2 rna_ori
805  
806 Title : rna_ori
807 Usage : $obj->rna_ori('atgctgctgctgct'); $rna_ori = $obj->rna_ori();
808 Function:
809  
810 Sets or returns the original RNA sequence of the seqDiff.
811  
812 Example :
813 Returns : value of rna_ori, a scalar
814 Args : newvalue (optional)
815  
816 =cut
817  
818  
819 2 ▶sub rna_ori {
Subroutine rna_ori: called CC=2 SCAR=6.9
Pod documented
820 2 my ($self,$value) = @_;
821 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
822 1 $self->{'rna_ori'} = $value;
823 }
824 else {
825 1 return $self->{'rna_ori'};
826 }
827 }
828  
829  
830 =head2 rna_mut
831  
832 Title : rna_mut
833 Usage : $obj->rna_mut('atgctggtgctgct'); $rna_mut = $obj->rna_mut();
834 Function:
835  
836 Sets or returns the mutated RNA sequence of the seqDiff.
837  
838 Example :
839 Returns : value of rna_mut, a scalar
840 Args : newvalue (optional)
841  
842 =cut
843  
844  
845 2 ▶sub rna_mut {
Subroutine rna_mut: called CC=2 SCAR=6.9
Pod documented
846 2 my ($self,$value) = @_;
847 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
848 1 $self->{'rna_mut'} = $value;
849 }
850 else {
851 1 return $self->{'rna_mut'};
852 }
853 }
854  
855  
856 =head2 aa_ori
857  
858 Title : aa_ori
859 Usage : $obj->aa_ori('MAGVLL*'); $aa_ori = $obj->aa_ori();
860 Function:
861  
862 Sets or returns the original protein sequence of the seqDiff.
863  
864 Example :
865 Returns : value of aa_ori, a scalar
866 Args : newvalue (optional)
867  
868 =cut
869  
870  
871 2 ▶sub aa_ori {
Subroutine aa_ori: called CC=2 SCAR=6.9
Pod documented
872 2 my ($self,$value) = @_;
873 2 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 1 1 2
874 1 $self->{'aa_ori'} = $value;
875 }
876 else {
877 1 return $self->{'aa_ori'};
878 }
879 }
880  
881  
882 =head2 aa_mut
883  
884 Title : aa_mut
885 Usage : $obj->aa_mut('MA*'); $aa_mut = $obj->aa_mut();
886 Function:
887  
888 Sets or returns the mutated protein sequence of the seqDiff.
889  
890 Example :
891 Returns : value of aa_mut, a scalar
892 Args : newvalue (optional)
893  
894 =cut
895  
896  
897 3 ▶sub aa_mut {
Subroutine aa_mut: called CC=2 SCAR=6.9
Pod documented
898 3 my ($self,$value) = @_;
899 3 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 2 1 3
900 2 $self->{'aa_mut'} = $value;
901 }
902 else {
903 1 return $self->{'aa_mut'};
904 }
905 }
906  
907  
908 =head2 seqobj
909  
910 Title : seqobj
911 Usage : $dnaobj = $obj->seqobj('dna_mut');
912 Function:
913  
914 Returns the any original or mutated sequences as a
915 Bio::PrimarySeq object.
916  
917 Example :
918 Returns : Bio::PrimarySeq object for the requested sequence
919 Args : string, method name for the sequence requested
920  
921 See L<Bio::PrimarySeq> for more information.
922  
923 =cut
924  
925 3 ▶sub seqobj {
Subroutine seqobj: called CC=5 SCAR=16.1
Pod documented
926 3 my ($self,$value) = @_;
927 3 my $out;
928 my %valid_obj =
929 3 map {$_, 1} qw(dna_ori rna_ori aa_ori dna_mut rna_mut aa_mut);
930 3 ▶ $valid_obj{$value} ||
Branch: 1 branch
BranchTrueFalseTotal
$valid_obj{$value} or $self->throw("Sequence type '${value}' is not a valid type (" . join(",", map(("'${_}'"), sort(keys %valid_obj))) . ') lowercase') 2 1 3
931 $self->throw("Sequence type '$value' is not a valid type (".
932 join(',', map "'$_'", sort keys %valid_obj) .") lowercase");
933 2 my ($alphabet) = $value =~ /([^_]+)/;
934 2 my $id = $self->id;
935 2 ▶ $id = $self->rna_id if $self->rna_id;
Branch: 1 branch
BranchTrueFalseTotal
if $self->rna_id 2 0 2
936 2 ▶ $alphabet = 'protein' if $alphabet eq 'aa';
Branch: 1 branch
BranchTrueFalseTotal
if $alphabet eq "aa" 1 1 2
937 $out = Bio::PrimarySeq->new
938 ( '-seq' => $self->{$value},
939 '-display_id' => $id,
940 '-accession_number' => $self->id,
941 '-alphabet' => $alphabet
942 2 ▶ ) if $self->{$value} ;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{$value} 1 1 2
943 2 return $out;
944 }
945  
946 =head2 alignment
947  
948 Title : alignment
949 Usage : $obj->alignment
950 Function:
951  
952 Returns a pretty RNA/AA sequence alignment from linked
953 objects. Under construction: Only simple coding region
954 point mutations work.
955  
956 Example :
957 Returns :
958 Args : none
959  
960 =cut
961  
962  
963 0 ▶sub alignment {
Subroutine alignment: not called CC=36 SCAR=71.9
Pod documented
964 0 my $self = shift;
965 0 my (@entry, $text);
966  
967 0 my $maxflanklen = 12;
968  
969 0 foreach my $mut ($self->each_Variant) {
970 0 ▶ if( $mut->isa('Bio::Variation::RNAChange') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mut->isa("Bio::Variation::RNAChange")) 0 0 0
971  
972 0 my $upflank = $mut->upStreamSeq;
973 0 my $dnflank = $mut->dnStreamSeq;
974 0 my $cposd = $mut->codon_pos;
975 0 my $rori = $mut->allele_ori->seq;
976 0 my $rmut = $mut->allele_mut->seq;
977 0 my $rseqoriu = '';
978 0 my $rseqmutu = '';
979 0 my $rseqorid = '';
980 0 my $rseqmutd = '';
981 0 my $aaseqmutu = '';
982 0 my (@rseqori, @rseqmut );
983  
984 # point
985 0 ▶ if ($mut->DNAMutation->label =~ /point/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($mut->DNAMutation->label =~ /point/) { } 0 0 0
elsif ($mut->DNAMutation->label =~ /deletion/) { } 0 0 0
986 0 ▶ if ($cposd == 1 ) {
Branch: 3 branches
BranchTrueFalseTotal
if ($cposd == 1) { } 0 0 0
elsif ($cposd == 2) { } 0 0 0
elsif ($cposd == 3) { } 0 0 0
987 0 my $nt2d = substr($dnflank, 0, 2);
988 0 push @rseqori, $rori. $nt2d;
989 0 push @rseqmut, uc ($rmut). $nt2d;
990 0 $dnflank = substr($dnflank, 2);
991 }
992 elsif ($cposd == 2) {
993 0 my $ntu = chop $upflank;
994 0 my $ntd = substr($dnflank, 0, 1);
995 0 push @rseqori, $ntu. $rori. $ntd;
996 0 push @rseqmut, $ntu. uc ($rmut). $ntd;
997 0 $dnflank = substr($dnflank, 1);
998 }
999 elsif ($cposd == 3) {
1000 0 my $ntu1 = chop $upflank;
1001 0 my $ntu2 = chop $upflank;
1002 0 push (@rseqori, $ntu2. $ntu1. $rori);
1003 0 push (@rseqmut, $ntu2. $ntu1. uc $rmut);
1004 }
1005 }
1006 #deletion
1007 elsif ($mut->DNAMutation->label =~ /deletion/) {
1008 0 ▶ if ($cposd == 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cposd == 2) 0 0 0
1009 0 $rseqorid = chop $upflank;
1010 0 $rseqmutd = $rseqorid;
1011 }
1012 0 ▶ for (my $i=1; $i<=$mut->length; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $mut->length) 0 0 0
1013 0 my $ntd .= substr($mut->allele_ori, $i-1, 1);
1014 0 $rseqorid .= $ntd;
1015 0 ▶ if (length($rseqorid) == 3 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $rseqorid == 3) 0 0 0
1016 0 push (@rseqori, $rseqorid);
1017 0 push (@rseqmut, " ");
1018 0 $rseqorid = '';
1019 }
1020 }
1021  
1022 0 ▶ if ($rseqorid) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rseqorid) 0 0 0
1023 0 $rseqorid .= substr($dnflank, 0, 3-$rseqorid);
1024 0 push (@rseqori, $rseqorid);
1025 0 push (@rseqmut, " ");
1026 0 $dnflank = substr($dnflank,3-$rseqorid);
1027 }
1028 }
1029 0 $upflank = reverse $upflank;
1030 # loop throught the flanks
1031 0 ▶ for (my $i=1; $i<=length($dnflank); $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= length $dnflank) 0 0 0
1032
1033 0 ▶ last if $i > $maxflanklen;
Branch: 1 branch
BranchTrueFalseTotal
if $i > $maxflanklen 0 0 0
1034  
1035 0 my $ntd .= substr($dnflank, $i-1, 1);
1036 0 my $ntu .= substr($upflank, $i-1, 1);
1037  
1038 0 $rseqmutd .= $ntd;
1039 0 $rseqorid .= $ntd;
1040 0 $rseqmutu = $ntu. $rseqmutu;
1041 0 $rseqoriu = $ntu. $rseqoriu;
1042
1043 0 ▶ if (length($rseqorid) == 3 and length($rseqorid) == 3) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $rseqorid == 3 and length $rseqorid == 3) 0 0 0
Condition0%0/3
length $rseqorid == 3 and length $rseqorid == 3
!ll&&!rl&&r
000
MC/DC0%0/2
length $rseqorid == 3 and length $rseqorid == 3
length $rseqorid == 3 length $rseqorid == 3
Truth table0%0/3
A and B
A= length $rseqorid == 3B= length $rseqorid == 3
ABresult
0X0
100
111
1044 0 push (@rseqori, $rseqorid);
1045 0 push (@rseqmut, $rseqmutd);
1046 0 $rseqorid = $rseqmutd ='';
1047 }
1048 0 ▶ if (length($rseqoriu) == 3 and length($rseqoriu) == 3) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $rseqoriu == 3 and length $rseqoriu == 3) 0 0 0
Condition0%0/3
length $rseqoriu == 3 and length $rseqoriu == 3
!ll&&!rl&&r
000
MC/DC0%0/2
length $rseqoriu == 3 and length $rseqoriu == 3
length $rseqoriu == 3 length $rseqoriu == 3
Truth table0%0/3
A and B
A= length $rseqoriu == 3B= length $rseqoriu == 3
ABresult
0X0
100
111
1049 0 unshift (@rseqori, $rseqoriu);
1050 0 unshift (@rseqmut, $rseqmutu);
1051 0 $rseqoriu = $rseqmutu ='';
1052 }
1053  
1054 #print "|i=$i, $cposd, $rseqmutd, $rseqorid\n";
1055 #print "|i=$i, $cposu, $rseqmutu, $rseqoriu\n\n";
1056  
1057 }
1058  
1059 0 push (@rseqori, $rseqorid);
1060 0 unshift (@rseqori, $rseqoriu);
1061 0 push (@rseqmut, $rseqmutd);
1062 0 unshift (@rseqmut, $rseqmutu);
1063
1064 0 ▶ return unless $mut->AAChange;
Branch: 1 branch
BranchTrueFalseTotal
unless $mut->AAChange 0 0 0
1065 #translate
1066 0 my $tr = Bio::Tools::CodonTable->new('-id' => $mut->codon_table);
1067 0 my $apos = $mut->AAChange->start;
1068 0 my $aposmax = CORE::length($self->aa_ori); #terminator codon no
1069 0 my $rseqori;
1070 my $rseqmut;
1071 0 my $aaseqori;
1072 0 my $aaseqmut = "";
1073 0 ▶ for (my $i = 0; $i <= $#rseqori; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#rseqori) 0 0 0
1074 0 my $a = '';
1075  
1076 0 ▶ $a = $tr->translate($rseqori[$i]) if length($rseqori[$i]) == 3;
Branch: 1 branch
BranchTrueFalseTotal
if length $rseqori[$i] == 3 0 0 0
1077
1078 0 ▶ if (length($a) != 1 or
Branch: 1 branch
BranchTrueFalseTotal
if (length $a != 1 or $apos - ($maxflanklen / 2 - 1) + $i < 1 or $apos - ($maxflanklen / 2 - 1) + $i > $aposmax) { } 0 0 0
Condition0%0/6
length $a != 1 or $apos - ($maxflanklen / 2 - 1) + $i < 1 or $apos - ($maxflanklen / 2 - 1) + $i > $aposmax
l!l&&r!l&&!r
000
length $a != 1 or $apos - ($maxflanklen / 2 - 1) + $i < 1
l!l&&r!l&&!r
000
MC/DC0%0/3
length $a != 1 or $apos - ($maxflanklen / 2 - 1) + $i < 1 or $apos - ($maxflanklen / 2 - 1) + $i > $aposmax
length $a != 1 $apos - ($maxflanklen / 2 - 1) + $i < 1 $apos - ($maxflanklen / 2 - 1) + $i > $aposmax
Truth table0%0/4
A or B or C
A= length $a != 1B= $apos - ($maxflanklen / 2 - 1) + $i < 1C= $apos - ($maxflanklen / 2 - 1) + $i > $aposmax
ABCresult
1XX1
01X1
0011
0000
1079 $apos - ( $maxflanklen/2 -1) + $i < 1 or
1080 $apos - ( $maxflanklen/2 -1) + $i > $aposmax ) {
1081 0 $aaseqori .= " ";
1082 } else {
1083 0 $aaseqori .= " ". $a. " ";
1084 }
1085 0 my $b = '';
1086 0 ▶ if (length($rseqmut[$i]) == 3) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $rseqmut[$i] == 3) 0 0 0
1087 0 ▶ if ($rseqmut[$i] eq ' ') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rseqmut[$i] eq ' ') { } 0 0 0
1088 0 $b = "_";
1089 } else {
1090 0 $b = $tr->translate($rseqmut[$i]);
1091 }
1092 }
1093 0 ▶ if (( $b ne $a and
Branch: 1 branch
BranchTrueFalseTotal
if ($b ne $a and length $b == 1 and $apos - ($maxflanklen / 2 - 1) + $i >= 1 or $apos - ($maxflanklen / 2 - 1) + $i >= $aposmax and $mut->label =~ /termination/) { } 0 0 0
Condition0%0/12
$b ne $a and length $b == 1 and $apos - ($maxflanklen / 2 - 1) + $i >= 1 or $apos - ($maxflanklen / 2 - 1) + $i >= $aposmax and $mut->label =~ /termination/
l!l&&r!l&&!r
000
$b ne $a and length $b == 1 and $apos - ($maxflanklen / 2 - 1) + $i >= 1
!ll&&!rl&&r
000
$b ne $a and length $b == 1
!ll&&!rl&&r
000
$apos - ($maxflanklen / 2 - 1) + $i >= $aposmax and $mut->label =~ /termination/
!ll&&!rl&&r
000
MC/DC0%0/5
$b ne $a and length $b == 1 and $apos - ($maxflanklen / 2 - 1) + $i >= 1 or $apos - ($maxflanklen / 2 - 1) + $i >= $aposmax and $mut->label =~ /termination/
$b ne $a length $b == 1 $apos - ($maxflanklen / 2 - 1) + $i >= 1 $apos - ($maxflanklen / 2 - 1) + $i >= $aposmax $mut->label =~ /termination/
Truth table0%0/10
A and B and C or D and E
A= $b ne $aB= length $b == 1C= $apos - ($maxflanklen / 2 - 1) + $i >= 1D= $apos - ($maxflanklen / 2 - 1) + $i >= $aposmaxE= $mut->label =~ /termination/
ABCDEresult
111XX1
0XX111
10X111
110111
0XX0X0
0XX100
10X0X0
10X100
1100X0
110100
1094 length($b) == 1 and
1095 $apos - ( $maxflanklen/2 -1) + $i >= 1 ) or
1096 ( $apos - ( $maxflanklen/2 -1) + $i >= $aposmax and
1097 $mut->label =~ 'termination')
1098 ) {
1099 0 $aaseqmut .= " ". $b. " ";
1100 } else {
1101 0 $aaseqmut .= " ";
1102 }
1103
1104 0 ▶ if ($i == 0 and length($rseqori[$i]) != 3) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i == 0 and length $rseqori[$i] != 3) 0 0 0
Condition0%0/3
$i == 0 and length $rseqori[$i] != 3
!ll&&!rl&&r
000
MC/DC0%0/2
$i == 0 and length $rseqori[$i] != 3
$i == 0 length $rseqori[$i] != 3
Truth table0%0/3
A and B
A= $i == 0B= length $rseqori[$i] != 3
ABresult
0X0
100
111
1105 0 my $l = 3 - length($rseqori[$i]);
1106 0 $rseqori[$i] = (" " x $l). $rseqori[$i];
1107 0 $rseqmut[$i] = (" " x $l). $rseqmut[$i];
1108 }
1109 0 ▶ $rseqori .= $rseqori[$i]. " " if $rseqori[$i] ne '';
Branch: 1 branch
BranchTrueFalseTotal
if $rseqori[$i] ne "" 0 0 0
1110 0 ▶ $rseqmut .= $rseqmut[$i]. " " if $rseqmut[$i] ne '';
Branch: 1 branch
BranchTrueFalseTotal
if $rseqmut[$i] ne "" 0 0 0
1111 }
1112
1113 # collect the results
1114 0 push (@entry,
1115 "\n"
1116 );
1117 0 $text = " ". $aaseqmut;
1118 0 push (@entry,
1119 $text
1120 );
1121 0 $text = "Variant : ". $rseqmut;
1122 0 push (@entry,
1123 $text
1124 );
1125 0 $text = "Reference: ". $rseqori;
1126 0 push (@entry,
1127 $text
1128 );
1129 0 $text = " ". $aaseqori;
1130 0 push (@entry,
1131 $text
1132 );
1133 0 push (@entry,
1134 "\n"
1135 );
1136 }
1137  
1138 }
1139  
1140 0 my $res;
1141 0 foreach my $line (@entry) {
1142 0 $res .= "$line\n";
1143 }
1144 0 return $res;
1145 }
1146  
1147 6 1;
↑ Summary Variation/AAChange.pm »