Skip to content

Commit 3201319

Browse files
committed
Add minitest
1 parent 82f4ec2 commit 3201319

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def run(self):
133133
],
134134
package_data={"pysnptools" : [
135135
"util/pysnptools.hashdown.json",
136+
"tests/mintest.py",
136137
]
137138
},
138139
install_requires = install_requires,

tests/minitest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Download a sample file
2+
from pysnptools.util import example_file
3+
bgen_file = example_file("pysnptools/examples/example.bgen")
4+
5+
# Read from the file
6+
from pysnptools.distreader import Bgen
7+
bgen = Bgen(bgen_file) # Create a reader
8+
probs0 = bgen[:,0].read().val # Read 1st SNP
9+
print(probs0.shape) # Shape of the NumPy array
10+
assert probs0.shape==(500,1,3)
11+
12+
probs_all = bgen.read().val # Read all variants
13+
print(probs_all.shape) # Shape of the NumPy array
14+
assert probs_all.shape==(500,199,3)

0 commit comments

Comments
 (0)