read_chooser.h 1.06 KB
Newer Older
Mikael Salson's avatar
Mikael Salson committed
1 2 3 4 5
#ifndef READ_FINDER_H
#define READ_FINDER_H
#include <list>
#include "fasta.h"
#include "read_score.h"
Mathieu Giraud's avatar
Mathieu Giraud committed
6
#include <map>
Mikael Salson's avatar
Mikael Salson committed
7 8 9 10 11 12 13 14 15 16 17 18

/**
 * This class aims at choosing the best read among a group of read.
 * As an input, the class needs a list of reads (sequence + id)
 * as well as the file containing all the sequences
 * and an object able to compute a score for a read.
 * The goal of the class is to find, among the reads,
 * the sequence that has the best score.
 */
class ReadChooser {

 private:
Mathieu Giraud's avatar
Mathieu Giraud committed
19 20
  vector<Sequence> reads;
  map<string, float> scores;
Mikael Salson's avatar
Mikael Salson committed
21 22 23 24 25 26 27 28 29
 public:
  
  ReadChooser(list<Sequence> &r, VirtualReadScore &scorer);

  /**
   * @return the best sequence among the list of sequences that have been 
   *         given to the object
   */
  Sequence getBest() const;
Mathieu Giraud's avatar
Mathieu Giraud committed
30 31 32 33 34 35 36 37 38 39 40 41

  /**
   * @pre i >= 1 && i <= total number of sequences on the input
   * @param i: starts at 1
   * @return the i-th best scored sequence 
   */
  Sequence getithBest(size_t i) const;

  /**
   * A comparison based on scorer of the two sequences.
   */
  bool operator()(Sequence first, Sequence second);
Mikael Salson's avatar
Mikael Salson committed
42 43
};

Mathieu Giraud's avatar
Mathieu Giraud committed
44

Mikael Salson's avatar
Mikael Salson committed
45
#endif