SHORE API
Main Page
Namespaces
Classes
Files
File List
File Members
SHORE API
Namespaces
Classes
Files
File List
shore
algo
base
container
datatype
fmtio
alignment.hpp
aln.hpp
bed.hpp
eland.hpp
fasta.hpp
fastq.hpp
flatread.hpp
gff.hpp
maplist.hpp
mummer.hpp
psl.hpp
qseq.hpp
read.hpp
refdict.hpp
sam.hpp
segment.hpp
sff.hpp
text.hpp
vcf.hpp
parallel
processing
program
statistics
stream
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
vcf.hpp
Go to the documentation of this file.
1
2
/*
3
* Copyright 2008,2009,2010,2011,2012 Stephan Ossowski, Korbinian Schneeberger,
4
* Felix Ott, Joerg Hagmann, Alf Scotland, Sebastian Bender
5
*
6
* This file is part of SHORE.
7
*
8
* SHORE is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* SHORE is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with SHORE. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
25
26
#ifndef IO_VCF_HPP__
27
#define IO_VCF_HPP__
28
29
#include <iostream>
30
#include <map>
31
#include <string>
32
33
#include "
shore/processing/pipeline.hpp
"
34
#include "
shore/datatype/datatypes.hpp
"
35
#include "
shore/stream/streams.hpp
"
36
37
namespace
shore {
38
39
43
class
vcf_writer
44
{
45
private
:
46
47
shore::ostreams
m_out;
48
49
std::map<std::string,shore::sequence_record> m_refseq;
50
51
std::string m_samplename;
52
53
std::string m_chr;
54
long
m_pos;
55
std::string m_refbases;
56
std::string m_varbases;
57
size_t
m_ref_noanchorofs;
58
size_t
m_var_noanchorofs;
59
std::vector<int> m_qual;
60
std::vector<int> m_supp;
61
62
void
wbuf();
63
64
public
:
65
66
typedef
shore::local_variant
append_type
;
67
68
vcf_writer
(
const
std::string& fn,
const
std::string& ref);
69
vcf_writer
(std::ostream& os,
const
std::string& ref);
70
71
void
append(
const
shore::local_variant
& f);
72
void
flush();
73
};
74
76
typedef
shore::sink<vcf_writer>
vcf_sink
;
77
79
class
qualvar_reader
80
{
81
private
:
82
83
shore::local_variant
m_current;
84
85
shore::istreams
m_in;
86
87
bool
m_hasdata;
88
89
public
:
90
91
typedef
shore::local_variant
current_type
;
92
93
qualvar_reader
(
const
std::string& qv_fn);
94
qualvar_reader
(std::istream& in);
95
96
bool
has_data()
const
;
97
const
shore::local_variant
& current()
const
;
98
void
next();
99
};
100
101
std::istream&
operator>>
(std::istream& in,
shore::local_variant
& e);
102
104
typedef
shore::source<qualvar_reader>
qualvar_source
;
105
106
}
// namespace
107
108
#endif // IO_VCF_HPP__
109
shore
fmtio
vcf.hpp
Generated on Thu Jun 20 2013 15:49:39 for SHORE API by
1.8.4