pybcf 1.0.2__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybcf-1.0.2 → pybcf-1.2.0}/MANIFEST.in +4 -2
- pybcf-1.2.0/PKG-INFO +49 -0
- pybcf-1.2.0/README.md +33 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/setup.py +43 -15
- {pybcf-1.0.2 → pybcf-1.2.0}/src/gzstream/gzstream.h +1 -1
- {pybcf-1.0.2 → pybcf-1.2.0}/src/header.cpp +65 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/header.h +4 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/info.cpp +12 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/info.h +1 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf/reader.cpp +9225 -4434
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf/reader.pyx +125 -22
- pybcf-1.2.0/src/pybcf.egg-info/PKG-INFO +49 -0
- pybcf-1.2.0/src/pybcf.egg-info/SOURCES.txt +81 -0
- pybcf-1.2.0/src/sample_data.cpp +247 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/sample_data.h +2 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/types.h +15 -2
- pybcf-1.2.0/src/zlib-ng/adler32.c +69 -0
- pybcf-1.2.0/src/zlib-ng/adler32_p.h +70 -0
- pybcf-1.2.0/src/zlib-ng/arch_functions.h +29 -0
- pybcf-1.2.0/src/zlib-ng/chunkset_tpl.h +200 -0
- pybcf-1.2.0/src/zlib-ng/compare256_rle.h +134 -0
- pybcf-1.2.0/src/zlib-ng/compress.c +98 -0
- pybcf-1.2.0/src/zlib-ng/cpu_features.c +23 -0
- pybcf-1.2.0/src/zlib-ng/cpu_features.h +43 -0
- pybcf-1.2.0/src/zlib-ng/crc32.c +42 -0
- pybcf-1.2.0/src/zlib-ng/crc32.h +16 -0
- pybcf-1.2.0/src/zlib-ng/crc32_braid_comb.c +56 -0
- pybcf-1.2.0/src/zlib-ng/crc32_braid_comb_p.h +42 -0
- pybcf-1.2.0/src/zlib-ng/crc32_braid_p.h +64 -0
- pybcf-1.0.2/src/zlib/crc32.h → pybcf-1.2.0/src/zlib-ng/crc32_braid_tbl.h +49 -49
- pybcf-1.2.0/src/zlib-ng/deflate.c +1513 -0
- pybcf-1.2.0/src/zlib-ng/deflate.h +448 -0
- pybcf-1.2.0/src/zlib-ng/deflate_fast.c +102 -0
- pybcf-1.2.0/src/zlib-ng/deflate_huff.c +45 -0
- pybcf-1.2.0/src/zlib-ng/deflate_medium.c +278 -0
- pybcf-1.2.0/src/zlib-ng/deflate_p.h +126 -0
- pybcf-1.2.0/src/zlib-ng/deflate_quick.c +129 -0
- pybcf-1.2.0/src/zlib-ng/deflate_rle.c +85 -0
- pybcf-1.2.0/src/zlib-ng/deflate_slow.c +143 -0
- pybcf-1.2.0/src/zlib-ng/deflate_stored.c +186 -0
- pybcf-1.2.0/src/zlib-ng/fallback_builtins.h +47 -0
- pybcf-1.2.0/src/zlib-ng/functable.c +354 -0
- pybcf-1.2.0/src/zlib-ng/functable.h +55 -0
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/gzguts.h +41 -110
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/gzlib.c +108 -162
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/gzwrite.c +88 -193
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/infback.c +144 -254
- pybcf-1.2.0/src/zlib-ng/inffast_tpl.h +326 -0
- pybcf-1.2.0/src/zlib-ng/inffixed_tbl.h +94 -0
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/inflate.c +611 -684
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/inflate.h +53 -22
- pybcf-1.2.0/src/zlib-ng/inflate_p.h +231 -0
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/inftrees.c +38 -42
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/inftrees.h +17 -13
- pybcf-1.2.0/src/zlib-ng/insert_string.c +21 -0
- pybcf-1.2.0/src/zlib-ng/insert_string_roll.c +24 -0
- pybcf-1.2.0/src/zlib-ng/insert_string_tpl.h +107 -0
- pybcf-1.2.0/src/zlib-ng/match_tpl.h +284 -0
- pybcf-1.2.0/src/zlib-ng/trees.c +818 -0
- pybcf-1.2.0/src/zlib-ng/trees.h +40 -0
- pybcf-1.2.0/src/zlib-ng/trees_emit.h +227 -0
- pybcf-1.2.0/src/zlib-ng/trees_tbl.h +132 -0
- {pybcf-1.0.2/src/zlib → pybcf-1.2.0/src/zlib-ng}/uncompr.c +21 -26
- pybcf-1.2.0/src/zlib-ng/zbuild.h +327 -0
- pybcf-1.2.0/src/zlib-ng/zendian.h +60 -0
- pybcf-1.2.0/src/zlib-ng/zutil.c +111 -0
- pybcf-1.2.0/src/zlib-ng/zutil.h +140 -0
- pybcf-1.2.0/src/zlib-ng/zutil_p.h +75 -0
- pybcf-1.2.0/test/test_pybcf.py +170 -0
- pybcf-1.0.2/PKG-INFO +0 -38
- pybcf-1.0.2/README.md +0 -22
- pybcf-1.0.2/src/pybcf.egg-info/PKG-INFO +0 -38
- pybcf-1.0.2/src/pybcf.egg-info/SOURCES.txt +0 -55
- pybcf-1.0.2/src/sample_data.cpp +0 -104
- pybcf-1.0.2/src/zlib/adler32.c +0 -164
- pybcf-1.0.2/src/zlib/compress.c +0 -75
- pybcf-1.0.2/src/zlib/crc32.c +0 -1049
- pybcf-1.0.2/src/zlib/deflate.c +0 -2140
- pybcf-1.0.2/src/zlib/deflate.h +0 -377
- pybcf-1.0.2/src/zlib/gzclose.c +0 -23
- pybcf-1.0.2/src/zlib/gzread.c +0 -603
- pybcf-1.0.2/src/zlib/inffast.c +0 -320
- pybcf-1.0.2/src/zlib/inffast.h +0 -11
- pybcf-1.0.2/src/zlib/inffixed.h +0 -94
- pybcf-1.0.2/src/zlib/trees.c +0 -1117
- pybcf-1.0.2/src/zlib/trees.h +0 -128
- pybcf-1.0.2/src/zlib/zconf.h +0 -541
- pybcf-1.0.2/src/zlib/zlib.h +0 -1941
- pybcf-1.0.2/src/zlib/zutil.c +0 -299
- pybcf-1.0.2/src/zlib/zutil.h +0 -253
- pybcf-1.0.2/test/test_pybcf.py +0 -98
- {pybcf-1.0.2 → pybcf-1.2.0}/LICENSE.txt +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/pyproject.toml +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/setup.cfg +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/bcf.cpp +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/bcf.h +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/gzstream/gzstream.C +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/index.cpp +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/index.h +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf/__init__.py +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf.egg-info/dependency_links.txt +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf.egg-info/requires.txt +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/pybcf.egg-info/top_level.txt +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/variant.cpp +0 -0
- {pybcf-1.0.2 → pybcf-1.2.0}/src/variant.h +0 -0
|
@@ -8,5 +8,7 @@ include src/*.h
|
|
|
8
8
|
include src/*.cpp
|
|
9
9
|
include src/gzstream/gzstream.h
|
|
10
10
|
include src/gzstream/gzstream.C
|
|
11
|
-
include src/zlib/*.h
|
|
12
|
-
include src/zlib/*.c
|
|
11
|
+
include src/zlib-ng/*.h
|
|
12
|
+
include src/zlib-ng/*.c
|
|
13
|
+
recursive-include src/zlib-ng/arch/*.h
|
|
14
|
+
recursive-include src/zlib-ng/arch/*.c
|
pybcf-1.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pybcf
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Package for loading data from bcf files
|
|
5
|
+
Home-page: https://github.com/jeremymcrae/pybcf
|
|
6
|
+
Author: Jeremy McRae
|
|
7
|
+
Author-email: jmcrae@illumina.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE.txt
|
|
13
|
+
Requires-Dist: numpy
|
|
14
|
+
Provides-Extra: test
|
|
15
|
+
Requires-Dist: pysam; extra == "test"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### pybcf
|
|
19
|
+
|
|
20
|
+
This is a package for reading BCF files (binary call format). Similar to pysam/cyvcf2,
|
|
21
|
+
but limited to reading from BCF files only, and oriented around getting genotype
|
|
22
|
+
data into numpy arrays quickly.
|
|
23
|
+
|
|
24
|
+
This performs relatively better at larger sample sizes e.g. it's 7X faster than
|
|
25
|
+
pysam with 2k samples, but improves to 50X faster than pysam with 30k samples.
|
|
26
|
+
Currently it's slower than pysam for BCFs without samples, but on the other hand,
|
|
27
|
+
BCFs without variants aren't generally the limiting factor e.g. it still parses
|
|
28
|
+
300k variants/second under those conditions.
|
|
29
|
+
|
|
30
|
+
```py
|
|
31
|
+
from pybcf import BcfReader
|
|
32
|
+
|
|
33
|
+
bcf = BcfReader(bcf_path)
|
|
34
|
+
|
|
35
|
+
sample_ids = bcf.samples
|
|
36
|
+
contigs = bcf.header.contigs
|
|
37
|
+
|
|
38
|
+
for var in bcf:
|
|
39
|
+
# the usual attributes are available e.g.
|
|
40
|
+
# var.chrom, var.pos, var.ref, var.alts, var.info['AF']
|
|
41
|
+
|
|
42
|
+
# sample data is accessed as numpy arrays via the format keys
|
|
43
|
+
keys = list(var.samples)
|
|
44
|
+
genotypes = var.samples['GT'] # as n x 2 numpy array, missing=-1
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Limitations
|
|
48
|
+
- can't fetch variants from random regions yet
|
|
49
|
+
- extracting info fields is a little slow
|
pybcf-1.2.0/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
### pybcf
|
|
3
|
+
|
|
4
|
+
This is a package for reading BCF files (binary call format). Similar to pysam/cyvcf2,
|
|
5
|
+
but limited to reading from BCF files only, and oriented around getting genotype
|
|
6
|
+
data into numpy arrays quickly.
|
|
7
|
+
|
|
8
|
+
This performs relatively better at larger sample sizes e.g. it's 7X faster than
|
|
9
|
+
pysam with 2k samples, but improves to 50X faster than pysam with 30k samples.
|
|
10
|
+
Currently it's slower than pysam for BCFs without samples, but on the other hand,
|
|
11
|
+
BCFs without variants aren't generally the limiting factor e.g. it still parses
|
|
12
|
+
300k variants/second under those conditions.
|
|
13
|
+
|
|
14
|
+
```py
|
|
15
|
+
from pybcf import BcfReader
|
|
16
|
+
|
|
17
|
+
bcf = BcfReader(bcf_path)
|
|
18
|
+
|
|
19
|
+
sample_ids = bcf.samples
|
|
20
|
+
contigs = bcf.header.contigs
|
|
21
|
+
|
|
22
|
+
for var in bcf:
|
|
23
|
+
# the usual attributes are available e.g.
|
|
24
|
+
# var.chrom, var.pos, var.ref, var.alts, var.info['AF']
|
|
25
|
+
|
|
26
|
+
# sample data is accessed as numpy arrays via the format keys
|
|
27
|
+
keys = list(var.samples)
|
|
28
|
+
genotypes = var.samples['GT'] # as n x 2 numpy array, missing=-1
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Limitations
|
|
32
|
+
- can't fetch variants from random regions yet
|
|
33
|
+
- extracting info fields is a little slow
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import glob
|
|
3
3
|
import io
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from setuptools import setup
|
|
6
|
+
import subprocess
|
|
5
7
|
import sys
|
|
6
8
|
import os
|
|
9
|
+
import platform
|
|
7
10
|
|
|
8
11
|
from distutils.core import Extension
|
|
9
12
|
from distutils.ccompiler import new_compiler
|
|
@@ -21,22 +24,38 @@ if sys.platform == "darwin":
|
|
|
21
24
|
"-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
|
|
22
25
|
]
|
|
23
26
|
|
|
27
|
+
if platform.machine() == 'x86_64':
|
|
28
|
+
EXTRA_COMPILE_ARGS += ['-mavx', '-mavx2']
|
|
29
|
+
|
|
24
30
|
def flatten(*lists):
|
|
25
31
|
return [str(x) for sublist in lists for x in sublist]
|
|
26
32
|
|
|
27
33
|
def build_zlib():
|
|
28
|
-
''' compile zlib code to object files for linking
|
|
34
|
+
''' compile zlib code to object files for linking
|
|
29
35
|
|
|
30
36
|
Returns:
|
|
31
37
|
list of paths to compiled object code
|
|
32
38
|
'''
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
cur_dir = Path.cwd()
|
|
40
|
+
source_dir = cur_dir / 'src' / 'zlib-ng'
|
|
41
|
+
build_dir = cur_dir / 'zlib_build'
|
|
42
|
+
build_dir.mkdir(exist_ok=True)
|
|
43
|
+
os.chdir(build_dir)
|
|
44
|
+
|
|
45
|
+
cmd = ['cmake', '-S', source_dir, '-B', build_dir,
|
|
46
|
+
'-DZLIB_COMPAT=ON',
|
|
47
|
+
'-DZLIB_ENABLE_TESTS=OFF',
|
|
48
|
+
f'-DCMAKE_C_FLAGS="-fPIC"',
|
|
49
|
+
]
|
|
50
|
+
subprocess.run(cmd)
|
|
51
|
+
subprocess.run(['cmake', '--build', build_dir, '--config', 'Release'])
|
|
52
|
+
os.chdir(cur_dir)
|
|
53
|
+
|
|
54
|
+
objs = [str(build_dir / 'libz.a')]
|
|
55
|
+
if sys.platform == 'win32':
|
|
56
|
+
objs = [str(build_dir / 'Release' / 'zlib.lib')]
|
|
36
57
|
|
|
37
|
-
|
|
38
|
-
return cc.compile(sources, include_dirs=include_dirs,
|
|
39
|
-
extra_preargs=extra_compile_args)
|
|
58
|
+
return str(build_dir), objs
|
|
40
59
|
|
|
41
60
|
def get_gzstream_path():
|
|
42
61
|
''' workaround for building gzstream on windows
|
|
@@ -63,6 +82,9 @@ def scrub_gzstream():
|
|
|
63
82
|
directory from the include dirs, then clang complains about the missing
|
|
64
83
|
gzstream.h. This is because gzstream.C identifies it's header file with
|
|
65
84
|
angle brackets. Replacing the angle brackets in that line seems to work.
|
|
85
|
+
|
|
86
|
+
We also need to do the same for the "#include <zlib.h>" in the gzstream
|
|
87
|
+
header, since this now uses zlib-ng for better performance.
|
|
66
88
|
'''
|
|
67
89
|
with open(get_gzstream_path(), 'rt') as handle:
|
|
68
90
|
lines = handle.readlines()
|
|
@@ -72,12 +94,19 @@ def scrub_gzstream():
|
|
|
72
94
|
if line == '#include <gzstream.h>\n':
|
|
73
95
|
line = '#include "gzstream.h"\n'
|
|
74
96
|
handle.write(line)
|
|
97
|
+
|
|
98
|
+
# rejig the header file
|
|
99
|
+
gzstream_header_path = get_gzstream_path().rsplit('.')[0] + '.h'
|
|
100
|
+
with open(gzstream_header_path, 'rt') as handle:
|
|
101
|
+
lines = handle.readlines()
|
|
102
|
+
|
|
103
|
+
with open(gzstream_header_path, 'wt') as handle:
|
|
104
|
+
for line in lines:
|
|
105
|
+
if line == '#include <zlib.h>\n':
|
|
106
|
+
line = '#include "zlib.h"\n'
|
|
107
|
+
handle.write(line)
|
|
75
108
|
|
|
76
|
-
|
|
77
|
-
zlib, libs = build_zlib(), []
|
|
78
|
-
else:
|
|
79
|
-
zlib, libs = [], ['z']
|
|
80
|
-
|
|
109
|
+
include_dir, zlib = build_zlib()
|
|
81
110
|
scrub_gzstream()
|
|
82
111
|
|
|
83
112
|
ext = cythonize([
|
|
@@ -92,8 +121,7 @@ ext = cythonize([
|
|
|
92
121
|
'src/sample_data.cpp',
|
|
93
122
|
'src/variant.cpp'],
|
|
94
123
|
extra_objects=zlib,
|
|
95
|
-
include_dirs=['src',
|
|
96
|
-
libraries=libs,
|
|
124
|
+
include_dirs=['src', include_dir],
|
|
97
125
|
language='c++'),
|
|
98
126
|
])
|
|
99
127
|
|
|
@@ -101,7 +129,7 @@ setup(name='pybcf',
|
|
|
101
129
|
description='Package for loading data from bcf files',
|
|
102
130
|
long_description=io.open('README.md', encoding='utf-8').read(),
|
|
103
131
|
long_description_content_type='text/markdown',
|
|
104
|
-
version='1.0
|
|
132
|
+
version='1.2.0',
|
|
105
133
|
author='Jeremy McRae',
|
|
106
134
|
author_email='jmcrae@illumina.com',
|
|
107
135
|
license="MIT",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
#include <sstream>
|
|
4
|
+
#include <algorithm>
|
|
4
5
|
|
|
5
6
|
#include "header.h"
|
|
6
7
|
|
|
@@ -116,4 +117,68 @@ Header::Header(std::string & text) {
|
|
|
116
117
|
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
std::vector<std::string> Header::get_contigs() {
|
|
121
|
+
std::vector<std::uint32_t> keys;
|
|
122
|
+
keys.reserve(contigs.size());
|
|
123
|
+
for (auto& it : contigs) {
|
|
124
|
+
keys.push_back(it.first);
|
|
125
|
+
}
|
|
126
|
+
std::sort(keys.begin(), keys.end());
|
|
127
|
+
|
|
128
|
+
std::vector<std::string> vals;
|
|
129
|
+
vals.reserve(contigs.size());
|
|
130
|
+
for (auto & k : keys) {
|
|
131
|
+
vals.push_back(contigs[k].id);
|
|
132
|
+
}
|
|
133
|
+
return vals;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
std::vector<std::string> Header::get_info() {
|
|
137
|
+
std::vector<std::uint32_t> keys;
|
|
138
|
+
keys.reserve(info.size());
|
|
139
|
+
for (auto& it : info) {
|
|
140
|
+
keys.push_back(it.first);
|
|
141
|
+
}
|
|
142
|
+
std::sort(keys.begin(), keys.end());
|
|
143
|
+
|
|
144
|
+
std::vector<std::string> vals;
|
|
145
|
+
vals.reserve(info.size());
|
|
146
|
+
for (auto & k : keys) {
|
|
147
|
+
vals.push_back(info[k].id);
|
|
148
|
+
}
|
|
149
|
+
return vals;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
std::vector<std::string> Header::get_filters() {
|
|
153
|
+
std::vector<std::uint32_t> keys;
|
|
154
|
+
keys.reserve(filters.size());
|
|
155
|
+
for (auto& it : filters) {
|
|
156
|
+
keys.push_back(it.first);
|
|
157
|
+
}
|
|
158
|
+
std::sort(keys.begin(), keys.end());
|
|
159
|
+
|
|
160
|
+
std::vector<std::string> vals;
|
|
161
|
+
vals.reserve(filters.size());
|
|
162
|
+
for (auto & k : keys) {
|
|
163
|
+
vals.push_back(filters[k].id);
|
|
164
|
+
}
|
|
165
|
+
return vals;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
std::vector<std::string> Header::get_formats() {
|
|
169
|
+
std::vector<std::uint32_t> keys;
|
|
170
|
+
keys.reserve(format.size());
|
|
171
|
+
for (auto& it : format) {
|
|
172
|
+
keys.push_back(it.first);
|
|
173
|
+
}
|
|
174
|
+
std::sort(keys.begin(), keys.end());
|
|
175
|
+
|
|
176
|
+
std::vector<std::string> vals;
|
|
177
|
+
vals.reserve(format.size());
|
|
178
|
+
for (auto & k : keys) {
|
|
179
|
+
vals.push_back(format[k].id);
|
|
180
|
+
}
|
|
181
|
+
return vals;
|
|
182
|
+
}
|
|
183
|
+
|
|
119
184
|
}
|
|
@@ -44,6 +44,10 @@ public:
|
|
|
44
44
|
std::unordered_map<std::uint32_t, FilterField> filters;
|
|
45
45
|
std::unordered_map<std::uint32_t, FormatField> format;
|
|
46
46
|
std::vector<std::string> samples={};
|
|
47
|
+
std::vector<std::string> get_contigs();
|
|
48
|
+
std::vector<std::string> get_info();
|
|
49
|
+
std::vector<std::string> get_filters();
|
|
50
|
+
std::vector<std::string> get_formats();
|
|
47
51
|
};
|
|
48
52
|
|
|
49
53
|
}
|
|
@@ -14,6 +14,18 @@ Info::Info(char * _buf, Header * _header, std::uint32_t _offset, std::uint32_t _
|
|
|
14
14
|
n_info = _n_info;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
std::vector<std::string> Info::get_keys() {
|
|
18
|
+
if (!is_parsed) {
|
|
19
|
+
parse();
|
|
20
|
+
is_parsed = true;
|
|
21
|
+
}
|
|
22
|
+
std::vector<std::string> key_vals;
|
|
23
|
+
for (auto & x : keys) {
|
|
24
|
+
key_vals.push_back(x.first);
|
|
25
|
+
}
|
|
26
|
+
return key_vals;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
void Info::parse() {
|
|
18
30
|
std::uint32_t buf_idx = offset;
|
|
19
31
|
Typed type_val;
|
|
@@ -39,6 +39,7 @@ class Info {
|
|
|
39
39
|
public:
|
|
40
40
|
Info(char * _buf, Header * _header, std::uint32_t _offset, std::uint32_t _n_info);
|
|
41
41
|
Info() {};
|
|
42
|
+
std::vector<std::string> get_keys();
|
|
42
43
|
InfoType get_type(std::string &key);
|
|
43
44
|
|
|
44
45
|
std::int32_t get_int(uint32_t offset) {return scalar_ints[offset];};
|