Imported Debian patch 0.12.7-3
[bowtie.git] / formats.h
1 #ifndef FORMATS_H_
2 #define FORMATS_H_
3
4 #include <iostream>
5 #include <seqan/sequence.h>
6
7 /**
8  * File-format constants and names
9  */
10
11 enum file_format {
12         FASTA = 1,
13         FASTA_CONT,
14         FASTQ,
15         TAB_MATE,
16         RAW,
17         CMDLINE,
18         INPUT_CHAIN,
19         RANDOM
20 };
21
22 static const std::string file_format_names[] = {
23         "Invalid!",
24         "FASTA",
25         "FASTA sampling",
26         "FASTQ",
27         "Tabbed mated",
28         "Raw",
29         "Command line",
30         "Chained",
31         "Random"
32 };
33
34 /**
35  * Print the given read information as a FASTA record.
36  */
37 static inline void printFastaRecord(
38                 std::ostream& o,
39                 const seqan::String<char>& name,
40                 const seqan::String<seqan::Dna5>& seq)
41 {
42         o << ">" << name << endl << seq << endl;
43 }
44
45 /**
46  * Print the given read information as a FASTQ record.
47  */
48 static inline void printFastqRecord(
49                 std::ostream& o,
50                 const seqan::String<char>& name,
51                 const seqan::String<seqan::Dna5>& seq,
52                 const seqan::String<char>& qual)
53 {
54         o << "@" << name << endl << seq << endl << "+" << endl << qual << endl;
55 }
56
57 #endif /*FORMATS_H_*/