Bio/Tools/Primer/Pair.pm

filter: Statementstmt 16.1% 5 / 31 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 16.6% 1 / 6 Podpod 20.0% 1 / 5 totaltotal 10.4% 7 / 67 CC 9 SCAR 26.6
CC
9
Cov
10%
left
20.0
right
20.0
new
12.0
CRAP 14.4
« Bio/Matrix/PSM/IO/mast.pm ↑ Summary Bio/SearchIO/waba.pm »
1 # BioPerl module for Bio::Tools::Primer::Pair
2 #
3 # Please direct questions and support issues to <bioperl-l@bioperl.org>
4 #
5 # Cared for by Ewan Birney <birney@ebi.ac.uk>
6 #
7 # Copyright Ewan Birney
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 =head1 NAME
14  
15 Bio::Tools::Primer::Pair - two primers on left and right side
16  
17 =head1 SYNOPSIS
18  
19 use Bio::Tools::Primer::Pair;
20  
21 my $pair = Bio::Tools::Primer::Pair->new( -left => $leftp , -right => $rightp);
22  
23 # helper functions
24  
25 print "GC percentage different",$pf->gc_difference(),"\n";
26 print "product length is ",$pf->product_length,"\n";
27  
28  
29  
30 =head1 DESCRIPTION
31  
32 Primer Pairs represents one primer in a primer pair. This object is mainly for
33 designing primers, and probably principly used in the primer design system
34  
35 =head1 FEEDBACK
36  
37 =head2 Mailing Lists
38  
39 User feedback is an integral part of the evolution of this and other
40 Bioperl modules. Send your comments and suggestions preferably to
41 the Bioperl mailing list. Your participation is much appreciated.
42  
43 bioperl-l@bioperl.org - General discussion
44 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
45  
46 =head2 Support
47  
48 Please direct usage questions or support issues to the mailing list:
49  
50 I<bioperl-l@bioperl.org>
51  
52 rather than to the module maintainer directly. Many experienced and
53 reponsive experts will be able look at the problem and quickly
54 address it. Please include a thorough description of the problem
55 with code and data examples if at all possible.
56  
57 =head2 Reporting Bugs
58  
59 Report bugs to the Bioperl bug tracking system to help us keep track
60 of the bugs and their resolution. Bug reports can be submitted via the
61 web:
62  
63 https://github.com/bioperl/bioperl-live/issues
64  
65 =head1 AUTHOR - Ewan Birney
66  
67 Email birney-at-ebi.ac.uk
68  
69 =head1 APPENDIX
70  
71 The rest of the documentation details each of the object methods.
72 Internal methods are usually preceded with a _
73  
74 =cut
75  
76  
77 # Let the code begin...
78  
79  
80  
81 package Bio::Tools::Primer::Pair;
82 1 $Bio::Tools::Primer::Pair::VERSION = '1.7.8';
83 1 ▶use base qw(Bio::Root::Root);
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
86 0 my ( $caller, @args) = @_;
87 0 my ($self) = $caller->SUPER::new(@args);
88  
89 0 my ($left,$right) = $self->_rearrange([qw(LEFT RIGHT)],@args);
90  
91 0 ▶ if( !defined $left || !defined $right ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $left and defined $right) 0 0 0
Condition0%0/3
defined $left and defined $right
!ll&&!rl&&r
000
MC/DC0%0/2
defined $left and defined $right
defined $left defined $right
Truth table0%0/3
A and B
A= defined $leftB= defined $right
ABresult
0X0
100
111
92 0 $self->throw("Pair must be initialised with left and right primers");
93 }
94  
95 0 $self->left($left);
96 0 $self->right($right);
97  
98 # done - we hope
99 0 return $self;
100 }
101  
102 0 ▶sub left {
Subroutine left: not called CC=4 SCAR=30.0
Pod undocumented
103 0 my $self = shift;
104 0 my $left = shift;
105  
106 0 ▶ if( defined $left ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $left) 0 0 0
107 0 ▶ if( !ref $left || !$left->isa("Bio::Tools::Primer::Feature") ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $left and $left->isa("Bio::Tools::Primer::Feature")) 0 0 0
Condition0%0/3
ref $left and $left->isa("Bio::Tools::Primer::Feature")
!ll&&!rl&&r
000
MC/DC0%0/2
ref $left and $left->isa("Bio::Tools::Primer::Feature")
ref $left $left->isa("Bio::Tools::Primer::Feature")
Truth table0%0/3
A and B
A= ref $leftB= $left->isa("Bio::Tools::Primer::Feature")
ABresult
0X0
100
111
108 0 $self->throw("left primer must be a Bio::Tools::Primer::Feature, not $left");
109 }
110 0 $self->{'left'} = $left;
111 }
112  
113 0 return $self->{'left'};
114 }
115  
116  
117 0 ▶sub right {
Subroutine right: not called CC=4 SCAR=30.0
Pod undocumented
118 0 my $self = shift;
119 0 my $right = shift;
120  
121 0 ▶ if( defined $right ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $right) 0 0 0
122 0 ▶ if( !ref $right || !$right->isa("Bio::Tools::Primer::Feature") ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $right and $right->isa("Bio::Tools::Primer::Feature")) 0 0 0
Condition0%0/3
ref $right and $right->isa("Bio::Tools::Primer::Feature")
!ll&&!rl&&r
000
MC/DC0%0/2
ref $right and $right->isa("Bio::Tools::Primer::Feature")
ref $right $right->isa("Bio::Tools::Primer::Feature")
Truth table0%0/3
A and B
A= ref $rightB= $right->isa("Bio::Tools::Primer::Feature")
ABresult
0X0
100
111
123 0 $self->throw("right primer must be a Bio::Tools::Primer::Feature, not $right");
124 }
125 0 $self->{'right'} = $right;
126 }
127  
128 0 return $self->{'right'};
129 }
130  
131 0 ▶sub gc_difference {
Subroutine gc_difference: not called CC=1 SCAR=6.9
Pod undocumented
132 0 my $self = shift;
133  
134 0 return abs ( $self->left->gc_percent - $self->right->gc_percent );
135 }
136  
137 0 ▶sub product_length {
Subroutine product_length: not called CC=1 SCAR=6.9
Pod undocumented
138 0 my $self = shift;
139  
140 0 return $self->right->end - $self->left->start +1;
141 }
142  
143  
144 1 1;
« Bio/Matrix/PSM/IO/mast.pm ↑ Summary Bio/SearchIO/waba.pm »