Unverified Commit 64549dcc authored by Kieron Taylor's avatar Kieron Taylor Committed by GitHub
Browse files

Merge pull request #372 from Ensembl/feature/stop_codon_readthrough_edit

Add support for stop codon readthrough as a type of edit. 
parents 7f0dcf01 0d13288b
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2019] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
=head1 CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
=head1 NAME
Bio::EnsEMBL::StopCodonReadthroughEdit - Object representing a stop codon readthrough edit in a sequence
use Bio::EnsEMBL::StopCodonReadthroughEdit;
# Get transcript
my $transcript_adaptor = $db->get_TranscriptAdaptor();
my $transcript = $transcript_adaptor->fetch_by_stable_id("ENST00000217347");
print "Before modifiction: $transcript->translate->seq()\n";
# Construct a stop codon readthrough edit object
my $stop_codon_readthrough_edit = Bio::EnsEMBL::StopCodonReadthroughEdit->new(265);
# Apply post translation edit
my $translated_sequence = $transcript->translate->seq();
print "After modifiction: $translated_sequence\n";
Biologically, STOP codon readthrough is a rare phenomenon whereby translation
does not terminate at an in-frame STOP codon, but instead continues further downstream.
It is believed the STOP codon is instead read as a 'sense' codon, i.e. encodes for an amino acid.
The location of a STOP codon readthrough is indicated by an asterisk (*) in the post translation sequence.
This class edits the sequence to replace the asterisk (*) with an 'X' to make it similar to Uniprot representation.
=head1 METHODS
package Bio::EnsEMBL::StopCodonReadthroughEdit;
use strict;
use warnings;
use parent qw(Bio::EnsEMBL::SeqEdit);
=head2 new
int - start and end position of the stop codon readthrough edit in the sequence
Example : $stop_codon_rt_edit = Bio::EnsEMBL::StopCodonReadthroughEdit->new($position);
Description: Creates a new stop codon readthrough edit object
Returntype : Bio::EnsEMBL::StopCodonReadthroughEdit
Exceptions : none
Caller : general
Status : Stable
sub new {
my ($self, $position) = @_;
my $class = ref($self) || $self;
my $stop_codon_rt_edit = $class->SUPER::new(
-START => $position,
-END => $position,
-ALT_SEQ => 'X',
-CODE => '_stop_codon_readthrough');
return $stop_codon_rt_edit;
......@@ -1108,7 +1108,7 @@ sub get_all_SeqEdits {
my $attribs;
$edits ||= ['initial_met', '_selenocysteine', 'amino_acid_sub'];
$edits ||= ['initial_met', '_selenocysteine', 'amino_acid_sub', '_stop_codon_readthrough'];
foreach my $edit(@{wrap_array($edits)}){
......@@ -1137,6 +1137,20 @@ sub get_all_selenocysteine_SeqEdits {
return $self->get_all_SeqEdits(['_selenocysteine']);
=head2 get_all_stop_codon_SeqEdits
Example : my @edits = @{$translation->get_all_stop_codon_SeqEdits()};
Description: Retrieves all post transcriptional sequence modifications related
to stop codon readthrough
Returntype : Bio::EnsEMBL::SeqEdit
Exceptions : none
sub get_all_stop_codon_SeqEdits {
my ($self) = @_;
return $self->get_all_SeqEdits(['_stop_codon_readthrough']);
=head2 modify_translation
......@@ -20,3 +20,4 @@
20 proj_parent_g projection parent gene Stable identifier of the parent gene this gene was projected from (projection between different species and/or assemblies).
21 proj_parent_t projection parent transcript Stable identifier of the parent transcript this transcript was projected from (projection between different species and/or assemblies).
22 mirna_arm miRNA arm Hairpin arm from which this miRNA has come from
23 _stop_codon_readthrough Stop Codon Readthrough \N
......@@ -19,6 +19,7 @@ use warnings;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Translation;
use Bio::EnsEMBL::Exon;
use Bio::EnsEMBL::StopCodonReadthroughEdit;
use Test::More;
use Test::Warnings;
......@@ -343,4 +344,23 @@ ok(!scalar(@alt_tls));
# Test generic_count(), inherited method from BaseAdaptor
is($ta->generic_count(), @{$ta->list_dbIDs()}, "Number of features from generic_count is equal to the number of dbIDs from list_dbIDs");
# Handling stop codon readthrough edit
my $transcript_adaptor = $db->get_TranscriptAdaptor();
$transcript = $transcript_adaptor->fetch_by_stable_id("ENST00000217347");
diag 'Before X insertion: ', explain($transcript->translate->seq());
my $stop_codon_rt_edit = Bio::EnsEMBL::StopCodonReadthroughEdit->new(265);
my $translated_sequence = $transcript->translate->seq();
diag 'After X insertion: ', explain($translated_sequence);
is($translated_sequence =~ /QEEXEE/, 1, 'X inserted');
is(length($transcript->translate->seq()), length($translated_sequence), 'Length of the sequence pre and post edit is equal');
Markdown is supported
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