gatb.core-API-0.0.0
|
Genomic bank file made of a list of other bank files URI. More...
#include <BankAlbum.hpp>
Public Member Functions | |
BankAlbum (const std::string &name, bool deleteIfExists=false) | |
BankAlbum (const std::string &name, const std::vector< IBank * > &banks) | |
BankAlbum (const std::vector< std::string > &filenames) | |
std::string | getId () |
IBank * | addBank (const std::string &bankUri) |
IBank * | addBank (const std::string &directory, const std::string &bankName, bool output_fastq=false, bool output_gz=false) |
void | remove () |
Public Member Functions inherited from BankComposite | |
BankComposite () | |
BankComposite (const std::vector< IBank * > &banks) | |
virtual | ~BankComposite () |
std::string | getId () |
std::string | getIdNb (int i) |
int64_t | estimateNbItemsBanki (int i) |
void | addBank (IBank *bank) |
tools::dp::Iterator< Sequence > * | iterator () |
int64_t | getNbItems () |
void | insert (const Sequence &item) |
void | flush () |
u_int64_t | getSize () |
void | estimate (u_int64_t &number, u_int64_t &totalSize, u_int64_t &maxSize) |
size_t | getCompositionNb () |
const std::vector< IBank * > | getBanks () const |
size_t | getNbBanks () const |
template<typename Functor > | |
void | iterateBanks (Functor fct) |
tools::dp::Iterator< IBank * > * | iteratorBanks () |
void | remove () |
Public Member Functions inherited from AbstractBank | |
AbstractBank () | |
int64_t | estimateNbItems () |
u_int64_t | estimateSequencesSize () |
u_int64_t | getEstimateThreshold () |
void | setEstimateThreshold (u_int64_t nbSeq) |
void | finalize () |
Public Member Functions inherited from Iterable< Sequence > | |
void | iterate (Functor f) |
virtual Sequence * | getItems (Sequence *&buffer) |
virtual size_t | getItems (Sequence *&buffer, size_t start, size_t nb) |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Public Member Functions inherited from Bag< Sequence > | |
virtual void | insert (const Sequence &item)=0 |
virtual void | insert (const std::vector< Sequence > &items, size_t length=0) |
virtual void | insert (const Sequence *items, size_t length) |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Static Public Member Functions | |
static const char * | name () |
Static Public Member Functions inherited from BankComposite | |
static const char * | name () |
static size_t | getMaxNbFiles () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Protected Attributes inherited from BankComposite | |
std::vector< IBank * > | _banks |
Genomic bank file made of a list of other bank files URI.
This class allows to define a list of banks URI in two ways: 1) the album URI is a comma separated list of banks URI 2) the album is a text file holding a list of banks URI
Example of a BankAlbum file content:
An album A is defined by N filepath Pi. An album is valid if each Pi is present in filesystem
If a filepath Pi is a simple filename (ie. not a fullpath), the basedir of the album URI is prefixed to Pi. This feature avoids to write the fullpath in Pi, which is interesting if the banks referred by Pi are moved; in such a case, one just has to move the album file in the same location of the moved banks.
BankAlbum is a composite bank so iterating the sequences of a BankAlbum instance consists in iterating the sequences of each referred bank (in the order of the album file).
The BankAlbum follows the Composite design pattern, so it is possible to have album of albums for instance; it is also possible to mix composite and leaf banks like this:
Example of use:
BankAlbum | ( | const std::string & | name, |
bool | deleteIfExists = false |
||
) |
Constructor.
[in] | name | : uri of the album. |
[in] | deleteIfExists | : delete the album file if it exists. |
Constructor.
[in] | name | : uri of the album. |
[in] | banks | : vector of banks instance to be added to the album. |
BankAlbum | ( | const std::vector< std::string > & | filenames | ) |
Constructor.
[in] | filenames | uri of the files to be used. |
IBank * addBank | ( | const std::string & | bankUri | ) |
Add a bank to the album.
IBank * addBank | ( | const std::string & | directory, |
const std::string & | bankName, | ||
bool | output_fastq = false , |
||
bool | output_gz = false |
||
) |
Add a bank to the album.
|
inlinevirtual |
Implements IBank.
|
inlinestatic |
Returns the name of the bank format.
|
virtual |
Reimplemented from AbstractBank.