File Coverage

Bio/Tools/Spidey/Exon.pm
Criterion Covered Total %
statement 49 52 94.2
branch 10 16 62.5
condition 2 6 33.3
subroutine 9 9 100.0
pod 7 7 100.0
total 77 90 85.5


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Tools::Spidey::Exon
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Ryan Golhar
7             #
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::Spidey::Exon - A single exon determined by an alignment
16              
17             =head1 SYNOPSIS
18              
19             # See Bio::Tools::Spidey::Results for a description of the context.
20              
21             # an instance of this class is-a Bio::SeqFeature::SimilarityPair
22              
23             # coordinates of the exon (recommended way):
24             print "exon from ", $exon->start(),
25             " to ", $exon->end(), "\n";
26              
27             # the same (feature1() inherited from Bio::SeqFeature::FeaturePair)
28             print "exon from ", $exon->feature1()->start(),
29             " to ", $exon->feature1()->end(), "\n";
30             # also the same (query() inherited from Bio::SeqFeature::SimilarityPair):
31             print "exon from ", $exon->query()->start(),
32             " to ", $exon->query()->end(), "\n";
33              
34             # coordinates on the matching EST (recommended way):
35             print "matches on EST from ", $exon->est_hit()->start(),
36             " to ", $exon->est_hit()->end(), "\n";
37              
38             # the same (feature2() inherited from Bio::SeqFeature::FeaturePair)
39             print "matches on EST from ", $exon->feature2()->start(),
40             " to ", $exon->feature2()->end(), "\n";
41             # also the same (subject() inherited from Bio::SeqFeature::SimilarityPair):
42             print "exon from ", $exon->subject()->start(),
43             " to ", $exon->subject()->end(), "\n";
44              
45             =head1 DESCRIPTION
46              
47             This class inherits from Bio::SeqFeature::SimilarityPair and represents an
48             exon on a genomic sequence determined by similarity, that is, by aligning an
49             EST sequence (using Spidey in this case). Consequently, the notion of query and
50             subject is always from the perspective of the genomic sequence: query refers
51             to the genomic seq, subject to the aligned EST hit. Because of this,
52             $exon-Estart(), $exon-Eend() etc will always return what you expect.
53              
54             To get the coordinates on the matching EST, refer to the properties of the
55             feature returned by L().
56              
57             =head1 FEEDBACK
58              
59             =head2 Mailing Lists
60              
61             User feedback is an integral part of the evolution of this
62             and other Bioperl modules. Send your comments and suggestions preferably
63             to one of the Bioperl mailing lists.
64             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             =head2 Support
70              
71             Please direct usage questions or support issues to the mailing list:
72              
73             I
74              
75             rather than to the module maintainer directly. Many experienced and
76             reponsive experts will be able look at the problem and quickly
77             address it. Please include a thorough description of the problem
78             with code and data examples if at all possible.
79              
80             =head2 Reporting Bugs
81              
82             Report bugs to the Bioperl bug tracking system to help us keep track
83             the bugs and their resolution. Bug reports can be submitted via the
84             web:
85              
86             https://github.com/bioperl/bioperl-live/issues
87              
88             =head1 AUTHOR - Ryan Golhar
89              
90             Email golharam@umdnj.edu
91              
92             =head1 APPENDIX
93              
94             The rest of the documentation details each of the object methods.
95             Internal methods are usually preceded with a _
96              
97             =cut
98              
99              
100             # Let the code begin...
101              
102              
103             package Bio::Tools::Spidey::Exon;
104 1     1   3 use strict;
  1         1  
  1         24  
105              
106              
107 1     1   3 use base qw(Bio::SeqFeature::SimilarityPair);
  1         0  
  1         245  
