Bio::EnsEMBL::Variation TranscriptVariation
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Variation::TranscriptVariation
Package variables
Privates (from "my" definitions)
%CONSEQUENCE_TYPES = %Bio::EnsEMBL::Variation::ConsequenceType::CONSEQUENCE_TYPES
Included modules
Bio::EnsEMBL::Storable
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Bio::EnsEMBL::Variation::ConsequenceType
Inherit
Bio::EnsEMBL::Storable
Synopsis
  use Bio::EnsEMBL::Variation::TranscriptVariation;
$tr_var = Bio::EnsEMBL::Variation::TranscriptVariation->new (-transcript => $transcript, -pep_allele_string => 'N/K', -cdna_start => 1127, -cdna_end => 1127, -translation_start => 318, -translation_end => 318, -consequence_type => 'NON_SYNONYMOUS_CODING'); print "variation: ", $tr_var->variation_feature()->variation_name(), "\n"; print "transcript: ", $tr_var->transcript->stable_id(), "\n"; print "consequence type: ", $tr_var->consequence_type(), "\n"; print "cdna coords: ", $tr_var->cdna_start(), '-', $tr_var->cdna_end(), "\n"; print "pep coords: ", $tr_var->translation_start(), '-', $tr_var->translation_end(), "\n"; print "amino acid change: ", $tr_var->pep_allele_string(), "\n";
Description
A TranscriptVariation object represents a variation feature which is in close
proximity to an Ensembl transcript. A TranscriptVariation object has several
attributes which define the relationship of the variation to the transcript.
Methods
cdna_endDescriptionCode
cdna_startDescriptionCode
consequence_typeDescriptionCode
display_consequenceDescriptionCode
newDescriptionCode
new_fast
No description
Code
pep_allele_stringDescriptionCode
transcriptDescriptionCode
translation_endDescriptionCode
translation_startDescriptionCode
variation_featureDescriptionCode
Methods description
cdna_endcode    nextTop
  Arg [1]    : (optional) int $end
Example : $cdna_end = $trvar->cdna_end();
Description: Getter/Setter for the end position of this variation on the
transcript in cdna coordinates.
Returntype : int
Exceptions : throw if $end is not an int
throw if $end < 0
Caller : general
Status : Stable
cdna_startcodeprevnextTop
  Arg [1]    : (optional) int $start
Example : $cdna_start = $trvar->cdna_start();
Description: Getter/Setter for the start position of this variation on the
transcript in CDNA coordinates.
Returntype : int
Exceptions : throw if $start is not an int
throw if $start < 1
Caller : general
Status : Stable
consequence_typecodeprevnextTop
  Arg [1]    : (optional) string $consequence_type
Example : if($tr_var->consequence_type()->[0] eq 'INTRONIC') { do_something(); }
Description: Getter/Setter for the consequence type of this transcript variation.
Allowed values are: 'ESSENTIAL_SPLICE_SITE','STOP_GAINED','STOP_LOST','FRAMESHIFT_CODING',
'NON_SYNONYMOUS_CODING','SPLICE_SITE','SYNONYMOUS_CODING','REGULATORY_REGION',
'5PRIME_UTR','3PRIME_UTR','INTRONIC','UPSTREAM','DOWNSTREAM'
Returntype : ref to array of strings
Exceptions : throw if provided argument is not one of the valid strings
Caller : general
Status : At Risk
display_consequencecodeprevnextTop
  Args       : none
Example : $display_consequence = $tv->display_consequence();
Description: Getter for the consequence type to display,
when more than one
Returntype : string
Exceptions : throw on incorrect argument
Caller : webteam
Status : At Risk
newcodeprevnextTop
  Arg [-ADAPTOR] :
Bio::EnsEMBL::Variation::DBSQL::TranscriptVariationAdaptor
Arg [-DBID] : int the unique internal identifier for this TranscriptVariation Arg [-TRANSCRIPT] : Bio::EnsEMBL::Transcript - The transcript affected by this TranscriptVariation Arg [-PEP_ALLELE_STRING] : string - A '/' delimited string representing amino acids altered by this variation Arg [-CDNA_START] : The start of this variation on the associated transcript in cdna coordinates Arg [-CDNA_END] : The end of this variation on the associated transcript in cdna coordinates Arg [-TRANSLATION_START] : The start of this variation on the translation of the associated transcript in peptide coordinates Arg [-TRANSLATION_END] : The end of this variation on the translation of the associated transcript in peptide coordinates Arg [-CONSEQUENCE_TYPE] : The type of this TranscriptVariation. Must be one of: 'INTRONIC', 'UPSTREAM', 'DOWNSTREAM', 'SYNONYMOUS_CODING', 'NON_SYNONYMOUS_CODING', 'FRAMESHIFT_CODING', '5PRIME_UTR', '3PRIME_UTR' Example : $tr_var = Bio::EnsEMBL::Variation::TranscriptVariation->new (-transcript => $transcript, -pep_allele_string => 'N/K', -cdna_start => 1127, -cdna_end => 1127, -translation_start => 318, -translation_end => 318, -consequence_type => 'NON_SYNONYMOUS_CODING'); Description: Constructor. Instantiates a Bio::EnsEMBL::Variation::TranscriptVariation object Returntype : Bio::EnsEMBL::Variation::TranscriptVariation Exceptions : throw on bad argument Caller : general, TranscriptVariationAdaptor Status : At Risk
pep_allele_stringcodeprevnextTop
  Arg [1]    : string $allele (optional) 
