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::DataFileAdaptor

SYNOPSIS

my $dfa = $dba->get_DataFileAdaptor();
my $file = $dfa->fetch_by_dbID(1);
my $files = $dfa->fetch_all();

my $logic_name_files = $dfa->fetch_all_by_logic_name('bam_alignments');

DESCRIPTION

Provides a database wrapper to store the locations of files and to pull these records back out. DataFile objects can only provide basic information but they can return an intended external database adaptor which can be used to parse the information. This system assumes nothing about the file just that your parser can access it.

Files are supported over any protocol your parser supports and locations can be made absolute, built on the fly or versioned.

METHODS

global_base_path

Arg[1]     	: String; base path 
Example       : Bio::EnsEMBL::DBSQL::DataFileAdaptor->global_base_path('/base/path');
Description	: Stores a global value to be used when building data file paths
Returntype 	: String
Exceptions 	: None

get_base_path

Arg[1]      : String; (optional) base path 
Example     : $dfa->get_base_path();
Description : If given the path it will return that path; if not it consults
              $self->global_base_path() for a value. As a last resort
              it will look at the meta table for an entry keyed by
              B<data_file.base_path>
Returntype  : String
Exceptions  : Thrown if nothing is found after consulting all three locations

DataFile_to_extensions

Arg[1]      : Bio::EnsEMBL::DataFile
Example     : my $exts = $dfa->DataFile_to_extensions($bam_df);
Description : Returns all expected extensions for the given DataFile type. The
              first returned is the default extension
Returntype  : ArrayRef
Exceptions  : Raised if the given file type is not understood

DataFile_to_adaptor

Arg[1]        : Bio::EnsEMBL::DataFile
Arg[2]        : (optional) base path
Arg[3]        : (optional) file type
Example       : my $bam = $dfa->DataFile_to_adaptor($bam_df);
Description   : Returns an adaptor instance which will access the given DataFile.
                Can explicitly request for an adaptor of a given file type (third
                argument), useful with composite types, e.g. BAM coverage files
                can be returned as BAM or BIGWIG
Returntype    : Scalar actual return depends upon the given file type and the
                requested type
Exceptions    : Raised if the given file type is not understood or if the requested
                file type is incompatible with the actual data file type.

fetch_all_by_logic_name

Args [1]   	: String $logic_name for the linked analysis 
Example       : my $dfs = $dfa->fetch_all_by_logic_name('bam_alignments');
Description	: Returns all DataFile entries linked to the given analysis 
              logic name
Returntype 	: ArrayRef contains Bio::EnsEMBL::DataFile instances
Exceptions 	: Thrown if logic name does not exist 

fetch_all_by_Analysis

Args [1]    : Bio::EnsEMBL::Analysis $analysis to look up by 
Example     : my $dfs = $dfa->fetch_all_by_Analysis($analysis);
Description : Returns all DataFile entries linked to the given analysis
Returntype  : ArrayRef contains Bio::EnsEMBL::DataFile instances
Exceptions  : None

fetch_all_by_CoordSystem

Args [1]    : Bio::EnsEMBL::CoordSystem $coord_system to look up by 
Example     : my $dfs = $dfa->fetch_all_by_CoordSystem($cs);
Description : Returns all DataFile entries linked to the given coordinate
              system. Does B<not> support I<toplevel>
Returntype  : ArrayRef contains Bio::EnsEMBL::DataFile instances
Exceptions  : None