Commit 2918a5e9 authored by Mikael Salson's avatar Mikael Salson

read_storage.{h,cpp}: Add a label useful when displaying stats

parent 6d9e8fb1
......@@ -13,7 +13,7 @@ void VirtualReadStorage::setMaxNbReadsStored(size_t nb_reads) {
BinReadStorage::BinReadStorage()
:nb_bins(0), bins(NULL), score_bins(NULL), nb_scores(NULL), total_nb_scores(0), max_score(0),
nb_inserted(0), nb_stored(0), smallest_bin_not_empty(~0) {}
nb_inserted(0), nb_stored(0), smallest_bin_not_empty(~0),label() {}
void BinReadStorage::init(size_t nb_bins, size_t max_score, const VirtualReadScore *vrs, bool no_list) {
this->nb_bins = nb_bins;
......@@ -139,6 +139,18 @@ list<Sequence> BinReadStorage::getReads() const {
return results;
}
string BinReadStorage::getLabel() const {
return label;
}
bool BinReadStorage::hasLabel() const {
return this->label.length() > 0;
}
void BinReadStorage::setLabel(string &label) {
this->label = label;
}
size_t BinReadStorage::scoreToBin(float score) {
assert(score >= 0);
if (score > max_score)
......
......@@ -65,7 +65,7 @@ class BinReadStorage: public VirtualReadStorage {
size_t nb_inserted;
size_t nb_stored;
size_t smallest_bin_not_empty;
string label;
public:
BinReadStorage();
......@@ -156,8 +156,17 @@ public:
*/
size_t getNbScores(size_t bin=~0) const;
bool hasLabel() const;
string getLabel() const;
list<Sequence> getReads() const;
/**
* Set the label of the statistics
*/
void setLabel(string &label);
private:
/**
* @return the bin a sequence of the given score must lie.
......
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