File: FastaWriter.h

package info (click to toggle)
abyss 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,284 kB
  • sloc: cpp: 78,182; ansic: 6,512; makefile: 2,252; perl: 672; sh: 509; haskell: 412; python: 4
file content (38 lines) | stat: -rw-r--r-- 860 bytes parent folder | download | duplicates (6)
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
#ifndef FASTAWRITER_H
#define FASTAWRITER_H 1

#include "Common/Sequence.h"
#include <cstdio>

/** Output a FASTA file. */
class FastaWriter {
	public:
		// Constructor opens file
		FastaWriter(const char* path, bool append = false);

		// Destructor closes it
		~FastaWriter();

		/** Write a sequence with a comment. */
		void WriteSequence(const Sequence& seq, unsigned id,
				unsigned multiplicity, const std::string& comment);

		/** Write a sequence. */
		void WriteSequence(const Sequence& seq, unsigned id,
				unsigned multiplicity)
		{
			WriteSequence(seq, id, multiplicity, "");
		}

		void WriteSequence(const Sequence& seq, unsigned long long id,
				const std::string& comment);

		void WriteSequence(const Sequence& seq, const std::string& id,
				const std::string& comment);

	private:
		const char *m_path;
		FILE* m_fileHandle;
};

#endif