]> git.donarmstrong.com Git - bamtools.git/blob - src/utils/bamtools_fasta.h
5cf85b356761f0bc6b0830bfa83f13bee05846f9
[bamtools.git] / src / utils / bamtools_fasta.h
1 // ***************************************************************************
2 // bamtools_fasta.h (c) 2010 Derek Barnett, Erik Garrison
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 19 November 2010
6 // ---------------------------------------------------------------------------
7 // Provides FASTA reading/indexing functionality.
8 // ***************************************************************************
9
10 #ifndef BAMTOOLS_FASTA_H
11 #define BAMTOOLS_FASTA_H
12
13 #include <utils/utils_global.h>
14 #include <string>
15
16 namespace BamTools {
17
18 class UTILS_EXPORT Fasta {
19   
20     // ctor & dtor
21     public:
22         Fasta(void);
23         ~Fasta(void);
24         
25     // file-handling methods
26     public:
27         bool Close(void);
28         bool Open(const std::string& filename, const std::string& indexFilename = "");
29         
30     // sequence access methods
31     public:
32         bool GetBase(const int& refID, const int& position, char& base);
33         bool GetSequence(const int& refId, const int& start, const int& stop, std::string& sequence);
34         
35     // index-handling methods
36     public:
37         bool CreateIndex(const std::string& indexFilename);
38
39     // internal implementation
40     private:
41         struct FastaPrivate;
42         FastaPrivate* d;
43 };
44   
45 } // BAMTOOLS_FASTA_H
46   
47 #endif // BAMTOOLS_FASTA_H