Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
WebCvs | Raw content |
my $opa = $db->get_OligoProbeAdaptor();
my $probe = $opa->fetch_by_array_probeset_probe( 'Array-1', undef, 'Probe-1' );
_columns | Description | Code |
_objs_from_sth | Description | Code |
_tables | Description | Code |
fetch_all_by_Array | Description | Code |
fetch_all_by_probeset | Description | Code |
fetch_by_OligoFeature | Description | Code |
fetch_by_array_probeset_probe | Description | Code |
list_dbIDs | Description | Code |
store | Description | Code |
_columns | code | next | Top |
Args : None |
_objs_from_sth | code | prev | next | Top |
Arg [1] : DBI statement handle object |
_tables | code | prev | next | Top |
Args : None |
fetch_all_by_Array | code | prev | next | Top |
Arg [1] : Bio::EnsEMBL::OligoArray |
fetch_all_by_probeset | code | prev | next | Top |
Arg [1] : string - probeset name |
fetch_by_OligoFeature | code | prev | next | Top |
Arg [1] : Bio::EnsEMBL::OligoFeature |
fetch_by_array_probeset_probe | code | prev | next | Top |
Arg [1] : string - name of array |
list_dbIDs | code | prev | next | Top |
Arg [1] : none |
store | code | prev | next | Top |
Arg [1] : List of Bio::EnsEMBL::OligoProbe objects |
_columns | description | prev | next | Top |
my $self = shift; return qw( op.oligo_probe_id op.oligo_array_id op.probeset op.name op.description op.length );}
_objs_from_sth | description | prev | next | Top |
my ($self, $sth) = @_; my (@result, $current_dbid, $probe_id, $array_id, $probeset, $name, $description, $probelength); my ($array, %array_cache); $sth->bind_columns(\$ probe_id,\$ array_id,\$ probeset,\$ name,\$ description,\$ probelength ); my $probe; while ( $sth->fetch() ) { $array = $array_cache{$array_id} || $self->db->get_OligoArrayAdaptor()->fetch_by_dbID($array_id); if (!$current_dbid || $current_dbid != $probe_id) { # New probe}
$probe = Bio::EnsEMBL::OligoProbe->new( -name => $name, -array => $array, -probeset => $probeset, -description => $description, -probelength => $probelength, -dbID => $probe_id, -adaptor => $self, ); push @result, $probe; $current_dbid = $probe_id; } else { # Extend existing probe
$probe->add_Array_probename($array, $name); } } return\@ result;
_tables | description | prev | next | Top |
my $self = shift; return [ 'oligo_probe', 'op' ];}
fetch_all_by_Array | description | prev | next | Top |
my $self = shift; my $array = shift; if ( !ref($array) || !$array->isa('Bio::EnsEMBL::OligoArray') ) { warning('fetch_all_by_Array requires a Bio::EnsEMBL::OligoArray object'); return []; } my $array_id = $array->dbID(); if (!defined $array_id) { warning('fetch_all_by_Array requires a stored Bio::EnsEMBL::OligoArray object'); return []; } $self->bind_param_generic_fetch($array_id, SQL_INTEGER); return $self->generic_fetch("op.oligo_array_id = ?");}
fetch_all_by_probeset | description | prev | next | Top |
my $self = shift; my $probeset = shift; $self->bind_param_generic_fetch($probeset,SQL_VARCHAR); return $self->generic_fetch("op.probeset = ?");}
fetch_by_OligoFeature | description | prev | next | Top |
my $self = shift; my $feature = shift; if ( !ref($feature) || !$feature->isa('Bio::EnsEMBL::OligoFeature') || !$feature->{'_probe_id'} ) { throw('fetch_by_OligoFeature requires a stored Bio::EnsEMBL::OligoFeature object'); } return $self->fetch_by_dbID($feature->{'_probe_id'});}
fetch_by_array_probeset_probe | description | prev | next | Top |
my $self = shift; my $array_name = shift; my $probeset_name = shift; my $probe_name = shift; my $probeset_clause = 'AND op.probeset = ?'; # Need to deal with non-Affy probes where probeset is NULL}
# (Also allow probeset to be empty string, just in case)
if (!$probeset_name) { $probeset_name = ''; $probeset_clause = 'AND (op.probeset IS NULL OR op.probeset = ?)'; } my $sth = $self->prepare(" SELECT oligo_probe_id FROM oligo_probe op, oligo_array oa WHERE op.oligo_array_id = oa.oligo_array_id AND oa.name = ? $probeset_clause AND op.name = ? "); $sth->bind_param(1, $array_name, SQL_VARCHAR); $sth->bind_param(2, $probeset_name, SQL_VARCHAR); $sth->bind_param(3, $probe_name, SQL_VARCHAR); $sth->execute(); my ($probe_id) = $sth->fetchrow(); if ($probe_id) { return $self->fetch_by_dbID($probe_id); } else { return undef; }
list_dbIDs | description | prev | next | Top |
my ($self) = @_; return $self->_list_dbIDs('oligo_probe'); } 1;}
store | description | prev | next | Top |
my ($self, @probes) = @_; if (scalar @probes == 0) { throw('Must call store with a list of OligoProbe objects'); } my $db = $self->db(); PROBE: foreach my $probe (@probes) { if ( !ref $probe || !$probe->isa('Bio::EnsEMBL::OligoProbe') ) { throw('Probe must be an OligoProbe object'); } if ( $probe->is_stored($db) ) { warning('OligoProbe [' . $probe->dbID() . '] is already stored in the database'); next PROBE; } # Get all the arrays this probe is on and check they're all in the database}
my $arrays = $probe->get_all_Arrays(); my @stored_arrays; for my $array (@$arrays) { if ( defined $array->dbID() ) { push @stored_arrays, $array; } } if ( !@stored_arrays ) { warning('Probes need attached arrays to be stored in the database'); next PROBE; } # Insert separate entry (with same oligo_probe_id) in oligo_probe
# for each array the probe is on
my $dbID; for my $array (@stored_arrays) { if (defined $dbID) { # Probe we've seen already
my $sth = $self->prepare(" INSERT INTO oligo_probe (oligo_probe_id, oligo_array_id, name, probeset, description, length) VALUES (?, ?, ?, ?, ?, ?) "); $sth->bind_param(1, $dbID, SQL_INTEGER); $sth->bind_param(2, $array->dbID(), SQL_INTEGER); $sth->bind_param(3, $probe->get_probename($array->name()), SQL_VARCHAR); $sth->bind_param(4, $probe->probeset(), SQL_VARCHAR); $sth->bind_param(5, $probe->description(), SQL_VARCHAR); $sth->bind_param(6, $probe->probelength(), SQL_INTEGER); $sth->execute(); } else { # New probe
my $sth = $self->prepare(" INSERT INTO oligo_probe (oligo_array_id, name, probeset, description, length) VALUES (?, ?, ?, ?, ?) "); $sth->bind_param(1, $array->dbID, SQL_INTEGER); $sth->bind_param(2, $probe->get_probename($array->name()), SQL_VARCHAR); $sth->bind_param(3, $probe->probeset(), SQL_VARCHAR); $sth->bind_param(4, $probe->description(), SQL_VARCHAR); $sth->bind_param(5, $probe->probelength(), SQL_INTEGER); $sth->execute(); $dbID = $sth->{'mysql_insertid'}; $probe->dbID($dbID); $probe->adaptor($self); } } }
LICENSE | Top |
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
CONTACT | Top |
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>.