108              
109             sub new {
110 6     6 1 12 my ($class,@args) = @_;
111 6         14 my %param = @args;
112 6         18 my $self = $class->SUPER::new(@args);
113              
114 6         14 my ($prim, $prim_tag, $source, $source_tag) =
115             $self->_rearrange([qw(PRIMARY
116             PRIMARY_TAG
117             SOURCE
118             SOURCE_TAG)],
119             @args);
120              
121 6 50 33     28 $self->primary_tag('exon') unless $prim || $prim_tag;
122 6 50 33     22 $self->source_tag('Spidey') unless $source || $source_tag;
123 6 50       9 $self->strand(0) unless defined($self->strand());
124 6         8 $self->query();
125 6         17 return $self;
126             }
127              
128             =head2 percentage_id
129              
130             Title : percentage_id
131             Usage : $obj->percentage_id
132             Function: This is the percent id as reported by Spidey
133             Returns : value of percentage_id
134             Args :
135              
136              
137             =cut
138              
139             sub percentage_id {
140 6     6 1 13 my ($self, @args) = @_;
141 6         4 my $val;
142            
143 6 50       10 if(@args) {
144 6         5 $val = shift(@args);
145 6         8 $self->{'percentage_id'} = $val;
146             } else {
147 0         0 $val = $self->{'percentage_id'};
148             }
149 6         7 return $val;
150             }
151              
152             =head2 est_hit
153              
154             Title : est_hit
155             Usage : $est_feature = $obj->est_hit();
156             Function: Returns the EST hit pointing to (i.e., aligned to by Spidey) this
157             exon (i.e., genomic region). At present, merely a synonym for
158             $obj->feature2().
159             Returns : An Bio::SeqFeatureI implementing object.
160             Args :
161              
162              
163             =cut
164              
165             sub est_hit {
166 11     11 1 11 my $self = shift;
167 11         23 return $self->feature2(@_);
168             }
169              
170             =head2 mismatches
171              
172             Title : mismatches
173             Usage : $obj->mismatches;
174             Function: Returns the mismatches of the cDNA to (i.e., aligned to by Spidey) this
175             exon (i.e., genomic region).
176             Returns : value of mismatches.
177             Args :
178              
179              
180             =cut
181              
182             sub mismatches {
183 6     6 1 8 my ($self, @args) = @_;
184 6         4 my $val;
185            
186 6 50       7 if(@args) {
187 6         7 $val = shift(@args);
188 6         8 $self->{'mismatches'} = $val;
189             } else {
190 0         0 $val = $self->{'mismatches'};
191             }
192 6         6 return $val;
193             }
194              
195             =head2 gaps
196              
197             Title : gaps
198             Usage : $obj->gaps;
199             Function: Returns the gaps of the cDNA to (i.e., aligned to by Spidey) this
200             exon (i.e., genomic region).
201             Returns : value of gaps.
202             Args :
203              
204              
205             =cut
206              
207             sub gaps {
208 6     6 1 7 my ($self, @args) = @_;
209 6         3 my $val;
210            
211 6 50       7 if(@args) {
212 6         5 $val = shift(@args);
213 6         6 $self->{'gaps'} = $val;
214             } else {
215 0         0 $val = $self->{'gaps'};
216             }
217 6         6 return $val;
218             }
219              
220             =head2 donor
221              
222             Title : donor
223             Usage : $obj->donor;
224             Function: Returns 0 if a splice donor site does not exist, or
225             1 if a splice donor site exists
226             Returns : value of existence of donor splice site (0 or 1)
227             Args :
228              
229              
230             =cut
231              
232             sub donor {
233 8     8 1 9 my ($self, @args) = @_;
234 8         6 my $val;
235              
236 8 100       10 if (@args) {
237 6         6 $val = shift @args;
238 6         7 $self->{'donor'} = $val;
239             } else {
240 2         4 $val = $self->{'donor'};
241             }
242 8         11 return $val;
243             }
244              
245             =head2 acceptor
246              
247             Title : acceptor
248             Usage : $obj->acceptor;
249             Function: Returns 0 if a splice acceptor site does not exist, or
250             1 if a splice acceptor site exists
251             Returns : value of existence of acceptor splice site (0 or 1)
252             Args :
253              
254              
255             =cut
256              
257             sub acceptor {
258 8     8 1 10 my ($self, @args) = @_;
259 8         8 my $val;
260              
261 8 100       9 if (@args) {
262 6         6 $val = shift @args;
263 6         7 $self->{'acceptor'} = $val;
264             } else {
265 2         3 $val = $self->{'acceptor'};
266             }
267 8         13 return $val;
268             }
269              
270              
271             1;