The new value to set the pep_allele_string attribute to
Example : $pep_allele_string = $obj->pep_allele_string()
Description: Getter/Setter for the pep_allele_string attribute. The
pep allele string is a '/' delimited string of amino acid
codes representing the change to the peptide made by this
variation. A '-' represents one half of a insertion/deletion.
The reference allele (the one found in the ensembl peptide)
should be first.
Returntype : string
Exceptions : none
Caller : general
Status : Stable
transcriptcodeprevnextTop
  Arg [1]    : (optional) Bio::EnsEMBL::Transcript $transcript
Example : print $trvar->transcript()->stable_id(), "\n";
Description: Getter/Setter for the Transcript that is affected by this
TranscriptVariation.
Returntype : Bio::EnsEMBL::Transcript
Exceptions : throw on bad argument
Caller : general
Status : At Risk
translation_endcodeprevnextTop
  Arg [1]    : (optional) int $tl_end
Example : $tl_end = $trvar->translation_end();
Description: Getter/Setter for the end position of this variation on the
translation of the associated transcript in peptide coordinates.
Returntype : int
Exceptions : throw if $end is not an int
throw if $end < 0
Caller : general
Status : Stable
translation_startcodeprevnextTop
  Arg [1]    : (optional) int $tl_start
Example : $tl_start = $trvar->translation_start();
Description: Getter/Setter for the start position of this variation on the
translation of the associated transcript in peptide coordinates.
Returntype : int
Exceptions : throw if $start is not an int
throw if $start < 0
Caller : general
Status : Stable
variation_featurecodeprevnextTop
  Args       : none
