gatb.core-API-0.0.0
|
Interface for what we need to read genomic databases. More...
#include <IBank.hpp>
Public Member Functions | |
virtual std::string | getId ()=0 |
virtual std::string | getIdNb (int i)=0 |
virtual int64_t | estimateNbItemsBanki (int i)=0 |
virtual const std::vector< IBank * > | getBanks () const =0 |
virtual tools::dp::Iterator< Sequence > * | iterator ()=0 |
virtual void | insert (const Sequence &item)=0 |
virtual u_int64_t | getSize ()=0 |
virtual size_t | getCompositionNb ()=0 |
virtual void | estimate (u_int64_t &number, u_int64_t &totalSize, u_int64_t &maxSize)=0 |
virtual int64_t | estimateNbItems ()=0 |
virtual u_int64_t | estimateSequencesSize ()=0 |
virtual u_int64_t | getEstimateThreshold ()=0 |
virtual void | setEstimateThreshold (u_int64_t nbSeq)=0 |
virtual void | remove ()=0 |
virtual void | finalize ()=0 |
Public Member Functions inherited from Iterable< Sequence > | |
void | iterate (Functor f) |
virtual int64_t | getNbItems ()=0 |
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 () |
virtual void | use ()=0 |
virtual void | forget ()=0 |
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) |
virtual void | flush ()=0 |
Interface for what we need to read genomic databases.
The IBank interface provides means to:
One typical implementation of this interface is a FASTA bank parser.
The key point here is that clients should use this interface instead of specific implementations, wherever they need to get nucleotides sequences from some container.
By doing this, such clients will support many bank formats (according to the fact that a IBank implementation provides such a service). They will also support "fake" banks, for instance random generated sequences or any kind of synthetic data.
From a design point of view, IBank is an Iterable (something we can get iterators from) and a Bag (something we can insert items into); in both cases, the item type is Sequence
Some kind of factory method exists for using IBank instances: this is the gatb::core::bank::impl::Bank class. This class allows to get a IBank instance by providing an URI. The actual implementation class of the IBank interface is computed by analyzing the URI string itself, or the content of the file defined by the URI. So, tools developers should in general get IBank instances this way, so their tool would support different kind of input bank formats.
|
pure virtual |
Give an estimation of sequences information in the bank.
[out] | number | : sequences number |
[out] | totalSize | : sequences size (in bytes) |
[out] | maxSize | : max size size (in bytes) |
Implemented in BankComposite, BankStrings, BankDelegate, BankBinary, BankFasta, BankSplitter, BankRandom, and BankKmers.
|
pure virtual |
Shortcut to 'estimate' method.
Implements Iterable< Sequence >.
Implemented in BankDelegate, and AbstractBank.
|
pure virtual |
In case of a composite bank,
Implemented in BankDelegate, BankComposite, and AbstractBank.
|
pure virtual |
Shortcut to 'estimate' method.
Implemented in BankDelegate, and AbstractBank.
|
pure virtual |
Method that may be called when the bank is done. It is called by BankFasta destructor for instance. It will close fclose() or something equivalent. You don't need to call this function yourself.
Implemented in BankFasta, and AbstractBank.
|
pure virtual |
Return the vector of sub IBank objects (in case of bank composite), or a vector containing only the bank itself
Implemented in BankComposite, and AbstractBank.
|
pure virtual |
In case of a composite bank, return the number of sub banks.
Implemented in BankComposite, and AbstractBank.
|
pure virtual |
Implemented in BankDelegate, and AbstractBank.
|
pure virtual |
Get an unique identifier for the bank (could be the URI of a FASTA file for instance).
Implemented in BankAlbum, BankBinary, BankDelegate, BankFasta, BankComposite, BankSplitter, BankRandom, BankStrings, and BankKmers.
|
pure virtual |
In case of a composite bank, return the id of bank i
Implemented in BankComposite, BankDelegate, and AbstractBank.
|
pure virtual |
Return the size of the bank (comments + data)
The returned value may be an approximation in some case. For instance, if we use a zipped bank, an implementation may be not able to give accurate answer to the size of the original file.
Implemented in BankComposite, BankStrings, BankDelegate, BankBinary, BankFasta, BankSplitter, BankRandom, and BankKmers.
|
pure virtual |
Insert an item into the bag.
[in] | item | : the item to be inserted. |
Implemented in BankComposite, BankDelegate, BankBinary, BankFasta, BankStrings, BankSplitter, BankRandom, and BankKmers.
|
pure virtual |
Create an iterator for the given Iterable instance.
Implements Iterable< Sequence >.
Implemented in BankFiltered< Filter >, BankKmers, BankComposite, BankDelegate, BankBinary, BankFasta, BankStrings, BankSplitter, and BankRandom.
|
pure virtual |
Remove physically the bank. This method will have non-empty implementation for banks using file system for instance.
Implemented in BankComposite, BankAlbum, BankBinary, and AbstractBank.
|
pure virtual |
Set the number of sequences read from the bank for computing estimated information
[in] | nbSeq | : the number of sequences to be read. |
Implemented in BankDelegate, and AbstractBank.