File: formats.h

package info (click to toggle)
bowtie 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,864 kB
  • ctags: 5,533
  • sloc: cpp: 32,737; perl: 2,084; ansic: 1,241; sh: 1,066; makefile: 344; python: 133
file content (57 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (3)
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
#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,
	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_*/