Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_plink returns bytes for variant_alleles not unicode #1209

Open
jeromekelleher opened this issue Mar 6, 2024 · 0 comments
Open

read_plink returns bytes for variant_alleles not unicode #1209

jeromekelleher opened this issue Mar 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jeromekelleher
Copy link
Collaborator

There's no good reason for returning bytes rather than utf8 unicode strings I think --- it can only lead to bugs in user code and inconsistencies in string handling (anyone remember Python 2???)

This is based on the "example" plink dataset in the test suite

       sg_ds = sgkit.io.plink.read_plink(path=path)
        print(sg_ds.variant_allele.values)
        print(sg_ds.variant_allele)

Gives

[[b'A' b'G']
 [b'T' b'C']]
<xarray.DataArray 'variant_allele' (variants: 2, alleles: 2)>
dask.array<astype, shape=(2, 2), dtype=|S1, chunksize=(2, 1), chunktype=numpy.ndarray>
@jeromekelleher jeromekelleher added the bug Something isn't working label Mar 6, 2024
@jeromekelleher jeromekelleher changed the title read_plink returns bytes values for variant_alleles no unicode read_plink returns bytes for variant_alleles not unicode Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant