LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
NAME
Bio::EnsEMBL::DBSQL::AnalysisAdaptor
SYNOPSIS
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$analysis_adaptor =
Bio::EnsEMBL::Registry->get_adaptor( "human", "core", "analysis" );
my $analysis = $analysis_adaptor->fetch_by_logic_name('genscan');
DESCRIPTION
Module to encapsulate all db access for persistent class Analysis.
There should be just one per application and database connection.
METHODS
new
Args : Bio::EnsEMBL::DBSQL::DBAdaptor
Example : my $aa = new Bio::EnsEMBL::DBSQL::AnalysisAdaptor();
Description: Creates a new Bio::EnsEMBL::DBSQL::AnalysisAdaptor object and
internally loads and caches all the Analysis objects from the
database.
Returntype : Bio::EnsEMBL::DBSQL::AnalysisAdaptor
Exceptions : none
Caller : Bio::EnsEMBL::DBSQL::DBAdaptor
Status : Stable
fetch_all
Args : none
Example : my @analysis = @{$analysis_adaptor->fetch_all()};
Description: fetches all of the Analysis objects from the database and caches
them internally.
Returntype : listref of Bio::EnsEMBL::Analysis retrieved from the database
Exceptions : none
Caller : AnalysisAdaptor::new
Status : Stable
fetch_all_by_feature_class
Arg [1] : string $feature_cless - The name of the feature class
Example : my @analyses = @{$analysis_adaptor->fetch_all_by_feature_class('Gene');
Description: Returns all analyses that correspond to a given
feature class; see feature_classes method for a list.
Returntype : Listref of Bio::EnsEMBL::Analysis
Exceptions : none
Caller : general
Status : Stable
fetch_by_dbID
Arg [1] : int $internal_analysis_id - the database id of the analysis
record to retrieve
Example : my $analysis = $analysis_adaptor->fetch_by_dbID(1);
Description: Retrieves an Analysis object from the database via its internal
id.
Returntype : Bio::EnsEMBL::Analysis
Exceptions : none
Caller : general
Status : Stable
fetch_by_logic_name
Arg [1] : string $logic_name the logic name of the analysis to retrieve
Example : my $analysis = $a_adaptor->fetch_by_logic_name('Eponine');
Description: Retrieves an analysis object from the database using its unique
logic name.
Returntype : Bio::EnsEMBL::Analysis
Exceptions : none
Caller : general
Status : Stable
store
Arg [1] : Bio:EnsEMBL::Analysis $analysis
Example : $analysis_adaptor->store($analysis);
Description: Stores $analysis in db. If the analysis is already stored in
the database its dbID and adaptor are updated, but the analysis
is not stored a second time.
Sets created date if not already set. Sets dbID and adaptor
inside $analysis. Returns dbID.
Returntype : int - dbID of stored analysis
Exceptions : throw on incorrect argument
throw if analysis argument does not have a logic name
Caller : general
Status : Stable
update
Arg [1] : Bio::EnsEMBL::Analysis $anal
Example : $adaptor->update($anal)
Description: Updates this analysis in the database
Returntype : int 1 if update is performed, undef if it is not
Exceptions : throw if arg is not an analysis object
Caller : ?
Status : Stable
remove
Arg [1] : Bio::EnsEMBL::Analysis $anal
Example : $adaptor->remove($anal)
Description: Removes this analysis from the database. This is not really
safe to execute in a multi process environment, so programs
should not remove analysis while out on the farm.
Returntype : none
Exceptions : thrown if $anal arg is not an analysis object
Caller : ?
Status : Stable
exists
Arg [1] : Bio::EnsEMBL::Analysis $anal
Example : if($adaptor->exists($anal)) #do something
Description: Tests whether this Analysis already exists in the database
by checking first if the adaptor and dbID are set and
secondly by whether it is in this adaptors internal cache.
Note that this will not actually check the database and will
not find and analysis which were recently added by other
processes. You are better off simply trying to store an
analysis which will reliably ensure that it is not stored twice
in the database.
Returntype : int dbID if analysis is found, otherwise returns undef
Exceptions : thrown if $anal arg is not an analysis object
Caller : store
Status : Stable
_objFromHashref
Arg [1] : hashref $rowHash
Description: Private helper function generates an Analysis object from a
mysql row hash reference.
Returntype : Bio::EnsEMBL::Analysis
Exceptions : none
Caller : Bio::EnsEMBL::DBSQL::AnalsisAdaptor::fetch_* methods
Status : Stable