forked from BenLangmead/bowtie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formats.h
58 lines (51 loc) · 992 Bytes
/
formats.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
53
54
55
56
57
58
#ifndef FORMATS_H_
#define FORMATS_H_
#include <iostream>
#include <seqan/sequence.h>
/**
* File-format constants and names
*/
enum file_format {
FASTA = 1,
FASTA_CONT,
FASTQ,
INTERLEAVED,
TAB_MATE,
RAW,
CMDLINE,
INPUT_CHAIN,
RANDOM
};
static const std::string file_format_names[] = {
"Invalid!",
"FASTA",
"FASTA sampling",
"FASTQ",
"Tabbed mated",
"Raw",
"Command line",
"Chained",
"Random"
};
/**
* Print the given read information as a FASTA record.
*/
static inline void printFastaRecord(
std::ostream& o,
const seqan::String<char>& name,
const seqan::String<seqan::Dna5>& seq)
{
o << ">" << name << endl << seq << endl;
}
/**
* Print the given read information as a FASTQ record.
*/
static inline void printFastqRecord(
std::ostream& o,
const seqan::String<char>& name,
const seqan::String<seqan::Dna5>& seq,
const seqan::String<char>& qual)
{
o << "@" << name << endl << seq << endl << "+" << endl << qual << endl;
}
#endif /*FORMATS_H_*/