Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fastq.h
Go to the documentation of this file.
1 #ifndef __foghorn__fastq__
2 #define __foghorn__fastq__
3 
4 #include <string>
5 
6 namespace gamgee {
7 
13 class Fastq {
14 
15  public:
16 
18  Fastq() :
19  m_name {}, m_comment {}, m_sequence{}, m_quals{} {}
20 
22  Fastq(std::string name,
23  std::string comment,
24  std::string sequence,
25  std::string quals = ""
26  ) :
27  m_name {name}, m_comment {comment}, m_sequence{sequence}, m_quals{quals}
28  {}
29 
30 
36  bool operator!=(const Fastq& other) {
37  return m_name == other.m_name &&
38  m_comment == other.m_comment &&
39  m_sequence == other.m_sequence &&
40  m_quals == other.m_quals;
41  }
42 
43  std::string name() const { return m_name; }
44  std::string comment() const { return m_comment; }
45  std::string sequence() const { return m_sequence; }
46  std::string quals() const { return m_quals; }
47  void set_name(const std::string& name) { m_name = name; }
48  void set_comment(const std::string& comment) { m_comment = comment; }
49  void set_sequence(const std::string& sequence) { m_sequence = sequence; }
50  void set_quals(const std::string& quals) { m_quals = quals; }
51 
52  void chop(const int nBases);
53  void reverse_complement();
54  bool is_fastq() const;
55 
56  private:
57 
58  std::string m_name;
59  std::string m_comment;
60  std::string m_sequence;
61  std::string m_quals;
62 
63 };
64 
65 } // end of namespace
66 
73 std::ostream& operator<< (std::ostream& os, const gamgee::Fastq& fq);
74 
75 #endif /* defined(__foghorn__fastq__) */
void set_sequence(const std::string &sequence)
Definition: fastq.h:49
bool is_fastq() const
true if the record has a quals in it's qual field
Definition: fastq.cpp:10
std::string comment() const
Definition: fastq.h:44
void set_name(const std::string &name)
Definition: fastq.h:47
void reverse_complement()
transform the sequence into it's reverse complement.
Definition: fastq.cpp:20
std::string sequence() const
Definition: fastq.h:45
Utility class to hold one FastA or FastQ record.
Definition: fastq.h:13
void chop(const int nBases)
hard clips the first n bases of the read.
Definition: fastq.cpp:14
std::string quals() const
Definition: fastq.h:46
bool operator!=(const Fastq &other)
inequality comparison of all fields in the record
Definition: fastq.h:36
void set_quals(const std::string &quals)
Definition: fastq.h:50
std::ostream & operator<<(std::ostream &os, const gamgee::Fastq &fq)
outputs the fastq record in fastq format.
Definition: fastq.cpp:34
Fastq(std::string name, std::string comment, std::string sequence, std::string quals="")
creates a full object by assigning all fields
Definition: fastq.h:22
void set_comment(const std::string &comment)
Definition: fastq.h:48
Fastq()
creates an empty record
Definition: fastq.h:18
std::string name() const
Definition: fastq.h:43