0
|
1 # $Id: Exon.pm,v 1.8 2001/06/18 08:27:53 heikki Exp $
|
|
2 #
|
|
3 # bioperl module for Bio::LiveSeq::Exon
|
|
4 #
|
|
5 # Cared for by Joseph Insana <insana@ebi.ac.uk> <jinsana@gmx.net>
|
|
6 #
|
|
7 # Copyright Joseph Insana
|
|
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::LiveSeq::Exon - Range abstract class for LiveSeq
|
|
16
|
|
17 =head1 SYNOPSIS
|
|
18
|
|
19 # documentation needed
|
|
20
|
|
21 =head1 DESCRIPTION
|
|
22
|
|
23 Class for EXON objects. They consist of a beginlabel, an endlabel (both
|
|
24 referring to a LiveSeq DNA object) and a strand.
|
|
25 The strand could be 1 (forward strand, default), -1 (reverse strand).
|
|
26
|
|
27 =head1 AUTHOR - Joseph A.L. Insana
|
|
28
|
|
29 Email: Insana@ebi.ac.uk, jinsana@gmx.net
|
|
30
|
|
31 Address:
|
|
32
|
|
33 EMBL Outstation, European Bioinformatics Institute
|
|
34 Wellcome Trust Genome Campus, Hinxton
|
|
35 Cambs. CB10 1SD, United Kingdom
|
|
36
|
|
37 =head1 APPENDIX
|
|
38
|
|
39 The rest of the documentation details each of the object
|
|
40 methods. Internal methods are usually preceded with a _
|
|
41
|
|
42 =cut
|
|
43
|
|
44 # Let the code begin...
|
|
45
|
|
46 package Bio::LiveSeq::Exon;
|
|
47 $VERSION=1.1;
|
|
48
|
|
49 # Version history:
|
|
50 # Mon Mar 20 22:26:13 GMT 2000 v 1.0 begun
|
|
51 # Wed Apr 12 12:42:56 BST 2000 v 1.1 get_Transcript added
|
|
52
|
|
53 use strict;
|
|
54 use vars qw($VERSION @ISA);
|
|
55 use Bio::LiveSeq::Range 1.2; # uses Range, inherits from it
|
|
56 @ISA=qw(Bio::LiveSeq::Range);
|
|
57
|
|
58 =head2 new
|
|
59
|
|
60 Title : new
|
|
61 Usage : $exon1 = Bio::LiveSeq::Exon-> new(-seq => $objref,
|
|
62 -start => $startlabel,
|
|
63 -end => $endlabel, -strand => 1);
|
|
64
|
|
65 Function: generates a new Bio::LiveSeq::Exon
|
|
66 Returns : reference to a new object of class Exon
|
|
67 Errorcode -1
|
|
68 Args : two labels and an integer
|
|
69
|
|
70 =cut
|
|
71
|
|
72 =head2 get_Transcript
|
|
73
|
|
74 Title : get_Transcript
|
|
75 Usage : $transcript = $obj->get_Transcript()
|
|
76 Function: retrieves the reference to the object of class Transcript (if any)
|
|
77 attached to a LiveSeq object
|
|
78 Returns : object reference
|
|
79 Args : none
|
|
80 Note : only Exons that compose a Transcript (i.e. those created out of
|
|
81 a CDS Entry-Feature) will have an attached Transcript
|
|
82
|
|
83 =cut
|
|
84
|
|
85 sub get_Transcript {
|
|
86 my $self=shift;
|
|
87 return ($self->{'transcript'}); # this is set on all Exons a Transcript is made of when Transcript->new is called
|
|
88 }
|
|
89
|
|
90 # this checks if the attached Transcript has a Gene object attached
|
|
91 sub gene {
|
|
92 my ($self,$value) = @_;
|
|
93 if (defined $value) {
|
|
94 $self->{'gene'} = $value;
|
|
95 }
|
|
96 unless (exists $self->{'gene'}) {
|
|
97 unless (exists $self->get_Transcript->{'gene'}) {
|
|
98 return (0);
|
|
99 } else {
|
|
100 return ($self->get_Transcript->{'gene'});
|
|
101 }
|
|
102 } else {
|
|
103 return $self->{'gene'};
|
|
104 }
|
|
105 }
|
|
106
|
|
107 1;
|