Example : print $trvar->variation_feature()->variation_name(), "\n";
Description: Getter for the VariationFeature associated with this
transcript variation.
Returntype : Bio::EnsEMBL::Variation::VariationFeature
Exceptions : none
Caller : general
Status : At Risk
Methods code
cdna_enddescriptionprevnextTop
sub cdna_end {
  my $self = shift;

  if(@_) {
    my $cdna_end = shift;
    if(defined($cdna_end) && ($cdna_end !~ /^\d+$/ || $cdna_end < 0)) {
      throw('cdna end must be an integer greater than or equal to 0');
    }
    $self->{'cdna_end'} = $cdna_end;
  }

  return $self->{'cdna_end'};
}
cdna_startdescriptionprevnextTop
sub cdna_start {
  my $self = shift;

  if(@_) {
    my $cdna_start = shift;
    if(defined($cdna_start) && ($cdna_start !~ /^\d+$/ || $cdna_start < 1)) {
      throw('cdna start must be an integer greater than 0');
    }
    $self->{'cdna_start'} = $cdna_start;
  }
  return $self->{'cdna_start'};
}
consequence_typedescriptionprevnextTop
sub consequence_type {
  my $self = shift;
 
  if(@_) {
      my $consequence_type = shift;
      if(defined($consequence_type)) {
	  $consequence_type = uc($consequence_type);  
	  if(!$CONSEQUENCE_TYPES{$consequence_type}) {
	      my $valid = join(',',map({"'$_'"} keys(%CONSEQUENCE_TYPES)));
	      throw("Type argument must be one of: $valid");
	  } 
	    
      }
      push @{$self->{'consequence_type'}}, $consequence_type;
  }
  
  return $self->{'consequence_type'};
}
display_consequencedescriptionprevnextTop
sub display_consequence {
    my $self = shift;

    my $highest_priority;

    #get the value to display from the consequence_type attribute
$highest_priority = 'INTERGENIC'; foreach my $ct (@{$self->consequence_type}){ if ($CONSEQUENCE_TYPES{$ct} < $CONSEQUENCE_TYPES{$highest_priority}){ $highest_priority = $ct; } } return $highest_priority; } 1;
}
newdescriptionprevnextTop
sub new {
  my $class = shift;

  my ($vf, $tr, $pep_allele, $cdna_start,$cdna_end, $tl_start,$tl_end, $consequence_type,
      $dbID, $adaptor, $transcript) =
    rearrange([qw(VARIATION_FEATURE TRANSCRIPT PEP_ALLELE_STRING CDNA_START
                  CDNA_END TRANSLATION_START TRANSLATION_END CONSEQUENCE_TYPE
                  DBID ADAPTOR TRANSCRIPT)], @_);

  if(defined($consequence_type)) {
      my @consequences = split /,/,@{$consequence_type};
      foreach my $consequence (@consequences){
	  $consequence = uc($consequence);  
	  if(!$CONSEQUENCE_TYPES{$consequence}) {
	      my $valid = join(',',map({"'$_'"} keys(%CONSEQUENCE_TYPES)));
	      throw("Type argument must be one of: $valid");
	  } 
      }   
  }

  if(defined($cdna_start) && ($cdna_start !~ /^\d+$/ || $cdna_start < 1)) {
    throw('CDNA start must be greater than or equal to 1');
  }

  if(defined($cdna_end) && ($cdna_end !~ /^\d+$/ || $cdna_start < 0)) {
    throw('CDNA end must be greater than or equal to 0');
  }

  if(defined($tl_start) && ($tl_start !~ /^\d+$/ || $tl_start < 1)) {
    throw('Translation start must be greater than or equal to 1');
  }

  if(defined($tl_end) && ($tl_end !~ /^\d+$/ || $tl_start < 0)) {
    throw('Translation end must be greater than or equal to 0');
  }

  return bless {'dbID'              => $dbID,
                'adaptor'           => $adaptor,
                'variation_feature' => $vf,
                'transcript'        => $tr,
                'pep_allele_string' => $pep_allele,
                'cdna_start'        => $cdna_start,
                'cdna_end'          => $cdna_end,
                'translation_start' => $tl_start,
                'translation_end'   => $tl_end,
                'consequence_type'  => $consequence_type}, $class;
}
new_fastdescriptionprevnextTop
sub new_fast {
  my $class = shift;
  my $hashref = shift;
  return bless $hashref, $class;
}
pep_allele_stringdescriptionprevnextTop
sub pep_allele_string {
  my $self = shift;
  return $self->{'pep_allele_string'} = shift if(@_);
  return $self->{'pep_allele_string'};
}
transcriptdescriptionprevnextTop
sub transcript {
  my $self = shift;

  if(@_) {
    my $tr = shift;
    if(defined($tr) && (!ref($tr) || !$tr->isa('Bio::EnsEMBL::Transcript'))) {
      throw('Bio::EnsEMBL::Transcript argument expected');
    }
    $self->{'transcript'} = $tr;
  }
  else{
      #lazy-load the transcript object into the transcript_variation, and return it
if (!defined $self->{'transcript'} && $self->{'adaptor'} && defined($self->{'_transcript_id'})){ my $transcript_adaptor = $self->{'adaptor'}->db()->dnadb()->get_TranscriptAdaptor(); $self->transcript($transcript_adaptor->fetch_by_dbID($self->{'_transcript_id'})); delete $self->{'_transcript_id'}; } } return $self->{'transcript'};
}
translation_enddescriptionprevnextTop
sub translation_end {
  my $self = shift;

  if(@_) {
    my $tl_end = shift;
    if(defined($tl_end) && ($tl_end !~ /^\d+$/ || $tl_end < 0)) {
      throw('translation end must be an integer greater than or equal to 0');
    }
    $self->{'translation_end'} = $tl_end;
  }

  return $self->{'translation_end'};
}
translation_startdescriptionprevnextTop
sub translation_start {
  my $self = shift;

  if(@_) {
    my $tl_start = shift;
    if(defined($tl_start) && ($tl_start !~ /^\d+$/ || $tl_start < 1)) {
      throw('translation start must be an integer greater than or equal to 1');
    }
    $self->{'translation_start'} = $tl_start;
  }

  return $self->{'translation_start'};
}
variation_featuredescriptionprevnextTop
sub variation_feature {
  my $self = shift;

  if(defined($self->{'_vf_id'}) && $self->{'adaptor'}){
      #lazy-load  from database on demand
my $vf = $self->{'adaptor'}->db()->get_VariationFeatureAdaptor(); return $vf->fetch_by_dbID($self->{'_vf_id'}); } return $self->{'variation_feature'};
}
General documentation
AUTHOR - Graham McVickerTop
CONTACTTop
Post questions to the Ensembl development list ensembl-dev@ebi.ac.uk