Skip to content

Commit a3b8aae

Browse files
committed
Simplfy field fetch in plink
1 parent b9494a5 commit a3b8aae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bio2zarr/plink.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ def iter_alleles(self, start, stop, num_alleles):
3333
yield alleles
3434

3535
def iter_field(self, field_name, shape, start, stop):
36-
data = {
37-
"position": self.bed.bp_position,
38-
}[field_name]
39-
yield from data[start:stop]
36+
assert field_name == "position" # Only position field is supported from plink
37+
yield from self.bed.bp_position[start:stop]
4038

4139
def iter_genotypes(self, shape, start, stop):
4240
bed_chunk = self.bed.read(slice(start, stop), dtype=np.int8).T

0 commit comments

Comments
 (0)