Bio::EnsEMBL::Variation::DBSQL VariationAnnotationAdaptor
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Variation::DBSQL::VariationAnnotationAdaptor
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Bio::EnsEMBL::Variation::Variation
Bio::EnsEMBL::Variation::VariationAnnotation
Inherit
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Synopsis
  $vdb = Bio::EnsEMBL::Variation::DBSQL::DBAdaptor->new(...);
$db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
$va = $vdb->get_VariationAdaptor(); $vaa = $vdb->get_VariationAnnotationAdaptor(); # Get a VariationAnotation by its internal identifier $va = $vaa->fetch_by_dbID(45); # fetch all annotation for a particular variation $v = $va->fetch_by_name('rs56'); foreach $va (@{$vaa->fetch_all_by_Variation($v)}) { print $va->phenotype_name(), $va->phenotype_description(), $va->source_name(), $va->study_type(), $va->local_stable_id(),"\n"; }
Description
This adaptor provides database connectivity between Variation and VariationAnnotation objects.
Methods
_columns
No description
Code
_default_where_clause
No description
Code
_objs_from_sth
No description
Code
_tables
No description
Code
fetch_all_by_VariationDescriptionCode
fetch_all_by_pheonotype_description_source_name
No description
Code
fetch_all_by_pheonotype_name_source_name
No description
Code
Methods description
fetch_all_by_Variationcode    nextTop
  Arg [1]    : Bio::EnsEMBL:Variation::Variation $var
Example : my @vas = @{$vaa->fetch_all_by_Variation($var)};
Description: Retrieves all variation annotations for a given variation.
Returntype : reference to list Bio::EnsEMBL::Variation::VariationAnnotation
Exceptions : throw on bad argument
Caller : general
Status : At Risk
Methods code
_columnsdescriptionprevnextTop
sub _columns {
  return qw( va.variation_annotation_id va.variation_id p.name p.description
             s.name va.study va.study_type va.local_stable_id
             va.associated_gene va.associated_variant_risk_allele
	     va.variation_names va.risk_allele_freq_in_controls va.p_value
             );
}
_default_where_clausedescriptionprevnextTop
sub _default_where_clause {
  my $self = shift;

  return 'va.phenotype_id = p.phenotype_id AND va.source_id = s.source_id';
}
_objs_from_sthdescriptionprevnextTop
sub _objs_from_sth {
  my ($self, $sth) = @_;

  my @features;

  my ($variation_annotation_id,$var_id,$phenotype_name,$phenotype_description,$source_name,$study,$study_type,$local_stable_id,$associated_gene,$associated_variant_risk_allele,$variation_names,$risk_allele_freq_in_controls,$p_value);
  $sth->bind_columns(\$variation_annotation_id,\$var_id,\$phenotype_name,\$phenotype_description,\$source_name,\$study,\$study_type,\$local_stable_id,\$associated_gene,\$associated_variant_risk_allele,\$variation_names,\$risk_allele_freq_in_controls,\$ p_value);

  while($sth->fetch()) {
    push @features, $self->_create_feature_fast('Bio::EnsEMBL::Variation::VariationAnnotation',

    {'dbID' => $variation_annotation_id,
     '_variation_id'         => $var_id,
     'phenotype_name'        => $phenotype_name,
     'phenotype_description' => $phenotype_description,
     'source_name'           => $source_name,
     'study'                 => $study,
     'study_type'            => $study_type,
     'local_stable_id'       => $local_stable_id,
     'associated_gene'       => $associated_gene,
     'associated_variant_risk_allele' => $associated_variant_risk_allele,
     'variation_names'       => $variation_names,
     'risk_allele_freq_in_controls'   => $risk_allele_freq_in_controls,
     'p_value'               => $p_value,
     'adaptor'  => $self,
    });
  }

  return\@ features;


}


1;
}
_tablesdescriptionprevnextTop
sub _tables {
 return (['variation_annotation', 'va'],                       [ 'phenotype', 'p'],
                       [ 'source', 's']);
}
fetch_all_by_VariationdescriptionprevnextTop
sub fetch_all_by_Variation {
  my $self = shift;
  my $var  = shift;

  if(!ref($var) || !$var->isa('Bio::EnsEMBL::Variation::Variation')) {
    throw('Bio::EnsEMBL::Variation::Variation arg expected');
  }

  if(!defined($var->dbID())) {
    throw("Variation arg must have defined dbID");
  }

  return $self->generic_fetch("va.variation_id = ".$var->dbID());
}
fetch_all_by_pheonotype_description_source_namedescriptionprevnextTop
sub fetch_all_by_pheonotype_description_source_name {
  my $self = shift;
  my $phenotype_description  = shift;
  my $source_name = shift;

  throw('phenotype_description argument expected') if(!defined($phenotype_description));

  my $extra_sql = qq( AND p.phenotype_description like '%?%' );
  if (defined $source_name ) {
    $extra_sql .= qq( AND s.name = ?);
  }
  
  return $self->generic_fetch("$extra_sql");
  
}

# method used by superclass to construct SQL
}
fetch_all_by_pheonotype_name_source_namedescriptionprevnextTop
sub fetch_all_by_pheonotype_name_source_name {
  my $self = shift;
  my $phenotype_name  = shift;
  my $source_name = shift;

  throw('phenotype_name argument expected') if(!defined($phenotype_name));

  my $extra_sql = " AND p.phenotype_name = ? ";
  if (defined $source_name ) {
    $extra_sql .= qq( AND s.name = ?);
  }
  
  return $self->generic_fetch("$extra_sql");
}
General documentation
AUTHOR - Yuan ChenTop
CONTACTTop
Post questions to the Ensembl development list ensembl-dev@ebi.ac.uk
fetch_all_by_phenotype_source_nameTop
  Arg [1]    : string $phenotype_name
Arg [2] : string $source_name (optional)
Example : $vaa = $va_adaptor->fetch_by_phenotype_source_name('BD','EGA');
Description: Retrieves a variation annotation object via its phenotype/source name
Returntype : list of ref of Bio::EnsEMBL::Variation::VariationAnnotation
Exceptions : throw if phenotype name argument is not defined
Caller : general
Status : At Risk
fetch_all_by_phenotype_description_source_nameTop
  Arg [1]    : string $phenotype_description
Arg [2] : string $source_name (optional)
Example : $vaa = $va_adaptor->fetch_by_phenotype_description_source_name('diabetes','EGA');
Description: Retrieves a variation annotation object via its phenotype description/source name
Returntype : list of ref of Bio::EnsEMBL::Variation::VariationAnnotation
Exceptions : throw if phenotype name argument is not defined
Caller : general
Status : At Risk