-
Notifications
You must be signed in to change notification settings - Fork 8
/
vcflib.pxd
145 lines (129 loc) · 5.13 KB
/
vcflib.pxd
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
from libcpp cimport bool
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp.map cimport map
from libcpp.pair cimport pair
cdef extern from "split.h":
# split a string on a single delimiter character (delim)
vector[string]& split(const string &s, char delim, vector[string] &elems)
vector[string] split(const string &s, char delim)
# split a string on any character found in the string of delimiters (delims)
vector[string]& split(const string &s, const string& delims, vector[string] &elems)
vector[string] split(const string &s, const string& delims)
cdef extern from "Variant.h" namespace "vcf":
cdef enum VariantFieldType:
FIELD_FLOAT = 0
FIELD_INTEGER
FIELD_BOOL
FIELD_STRING
FIELD_UNKNOWN
cdef enum VariantFieldNumber:
ALLELE_NUMBER = -2
GENOTYPE_NUMBER = -1
const int INDEX_NONE = -1
const int NULL_ALLELE = -1
VariantFieldType typeStrToFieldType(string& typeStr)
cdef cppclass VariantCallFile:
# istream* file
# Tabix* tabixFile
bool usingTabix
string header
string line
string fileformat
string fileDate
string source
string reference
string phasing
map[string, VariantFieldType] infoTypes
map[string, int] infoCounts
map[string, VariantFieldType] formatTypes
map[string, int] formatCounts
vector[string] sampleNames
bool parseInfo
bool parseSamples
bool _done
void updateSamples(vector[string]& newSampleNames)
void addHeaderLine(string line)
void removeInfoHeaderLine(string line)
void removeGenoHeaderLine(string line)
vector[string] infoIds()
vector[string] formatIds()
vector[string] filterIds()
bool open(string& filename)
bool openFile(string& filename)
bool openTabix(string& filename)
# bool open(istream& stream)
# bool open(ifstream& stream)
bool openForOutput(string& headerStr)
bool is_open()
bool eof()
bool done()
bool parseHeader(string& headerStr)
bool parseHeader()
bool getNextVariant(Variant& var)
bool setRegion(string region)
bool setRegion(string seq, long int start, long int end)
cdef cppclass VariantAllele:
string ref
string alt
string repr
long position
VariantAllele(string r, string a, long p)
cdef cppclass Variant:
string sequenceName
long position
string id
string ref
vector[string] alt
vector[string] alleles
map[string, int] altAlleleIndexes
map[string, vector[VariantAllele] ] parsedAlternates(bool includePreviousBaseForIndels,
bool useMNPs,
bool useEntropy,
float matchScore,
float mismatchScore,
float gapOpenPenalty,
float gapExtendPenalty,
float repeatGapExtendPenalty,
string flankingRefLeft,
string flankingRefRight)
map[string, string] extendedAlternates(long int newPosition, long int length)
string originalLine
string filter
double quality
VariantFieldType infoType(string& key)
map[string, vector[string]] info
map[string, bool] infoFlags
VariantFieldType formatType(string& key)
vector[string] format
map[string, map[string, vector[string]]] samples
vector[string] sampleNames
vector[string] outputSampleNames
VariantCallFile* vcf
void removeAlt(string& altallele)
Variant()
Variant(VariantCallFile& v)
void setVariantCallFile(VariantCallFile& v)
void setVariantCallFile(VariantCallFile* v)
void parse(string& line, bool parseInfo, bool parseSamples)
void addFilter(string& tag)
bool getValueBool(string& key, string& sample, int index)
double getValueFloat(string& key, string& sample, int index)
string getValueString(string& key, string& sample, int index)
bool getSampleValueBool(string& key, string& sample, int index)
double getSampleValueFloat(string& key, string& sample, int index)
string getSampleValueString(string& key, string& sample, int index)
bool getInfoValueBool(string& key, int index)
double getInfoValueFloat(string& key, int index)
string getInfoValueString(string& key, int index)
# void printAlt(ostream& out)
# void printAlleles(ostream& out)
int getAltAlleleIndex(string& allele)
void updateAlleleIndexes()
void addFormatField(string& key)
void setOutputSampleNames(vector[string]& outputSamples)
map[pair[int, int], int] getGenotypeIndexesDiploid()
int getNumSamples()
int getNumValidGenotypes()
cdef class PyVariantCallFile:
cdef VariantCallFile *thisptr