Skip to content
Snippets Groups Projects
Commit 30f49774 authored by Graham McVicker's avatar Graham McVicker
Browse files

check length when retrieving exon peptide - some transcripts have incomplete last codons

parent c0a7f8af
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,6 @@ accepts them (at the moment) in a transcript.
Elia Stupka : elia@ebi.ac.uk
Ewan Birney :
=head1 APPENDIX
=cut
package Bio::EnsEMBL::DBSQL::TranscriptAdaptor;
......@@ -164,7 +162,6 @@ sub fetch_by_translation_stable_id {
Returns :
Args : needs a gene ...
=cut
sub store {
......
......@@ -1100,7 +1100,14 @@ sub peptide {
" Is this exon [$self] a member of this transcript [$tr]?");
} elsif(scalar(@coords) == 1) {
my $c = $coords[0];
$pep_str = $tr->translate->subseq($c->start, $c->end);
my $pep = $tr->translate;
#bioperl doesn't give back residues for incomplete codons
#make sure we don't subseq too far...
my ($start, $end);
$end = ($c->end > $pep->length) ? $pep->length : $c->end;
$start = ($c->start < $end) ? $c->start : $end;
$pep_str = $tr->translate->subseq($start, $end);
}
return Bio::Seq->new(-seq => $pep_str,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment