Commit 0d5f7ced authored by Mikaël Salson's avatar Mikaël Salson

IKmerStore: smallestAnalysableLength()

Method which returns how many nucleotides at each time we can get.
Useful to know what is the expected length of a getResults().
parent 63c1041e
......@@ -64,6 +64,10 @@ public:
*/
virtual void *next(void *state, char c) = 0;
/**
* @inherited from IKmerStore
*/
size_t smallestAnalysableLength() const;
};
......
......@@ -30,6 +30,10 @@ void *AbstractACAutomaton<Info>::goto_state(const string &seq, void *starting_st
return current_state;
}
template<class Info>
size_t AbstractACAutomaton<Info>::smallestAnalysableLength() const {
return 1;
}
///////////////////////
template <class Info>
......
......@@ -135,11 +135,18 @@ public:
* @param seq: a sequence
* @param no_revcomp: force not to revcomp the sequence, even if
* the index was built with revcomp.
* @return a vector of length seq.length() - getK() + 1 containing
* for each k-mer the corresponding value in the index.
* @return a vector of length seq.length() - smallestAnalysableLength() + 1
* containing for each position the corresponding value in the index.
*/
virtual vector<T> getResults(const seqtype &seq, bool no_revcomp=false, string seed="") = 0;
/**
* @return the smallest analysable sequence length by the index. For an
* index just storing k-mers it will obviously be getK(). But for more
* sophisticated data structures it could be 1 for instance.
*/
size_t smallestAnalysableLength() const;
/**
* @return true iff the revcomp is indexed
*/
......@@ -424,6 +431,11 @@ bool IKmerStore<T>::isRevcomp() const {
return revcomp_indexed;
}
template<class T>
size_t IKmerStore<T>::smallestAnalysableLength() const {
return getK();
}
// MapKmerStore
template <class T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment