Bio/Tools/Prediction/Gene.pm

filter: Statementstmt 100% 21 / 21 Branchbran 66.6% 4 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 3 / 3 totaltotal 87.5% 35 / 40 CC 5 SCAR 7.6
CC
5
Cov
90%
new
3.1
predicted_cds
2.0
predicted_protein
2.0
CRAP 2.1
« Bio/Matrix/Mlagan.pm ↑ Summary Bio/Matrix/PSM/SiteMatrixI.pm »
1 #
2 # BioPerl module for Bio::Tools::Prediction::Gene
3 #
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 #
6 # Cared for by Hilmar Lapp <hlapp@gmx.net>
7 #
8 # Copyright Hilmar Lapp
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::Tools::Prediction::Gene - a predicted gene structure feature
17  
18 =head1 SYNOPSIS
19  
20 #See documentation of methods.
21  
22 =head1 DESCRIPTION
23  
24 A feature representing a predicted gene structure. This class actually
25 inherits off Bio::SeqFeature::Gene::Transcript and therefore has all that
26 functionality, plus a few methods supporting predicted sequence features,
27 like a predicted CDS and a predicted translation.
28  
29 Exons held by an instance of this class will usually be instances of
30 Bio::Tools::Prediction::Exon, although they do not have to be. Refer to the
31 documentation of the class that produced the instance.
32  
33 Normally, you will not want to create an instance of this class yourself.
34 Instead, classes representing the results of gene structure prediction
35 programs will do that.
36  
37 =head1 FEEDBACK
38  
39 =head2 Mailing Lists
40  
41 User feedback is an integral part of the evolution of this and other
42 Bioperl modules. Send your comments and suggestions preferably to one
43 of the Bioperl mailing lists. Your participation is much appreciated.
44  
45 bioperl-l@bioperl.org - General discussion
46 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
47  
48 =head2 Support
49  
50 Please direct usage questions or support issues to the mailing list:
51  
52 I<bioperl-l@bioperl.org>
53  
54 rather than to the module maintainer directly. Many experienced and
55 reponsive experts will be able look at the problem and quickly
56 address it. Please include a thorough description of the problem
57 with code and data examples if at all possible.
58  
59 =head2 Reporting Bugs
60  
61 Report bugs to the Bioperl bug tracking system to help us keep track
62 the bugs and their resolution. Bug reports can be submitted via the
63 web:
64  
65 https://github.com/bioperl/bioperl-live/issues
66  
67 =head1 AUTHOR - Hilmar Lapp
68  
69 Email hlapp-at-gmx.net or hilmar.lapp-at-pharma.novartis.com
70  
71 =head1 APPENDIX
72  
73 The rest of the documentation details each of the object
74 methods. Internal methods are usually preceded with a _
75  
76 =cut
77  
78  
79 # Let the code begin...
80  
81  
82 package Bio::Tools::Prediction::Gene;
83 10 $Bio::Tools::Prediction::Gene::VERSION = '1.7.8';
84 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
85  
86  
87  
88 10 ▶use base qw(Bio::SeqFeature::Gene::Transcript);
Subroutine BEGIN: called CC=1 SCAR=0.0
89  
90 82 ▶sub new {
Subroutine new: called CC=3 SCAR=11.2
Pod documented
91 82 my($class,@args) = @_;
92
93 82 my $self = $class->SUPER::new(@args);
94  
95 82 my ($primary,$ptag) = $self->_rearrange([qw(PRIMARY PRIMARY_TAG)],@args);
96 82 ▶ $self->primary_tag('predicted_gene') unless $primary || $ptag;
Branch: 1 branch
BranchTrueFalseTotal
unless $primary or $ptag 0 82 82
Condition66%2/3
$primary or $ptag
l!l&&r!l&&!r
28540
MC/DC0%0/2
$primary or $ptag
$primary $ptag
Truth table66%2/3
A or B
A= $primaryB= $ptag
ABresult
1X1
011
000
97  
98 82 return $self;
99 }
100  
101  
102 =head2 predicted_cds
103  
104 Title : predicted_cds
105 Usage : $predicted_cds_dna = $gene->predicted_cds();
106 $gene->predicted_cds($predicted_cds_dna);
107 Function: Get/Set the CDS (coding sequence) as predicted by a program.
108  
109 This method is independent of an attached_seq. There is no
110 guarantee whatsoever that the returned CDS has anything to do
111 (e.g., matches) with the sequence covered by the exons as annotated
112 through this object.
113  
114 Example :
115 Returns : A Bio::PrimarySeqI implementing object holding the DNA sequence
116 defined as coding by a prediction of a program.
117 Args : On set, a Bio::PrimarySeqI implementing object holding the DNA
118 sequence defined as coding by a prediction of a program.
119  
120 =cut
121  
122 6 ▶sub predicted_cds {
Subroutine predicted_cds: called CC=2 SCAR=7.0
Pod documented
123 6 my ($self, $cds) = @_;
124  
125 6 ▶ if(defined($cds)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $cds) 6 0 6
126 6 $self->{'_predicted_cds'} = $cds;
127 }
128 6 return $self->{'_predicted_cds'};
129 }
130  
131 =head2 predicted_protein
132  
133 Title : predicted_protein
134 Usage : $predicted_protein_seq = $gene->predicted_protein();
135 $gene->predicted_protein($predicted_protein_seq);
136 Function: Get/Set the protein translation as predicted by a program.
137  
138 This method is independent of an attached_seq. There is no
139 guarantee whatsoever that the returned translation has anything to
140 do with the sequence covered by the exons as annotated
141 through this object, or the sequence returned by predicted_cds(),
142 although it should usually be just the standard translation.
143  
144 Example :
145 Returns : A Bio::PrimarySeqI implementing object holding the protein
146 translation as predicted by a program.
147 Args : On set, a Bio::PrimarySeqI implementing object holding the protein
148 translation as predicted by a program.
149  
150 =cut
151  
152 26 ▶sub predicted_protein {
Subroutine predicted_protein: called CC=2 SCAR=6.9
Pod documented
153 26 my ($self, $aa) = @_;
154  
155 26 ▶ if(defined($aa)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $aa) 23 3 26
156 23 $self->{'_predicted_aa'} = $aa;
157 }
158 26 return $self->{'_predicted_aa'};
159 }
160  
161 #
162 # Everything else is just inherited from SeqFeature::GeneStructure.
163 #
164  
165 10 1;
« Bio/Matrix/Mlagan.pm ↑ Summary Bio/Matrix/PSM/SiteMatrixI.pm »