Commit 66f01a20 authored by Shamika Mohanan's avatar Shamika Mohanan
Browse files

Code updated to implement review comments. There is a new package to handle...

Code updated to implement review comments. There is a new package to handle stop codon readthrough in a sequence. Test case has been updated with new regex
parent aeeb6039
=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 <>.
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
my $stopcodonrtedit = Bio::EnsEMBL::StopCodonReadthroughEdit->new($coord);
A representation of a stop codon readthrough edit in a sequence.
=head1 METHODS
package Bio::EnsEMBL::StopCodonReadthroughEdit;
use strict;
use parent qw(Bio::EnsEMBL::SeqEdit);
=head2 new
Arg [-START/END] :
int - start and end postion of the stop codon readthrough edit in the sequence
Example : $stopcodonrtedit = Bio::EnsEMBL::StopCodonReadthroughEdit->new($coord);
Description: Creates a new stop codon readthrough edit object
Returntype : Bio::EnsEMBL::StopCodonReadthroughEdit
Exceptions : none
Caller : general
Status : Stable
sub new {
my ($self, $coord) = @_;
my $caller = shift;
my $class = ref($caller) || $caller;
my $self = $class->SUPER::new(
-START => $coord,
-END => $coord,
-ALT_SEQ => 'X',
-CODE => '_stop_codon_readthrough',
-NAME => 'Stop Codon Readthrough');
return $self;
......@@ -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,28 +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
# Handling stop codon readthrough edit
my $tra_scrt = $db->get_TranscriptAdaptor();
my $tr_scrt = $tra_scrt->fetch_by_stable_id("ENST00000217347");
my $scrt = Bio::EnsEMBL::SeqEdit->new(
-START => 1,
-END => 2,
-ALT_SEQ => 'X',
-CODE => '_stop_codon_readthrough',
-NAME => 'Stop Codon Readthrough'
diag 'Before X insertion: ', explain($tr_scrt->translate->seq());
my $scrt = Bio::EnsEMBL::StopCodonReadthroughEdit->new(265);
my $tlseq_scrt = $tr_scrt->translate->seq();
debug("X inserted: " . $tlseq_scrt);
is($tlseq_scrt =~ /X/, 1, 'X inserted');
diag 'After X insertion: ', explain($tlseq_scrt);
is($tlseq_scrt =~ /QEEXEE/, 1, 'X inserted');
is(length($tr_scrt->translate->seq()), length($tlseq_scrt), '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