NAME
TFBS::DB::FlatFileDir - interface to a database of pattern matrices stored as a collection of flat files in a dedicated directory
SYNOPSIS
- •
-
creating a database object by connecting to the existing directory
my $db = TFBS::DB::FlatFileDir->connect("/home/boris/MatrixDir");
- •
-
retrieving a TFBS::Matrix::* object from the database
# retrieving a PFM by IDmy $pfm = $db->get_Matrix_by_ID('M00079','PFM');#retrieving a PWM by namemy $pwm = $db->get_Matrix_by_name('NF-kappaB', 'PWM');
- •
-
retrieving a set of matrices as a TFBS::MatrixSet object according to various criteria
# retrieving a set of PWMs from a list of IDs:my @IDlist = ('M0019', 'M0045', 'M0073', 'M0101');my $matrixset = $db->get_MatrixSet(-IDs => \@IDlist,-matrixtype => "PWM");# retrieving a set of ICMs from a list of names:my @namelist = ('p50', 'p53', 'HNF-1'. 'GATA-1', 'GATA-2', 'GATA-3');my $matrixset = $db->get_MatrixSet(-names => \@namelist,-matrixtype => "ICM");# retrieving a set of all PFMs in the databasemy $matrixset = $db->get_MatrixSet(-matrixtype => "PFM");
- •
-
creating a new FlatFileDir database in a new directory:
my $db = TFBS::DB::JASPAR2->create("/home/boris/NewMatrixDir");
- •
-
storing a matrix in the database:
#let $pfm is a TFBS::Matrix::PFM object$db->store_Matrix($pfm);
DESCRIPTION
TFBS::DB::FlatFileDir is a read/write database interface module that retrieves and stores TFBS::Matrix::* and TFBS::MatrixSet objects in a set of flat files in a dedicated directory. It has a very simple structure and can be easily set up manually if desired.
FEEDBACK
Please send bug reports and other comments to the author.
AUTHOR - Boris Lenhard
Boris Lenhard <[email protected]>
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are preceded with an underscore.
new
Title : newUsage : my $db = TFBS::DB::FlatFileDir->new(%args);Function: the formal constructor for the TFBS::DB::FlatFileDir object;most users will not use it - they will use specializedI<connect> or I<create> constructors to create adatabase objectReturns : a TFBS::DB::FlatFileDir objectArgs : -dir # the directory containing flat files
connect
Title : connectUsage : my $db = TFBS::DB::FlatFileDir->connect($directory);Function: Creates a database object that retrieves TFBS::Matrix::*object data from or stores it in an existing directoryReturns : a TFBS::DB::FlatFileDir objectArgs : ($directory)The name of the directory (possibly with fully qualifiedpath).
create
Title : createUsage : my $newdb = TFBS::DB::FlatFileDir->create($new_directory);Function: connects to the database server, creates a new directory,sets up a FlatFileDir database and returns a databaseobject that interfaces the databaseReturns : a TFBS::DB::FlatFileDir objectArgs : ($new_directory)The name of the directory to create(possibly with fully qualified path).
get_Matrix_by_ID
Title : get_Matrix_by_IDUsage : my $pfm = $db->get_Matrix_by_ID('M00034', 'PFM');Function: fetches matrix data under the given ID from thedatabase and returns a TFBS::Matrix::* objectReturns : a TFBS::Matrix::* object; the exact type of theobject depending on the second argument (allowedvalues are 'PFM', 'ICM', and 'PWM'); returns undef ifmatrix with the given ID is not foundArgs : (Matrix_ID, Matrix_type)Matrix_ID is a string; Matrix_type is one of thefollowing: 'PFM' (raw position frequency matrix),'ICM' (information content matrix) or 'PWM' (positionweight matrix)If Matrix_type is omitted, a PWM is retrieved by default.
get_Matrix_by_name
Title : get_Matrix_by_nameUsage : my $pfm = $db->get_Matrix_by_name('HNF-1', 'PWM');Function: fetches matrix data under the given name from thedatabase and returns a TFBS::Matrix::* objectReturns : a TFBS::Matrix::* object; the exact type of the objectdepending on the second argument (allowed values are'PFM', 'ICM', and 'PWM')Args : (Matrix_name, Matrix_type)Matrix_name is a string; Matrix_type is one of thefollowing:'PFM' (raw position frequency matrix),'ICM' (information content matrix) or'PWM' (position weight matrix)If Matrix_type is omitted, a PWM is retrieved by default.Warning : According to the current JASPAR2 data model, name isnot necessarily a unique identifier. In the case wherethere are several matrices with the same name in thedatabase, the function fetches the first one and printsa warning on STDERR. You have been warned.
store_Matrix
Title : store_MatrixUsage : $db->store_Matrix($matrixobj);Function: Stores the contents of a TFBS::Matrix::DB object in the databaseReturns : 0 on success; $@ contents on failure(this is too C-like and may change in future versions)Args : ($matrixobj) # a TFBS::Matrix::* object
delete_Matrix_having_ID
Title : delete_Matrix_having_IDUsage : $db->delete_Matrix_with_ID('M00045');Function: Deletes the matrix having the given ID from the databaseReturns : 0 on success; $@ contents on failure(this is too C-like and may change in future versions)Args : (ID)A stringComment : Yeah, yeah, 'delete_Matrix_having_ID' is a stupid namefor a method, but at least it should be obviuos what it does.