Bio::EnsEMBL::Map::DBSQL QtlFeatureAdaptor
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Map::DBSQL::QtlFeatureAdaptor
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Bio::EnsEMBL::Map::Qtl
Bio::EnsEMBL::Map::QtlFeature
Inherit
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Synopsis
Description
This module is responsible of retrieving QtlFeatures (and their
associated Qtls) from the database.
The bulk of this objects' methods are inherited from
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Methods
_columns
No description
Code
_default_where_clause
No description
Code
_left_join
No description
Code
_objs_from_sth
No description
Code
_tables
No description
Code
fetch_all_by_QtlDescriptionCode
Methods description
fetch_all_by_Qtlcode    nextTop
  Arg [1]    : Bio::EnsEMBL::Map::Qtl
Example : none
Description: Retrieves a list of QtlFeatures for a given Qtl
Returntype : listref of Bio::EnsEMBL::QtlFeatures
Exceptions : none
Caller : general
Status : Stable
Methods code
_columnsdescriptionprevnextTop
sub _columns {
  my $self = shift;

  return ( 'qf.seq_region_id', 'qf.seq_region_start', 'qf.seq_region_end',
           'q.qtl_id',
           'qf.analysis_id',
           'qs.source_database', 'qs.source_primary_id',
           'q.trait', 'q.lod_score', 'q.flank_marker_id_1',
           'q.flank_marker_id_2', 'q.peak_marker_id' );
}
_default_where_clausedescriptionprevnextTop
sub _default_where_clause {
  my $self = shift;

  return ('qf.qtl_id = q.qtl_id');
}
_left_joindescriptionprevnextTop
sub _left_join {
  return ( [ 'qtl_synonym', 'q.qtl_id = qs.qtl_id' ] );
}
_objs_from_sthdescriptionprevnextTop
sub _objs_from_sth {
  my $self = shift;
  my $sth  = shift;

  my ( $seq_region_id, $seq_region_start, $seq_region_end, $qtl_id,
       $analysis_id, $source_database,
       $source_primary_id, $trait, $lod_score, $flank_marker_id_1,
       $flank_marker_id_2, $peak_marker_id );

  #warning: ordering depends on _columns function implementation
$sth->bind_columns(\$ seq_region_id,\$ seq_region_start,\$ seq_region_end,\$ qtl_id,\$ analysis_id,\$ source_database,\$ source_primary_id,\$ trait,\$ lod_score,\$ flank_marker_id_1,\$ flank_marker_id_2,\$ peak_marker_id ); my @out = (); my %already_seen; my $mad = $self->db()->get_MarkerAdaptor(); my $aad = $self->db()->get_AnalysisAdaptor(); my $sad = $self->db()->get_SliceAdaptor(); while( $sth->fetch()) { my $flank_marker_1 = $flank_marker_id_1 ? $mad->fetch_by_dbID( $flank_marker_id_1 ) : undef; my $flank_marker_2 = $flank_marker_id_2 ? $mad->fetch_by_dbID( $flank_marker_id_2 ) : undef; my $peak_marker = $peak_marker_id ? $mad->fetch_by_dbID( $peak_marker_id ) : undef; my $analysis = $aad->fetch_by_dbID( $analysis_id ); my $slice = $sad->fetch_by_seq_region_id($seq_region_id); #rows with the same qtl contain additional synonyms of the qtl
if(my $qtl = $already_seen{$qtl_id}) { $qtl->add_synonym($source_database, $source_primary_id); next; } my $qtl = Bio::EnsEMBL::Map::Qtl->new ( $qtl_id, $self->db->get_QtlAdaptor(), $flank_marker_1, $peak_marker, $flank_marker_2, $trait, $lod_score, {$source_database => $source_primary_id} ); $already_seen{$qtl_id} = $qtl; #now create a new marker_feature using the marker
push @out, Bio::EnsEMBL::Map::QtlFeature->new ($self, $slice, $seq_region_start, $seq_region_end, $qtl, $analysis); } return\@ out; } 1;
}
_tablesdescriptionprevnextTop
sub _tables {
  my $self = shift;

  return (['qtl_feature', 'qf'], #primary table
['qtl', 'q'], ['qtl_synonym', 'qs']);
}
fetch_all_by_QtldescriptionprevnextTop
sub fetch_all_by_Qtl {
  my $self = shift;
  my $qtl = shift;

  my $constraint = 'q.qtl_id = ' . $qtl->dbID;

  return $self->generic_fetch($constraint, @_);
}
General documentation
LICENSETop
  Copyright (c) 1999-2009 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license. For license details, please see /info/about/code_licence.html
CONTACTTop
  Please email comments or questions to the public Ensembl
developers list at <ensembl-dev@ebi.ac.uk>.
Questions may also be sent to the Ensembl help desk at <helpdesk@ensembl.org>.