-
Notifications
You must be signed in to change notification settings - Fork 23
/
fasta.h
52 lines (39 loc) · 1.25 KB
/
fasta.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef FASTA_H
#define FASTA_H
#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <algorithm>
#include <vector>
#include "bxzstr.hpp"
using namespace std;
class Fasta
{
public:
Fasta();
Fasta(string id, string seq);
virtual ~Fasta(){}
string name() const;
string seq() const;
virtual string qual() const; // returns "". Here for compatibility with Fastq
void name(string s);
void seq(string s);
virtual void setQual(string s); // does nothing, here for compatibility with Fastq
// returns number of bases in sequence
unsigned long length() const;
// returns number of Ns (case insensitive)
unsigned long nCount() const;
// Return vector with (start, end) positions of each gap in the sequence.
// Coords zero-based
vector< pair<unsigned long, unsigned long> > gaps() const;
// prints the sequence. If lineWidth=0 then no linbreaks in output
virtual void toString(ostream& outStream, unsigned int lineWidth=60) const;
// reads next sequence from file, filling contents appropriately
// Returns true if worked ok, false if at end of file
virtual bool fillFromFile(bxz::ifstream& inStream);
protected:
string id_;
string seq_;
};
#endif // FASTA_H