pybcf 1.3.6__cp313-cp313-win_amd64.whl
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/__init__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2024 Illumina Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pybcf
|
|
3
|
+
Version: 1.3.6
|
|
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 sample level data, but BCFs
|
|
27
|
+
without genotypes aren't generally a 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=nan
|
|
45
|
+
|
|
46
|
+
# or fetch from random regions if bcf is indexed
|
|
47
|
+
for var in bcf.fetch('chr1', 10000, 200000):
|
|
48
|
+
print(var.chrom, var.pos)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Limitations
|
|
52
|
+
- doesn't work with uncompressed BCFs
|
|
53
|
+
- extracting info fields is a little slow
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pybcf/__init__.py,sha256=po8GqChH1BBvXtC-vHtzHEPwah9pyR4iCezt9HLTjy4,133
|
|
2
|
+
pybcf/reader.cp313-win_amd64.pyd,sha256=SVdXXEv-QhBRy2haxznhYMYm_bL0TZbhuaZJmulFZ_s,429568
|
|
3
|
+
pybcf-1.3.6.dist-info/LICENSE.txt,sha256=MxRXDy8fWiEiJRQAlvRbGb3MLVjFFR94ZiAQOGeCrdQ,1072
|
|
4
|
+
pybcf-1.3.6.dist-info/METADATA,sha256=tIo4ZIAfeMJCRKyCqr94H4WbFw4AMtJISOieZLAtlqk,1733
|
|
5
|
+
pybcf-1.3.6.dist-info/WHEEL,sha256=Cv3kb_0eCrY3e81u1ru5JoyzKr1NHqAjZwmUAZze2Cc,101
|
|
6
|
+
pybcf-1.3.6.dist-info/top_level.txt,sha256=pLb1O4a8hp36X7AX-LkXELphf8eFeRBqAlVd7mEbzZo,6
|
|
7
|
+
pybcf-1.3.6.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pybcf
|