StopCodonReadthroughEdit.pm 3.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
=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

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  use Bio::EnsEMBL::StopCodonReadthroughEdit;

  # Get transcript
  my $transcript_adaptor = $db->get_TranscriptAdaptor();
  my $transcript = $transcript_adaptor->fetch_by_stable_id("ENST00000217347");
  $transcript->edits_enabled(1);
  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
  $transcript->translation->add_Attributes($stop_codon_readthrough_edit->get_Attribute());
  my $translated_sequence = $transcript->translate->seq();
  print "After modifiction: $translated_sequence\n";
52 53 54

=head1 DESCRIPTION

55 56 57 58 59
  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.
60
  This class edits the sequence to replace the asterisk (*) with an 'X' to make it similar to RefSeq representation.
61 62 63 64 65 66 67 68

=head1 METHODS

=cut

package Bio::EnsEMBL::StopCodonReadthroughEdit;

use strict;
69
use warnings;
70 71 72 73 74

use parent qw(Bio::EnsEMBL::SeqEdit);

=head2 new

75
  Arg [-POSITION]  :
76
       int - start and end position of the stop codon readthrough edit in the sequence
77

78
  Example    : $stop_codon_rt_edit = Bio::EnsEMBL::StopCodonReadthroughEdit->new($position);
79 80 81 82 83 84 85 86 87
  Description: Creates a new stop codon readthrough edit object
  Returntype : Bio::EnsEMBL::StopCodonReadthroughEdit
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub new {
88 89 90
  my ($self, $position) = @_;

  my $class = ref($self) || $self;
91
  my $stop_codon_rt_edit = $class->SUPER::new(
92 93
        -START   => $position,
        -END     => $position,
94
        -ALT_SEQ => 'X',
95
        -CODE    => '_stop_codon_rt');
96

97
  return $stop_codon_rt_edit;
98 99 100 101

}

1;