OpenFlexTyper
queryClass.h
1 #ifndef QUERYCLASS_H
2 #define QUERYCLASS_H
3 
4 #include <set>
5 #include <iostream>
6 #include <map>
7 #include "ftPropsClass.h"
8 
9 namespace ft {
10 
16 {
17 
18 public:
22  QueryClass(int queryID, ft::QueryType queryType);
23  QueryClass();
24 
26  virtual ~QueryClass();
27 
32  int _qID;
33  QueryType _qType;
34  std::string _qstring;
35  int _count;
36  std::map<ft::FlagType, std::set<std::string>> _qFlags;
37  std::set<ft::ReadID> _reads;
39 
44  int getqID() const;
45  QueryType getqType() const;
46  std::string getQueryString() const;
47  int getCount() const;
48  std::map<ft::FlagType, std::set<std::string>> getQFlags() const;
49  ft::QIdT getQIdT() const;
50  const std::set<std::string> getFlagKmers(const ft::FlagType flag) const;
51  const std::set<ft::ReadID>& getReadIDs() const;
53 
58  void setQueryString(std::string queryString);
59  void setCount(int count);
60  void setFlags(const std::map<ft::FlagType, std::set<std::string>>& qFlags);
62 
67  void addFlags(const ft::FlagType& flagType, const std::set<std::string>& kmers);
68  void addFlag(const ft::FlagType& flagType, const std::string& kmer);
69  void addReadID(const ft::ReadID& readID);
71 
76  void removeFlag(ft::FlagType flagType);
77  void removeKmerFlag(const ft::FlagType& flagTyper, const std::string& kmers);
78  void removeCount();
79  void removeReadID(const ft::ReadID& readID);
81 
86  bool isQIdTEqual(const ft::QIdT& test) const;
87  bool hasQueryID(const int& qid) const;
88  bool hasQueryType(const ft::QueryType& qType) const;
89  bool hasFlag(const ft::FlagType& flag) const;
90  bool hasKmerFlag(const ft::FlagType& flag, const std::string& kmer) const;
91  bool hasNonZeroCount() const;
92  bool hasReadID(const ft::ReadID& readID) const;
94 
98  bool operator< (const ft::QueryClass &q) const;
99  bool operator== (const ft::QueryClass &q) const;
101 
102  static const std::string& queryTypeToString (const ft::QueryType& qType) {
103  switch (qType) {
104  case REF:
105  return QUERYTYPE_REF;
106  case ALT:
107  return QUERYTYPE_ALT;
108  case CRO:
109  default:
110  return QUERYTYPE_CRO;
111  }
112  };
113 };
114 }
115 
116 #endif // QUERYCLASS_H
ft::QueryClass
A class that contains information for one query ID, Type pair.
Definition: queryClass.h:16
ft::QIdT
std::pair< int, QueryType > QIdT
Pair to create a unique ID: (Query Number, Query Type)
Definition: ftPropsClass.h:42
ft
This namespace contains all the functions to interact with the search.
Definition: directSearch.h:16
ft::FlagType
FlagType
Definition: ftPropsClass.h:56
ft::ReadID
std::pair< int, int > ReadID
Pair to create a unique Read ID: (Read Number, Read Pair)
Definition: ftPropsClass.h:48
ft::QueryType
QueryType
Definition: ftPropsClass.h:34
ft::QueryClass::~QueryClass
virtual ~QueryClass()
Class Destructor.
Definition: queryClass.cpp:128