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' ); } |
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 );
$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);
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;
push @out, Bio::EnsEMBL::Map::QtlFeature->new
($self,
$slice,
$seq_region_start,
$seq_region_end,
$qtl,
$analysis);
}
return\@ out;
}
1; } |
sub _tables
{ my $self = shift;
return (['qtl_feature', 'qf'], ['qtl', 'q'],
['qtl_synonym', 'qs']); } |