4 * Implementation of Read class. Since the class consists of public variables (more of a struct, really) there is not much
7 * compare_reads: function to compare two reads, first be chromosome, then by position. Useful to sort a vector of reads.
15 Read::Read(string chr, unsigned int pos, bool strand, string seq) : Loci(chr,pos) {
16 this->strand = strand;
20 Read::Read(const Read& r) : Loci(r) {
21 this->strand = strand;
25 Read& Read::operator=(const Read& r) {
26 if(this == &r) return *this;
29 this->strand = r.strand;
34 unsigned int Read::length() const {
38 //Errors if the offset exceeds the length of the read
39 char Read::operator[](size_t off) const {
40 if(off >= this->length()) {
41 cerr << "Error: index " << off << " out of bounds for read of length " << this->length() << endl;
44 return this->seq[off];