File Coverage

Bio/Tools/Prediction/Gene.pm
Criterion Covered Total %
statement 19 19 100.0
branch 4 6 66.6
condition 2 3 66.6
subroutine 5 5 100.0
pod 3 3 100.0
total 33 36 91.6


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Tools::Prediction::Gene
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Hilmar Lapp
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
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 2     2   7 use strict;
  2         3  
  2         51  
84              
85              
86              
87 2     2   6 use base qw(Bio::SeqFeature::Gene::Transcript);
  2         2  
  2         761  
88              
89             sub new {
90 82     82 1 144 my($class,@args) = @_;
91            
92 82         211 my $self = $class->SUPER::new(@args);
93              
94 82         200 my ($primary,$ptag) = $self->_rearrange([qw(PRIMARY PRIMARY_TAG)],@args);
95 82 50 66     263 $self->primary_tag('predicted_gene') unless $primary || $ptag;
96              
97 82         165 return $self;
98             }
99              
100              
101             =head2 predicted_cds
102              
103             Title : predicted_cds
104             Usage : $predicted_cds_dna = $gene->predicted_cds();
105             $gene->predicted_cds($predicted_cds_dna);
106             Function: Get/Set the CDS (coding sequence) as predicted by a program.
107              
108             This method is independent of an attached_seq. There is no
109             guarantee whatsoever that the returned CDS has anything to do
110             (e.g., matches) with the sequence covered by the exons as annotated
111             through this object.
112              
113             Example :
114             Returns : A Bio::PrimarySeqI implementing object holding the DNA sequence
115             defined as coding by a prediction of a program.
116             Args : On set, a Bio::PrimarySeqI implementing object holding the DNA
117             sequence defined as coding by a prediction of a program.
118              
119             =cut
120              
121             sub predicted_cds {
122 6     6 1 8 my ($self, $cds) = @_;
123              
124 6 50       14 if(defined($cds)) {
125 6         10 $self->{'_predicted_cds'} = $cds;
126             }
127 6         14 return $self->{'_predicted_cds'};
128             }
129              
130             =head2 predicted_protein
131              
132             Title : predicted_protein
133             Usage : $predicted_protein_seq = $gene->predicted_protein();
134             $gene->predicted_protein($predicted_protein_seq);
135             Function: Get/Set the protein translation as predicted by a program.
136              
137             This method is independent of an attached_seq. There is no
138             guarantee whatsoever that the returned translation has anything to
139             do with the sequence covered by the exons as annotated
140             through this object, or the sequence returned by predicted_cds(),
141             although it should usually be just the standard translation.
142              
143             Example :
144             Returns : A Bio::PrimarySeqI implementing object holding the protein
145             translation as predicted by a program.
146             Args : On set, a Bio::PrimarySeqI implementing object holding the protein
147             translation as predicted by a program.
148              
149             =cut
150              
151             sub predicted_protein {
152 26     26 1 1055 my ($self, $aa) = @_;
153              
154 26 100       43 if(defined($aa)) {
155 23         30 $self->{'_predicted_aa'} = $aa;
156             }
157 26         39 return $self->{'_predicted_aa'};
158             }
159              
160             #
161             # Everything else is just inherited from SeqFeature::GeneStructure.
162             #
163              
164             1;