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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
=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
<http://www.ensembl.org/Help/Contact>.
=cut
=head1 NAME
Bio::EnsEMBL::StopCodonReadthroughEdit - Object representing a stop codon readthrough edit in a sequence
=head1 SYNOPSIS
my $stopcodonrtedit = Bio::EnsEMBL::StopCodonReadthroughEdit->new($coord);
=head1 DESCRIPTION
A representation of a stop codon readthrough edit in a sequence.
=head1 METHODS
=cut
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
=cut
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;
}
1;
...@@ -19,6 +19,7 @@ use warnings; ...@@ -19,6 +19,7 @@ use warnings;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Translation; use Bio::EnsEMBL::Translation;
use Bio::EnsEMBL::Exon; use Bio::EnsEMBL::Exon;
use Bio::EnsEMBL::StopCodonReadthroughEdit;
use Test::More; use Test::More;
use Test::Warnings; use Test::Warnings;
...@@ -343,28 +344,23 @@ ok(!scalar(@alt_tls)); ...@@ -343,28 +344,23 @@ ok(!scalar(@alt_tls));
# Test generic_count(), inherited method from BaseAdaptor # 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"); is($ta->generic_count(), @{$ta->list_dbIDs()}, "Number of features from generic_count is equal to the number of dbIDs from list_dbIDs");
#56 #56-57
## #
## Handling stop codon readthrough # Handling stop codon readthrough edit
## #
my $tra_scrt = $db->get_TranscriptAdaptor(); my $tra_scrt = $db->get_TranscriptAdaptor();
my $tr_scrt = $tra_scrt->fetch_by_stable_id("ENST00000217347"); my $tr_scrt = $tra_scrt->fetch_by_stable_id("ENST00000217347");
$tr_scrt->edits_enabled(1); $tr_scrt->edits_enabled(1);
my $scrt = Bio::EnsEMBL::SeqEdit->new( diag 'Before X insertion: ', explain($tr_scrt->translate->seq());
-START => 1,
-END => 2,
-ALT_SEQ => 'X',
-CODE => '_stop_codon_readthrough',
-NAME => 'Stop Codon Readthrough'
);
my $scrt = Bio::EnsEMBL::StopCodonReadthroughEdit->new(265);
$tr_scrt->translation->add_Attributes($scrt->get_Attribute()); $tr_scrt->translation->add_Attributes($scrt->get_Attribute());
my $tlseq_scrt = $tr_scrt->translate->seq(); 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');
done_testing(); done_testing();
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