~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to Bio/SeqFeature/Gene/Transcript.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: Transcript.pm,v 1.32 2003/08/10 17:13:43 jason Exp $
 
1
# $Id: Transcript.pm,v 1.38.4.1 2006/10/02 23:10:28 sendu Exp $
2
2
#
3
3
# BioPerl module for Bio::SeqFeature::Gene::Transcript
4
4
#
22
22
 
23
23
A feature representing a transcript.
24
24
 
25
 
 
26
25
=head1 FEEDBACK
27
26
 
28
27
=head2 Mailing Lists
29
28
 
30
 
User feedback is an integral part of the evolution of this
31
 
and other Bioperl modules. Send your comments and suggestions preferably
32
 
 to one of the Bioperl mailing lists.
33
 
Your participation is much appreciated.
 
29
User feedback is an integral part of the evolution of this and other
 
30
Bioperl modules. Send your comments and suggestions preferably to one
 
31
of the Bioperl mailing lists.  Your participation is much appreciated.
34
32
 
35
 
  bioperl-l@bioperl.org          - General discussion
36
 
  http://bio.perl.org/MailList.html             - About the mailing lists
 
33
  bioperl-l@bioperl.org                  - General discussion
 
34
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
37
35
 
38
36
=head2 Reporting Bugs
39
37
 
40
38
Report bugs to the Bioperl bug tracking system to help us keep track
41
 
 the bugs and their resolution.
42
 
 Bug reports can be submitted via email or the web:
 
39
 the bugs and their resolution.  Bug reports can be submitted via the
 
40
 web:
43
41
 
44
 
  bioperl-bugs@bio.perl.org
45
 
  http://bugzilla.bioperl.org/
 
42
  http://bugzilla.open-bio.org/
46
43
 
47
44
=head1 AUTHOR - Hilmar Lapp
48
45
 
49
46
Email hlapp@gmx.net
50
47
 
51
 
Describe contact details here
52
 
 
53
48
=head1 APPENDIX
54
49
 
55
50
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
60
55
# Let the code begin...
61
56
 
62
57
package Bio::SeqFeature::Gene::Transcript;
63
 
use vars qw(@ISA);
64
58
use strict;
65
59
 
66
 
# Object preamble - inherits from Bio::Root::Object
67
60
 
68
 
use Bio::SeqFeature::Gene::TranscriptI;
69
 
use Bio::SeqFeature::Generic;
70
61
use Bio::PrimarySeq;
71
62
 
72
 
@ISA = qw(Bio::SeqFeature::Generic Bio::SeqFeature::Gene::TranscriptI);
 
63
use base qw(Bio::SeqFeature::Generic Bio::SeqFeature::Gene::TranscriptI);
73
64
 
74
65
sub new {
75
66
    my ($caller, @args) = @_;
294
285
    if((! defined($strand)) || ($strand != -1) || (! $rev_order)) {
295
286
        # always sort forward for plus-strand transcripts, and for negative-
296
287
        # strand transcripts that appear to be unsorted or forward sorted
297
 
        @exons = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, $_->start()] } @exons;
 
288
        @exons = map { $_->[0] } sort { $a->[1] <=> $b->[1] } 
 
289
                 map { [ $_, $_->start * ($_->strand || 1)] } @exons;
298
290
    } else {
299
291
        # sort in reverse order for transcripts on the negative strand and
300
292
        # found to be in reverse order
479
471
 Function: Returns the CDS (coding sequence) as defined by the exons
480
472
           of this transcript and the attached sequence.
481
473
 
482
 
           If no sequence is attached this method will return undef.
 
474
           If no sequence is attached this method will return false.
483
475
 
484
476
           Note that the implementation provided here returns a
485
477
           concatenation of all coding exons, thereby assuming that
500
492
    my @exons = $self->exons_ordered();  #this is always sorted properly according to strand
501
493
    my $strand;
502
494
 
503
 
    return undef unless(@exons);
 
495
    return  unless(@exons);
504
496
    # record strand (a minus-strand transcript must have the exons sorted in
505
497
    # reverse order)
506
498
    foreach my $exon (@exons) {
513
505
        }
514
506
    }
515
507
    my $cds = $self->_make_cds(@exons);
516
 
    return undef unless $cds;
 
508
    return unless $cds;
517
509
    return Bio::PrimarySeq->new('-id' => $self->seq_id(),
518
510
                                '-seq' => $cds,
519
511
                                '-alphabet' => "dna");
540
532
 
541
533
    $seq = $self->cds();
542
534
    return $seq->translate() if $seq;
543
 
    return undef;
 
535
    return;
544
536
}
545
537
 
546
538
=head2 mrna
586
578
    if($self->poly_A_site()) {
587
579
        $seq->seq($seq->seq() . $self->poly_A_site()->seq()->seq());
588
580
    }
589
 
    return undef if($seq->length() == 0);
 
581
    return if($seq->length() == 0);
590
582
    return $seq;
591
583
}
592
584