sgkit
sgkit copied to clipboard
Subset the samples?
I wanted to use sgkit to select some individuals from all samples, but the code in the references I looked for didn't work.
reference: [https://pystatgen.github.io/sgkit/latest/how_do_i.html#id10]
ds.sel(samples=ds.sample_id.isin(['Li_01', 'Li_02', 'Li_03',]))
KeyError: 'Indexing with a boolean dask array is not allowed. This will result in a dask array of unknown shape. Such arrays are unsupported by Xarray.Please compute the indexer first using .compute()'
Can you try this as a workaround:
ds.sel(samples=ds.sample_id.isin(['Li_01', 'Li_02', 'Li_03',]).values)
Maybe this was due to a recent change - will look into it.