@@ -279,7 +279,7 @@ def _swap(dim: Dimension) -> Dimension:
279
279
return "samples" if dim == "variants" else "variants"
280
280
281
281
282
- def call_rate (ds : Dataset , dim : Dimension , call_genotype_mask : str ) -> Dataset :
282
+ def call_rate (ds : Dataset , dim : Dimension , call_genotype_mask : Hashable ) -> Dataset :
283
283
odim = _swap (dim )[:- 1 ]
284
284
n_called = (~ ds [call_genotype_mask ].any (dim = "ploidy" )).sum (dim = dim )
285
285
return xr .Dataset (
@@ -288,7 +288,7 @@ def call_rate(ds: Dataset, dim: Dimension, call_genotype_mask: str) -> Dataset:
288
288
289
289
290
290
def genotype_count (
291
- ds : Dataset , dim : Dimension , call_genotype : str , call_genotype_mask : str
291
+ ds : Dataset , dim : Dimension , call_genotype : Hashable , call_genotype_mask : Hashable
292
292
) -> Dataset :
293
293
odim = _swap (dim )[:- 1 ]
294
294
M , G = ds [call_genotype_mask ].any (dim = "ploidy" ), ds [call_genotype ]
@@ -310,9 +310,9 @@ def genotype_count(
310
310
311
311
def allele_frequency (
312
312
ds : Dataset ,
313
- call_genotype : str ,
314
- call_genotype_mask : str ,
315
- variant_allele_count : Optional [str ],
313
+ call_genotype : Hashable ,
314
+ call_genotype_mask : Hashable ,
315
+ variant_allele_count : Optional [Hashable ],
316
316
) -> Dataset :
317
317
data_vars : Dict [Hashable , Any ] = {}
318
318
# only compute variant allele count if not already in dataset
@@ -339,9 +339,9 @@ def allele_frequency(
339
339
def variant_stats (
340
340
ds : Dataset ,
341
341
* ,
342
- call_genotype_mask : str = variables .call_genotype_mask ,
343
- call_genotype : str = variables .call_genotype ,
344
- variant_allele_count : Optional [str ] = None ,
342
+ call_genotype_mask : Hashable = variables .call_genotype_mask ,
343
+ call_genotype : Hashable = variables .call_genotype ,
344
+ variant_allele_count : Optional [Hashable ] = None ,
345
345
merge : bool = True ,
346
346
) -> Dataset :
347
347
"""Compute quality control variant statistics from genotype calls.
0 commit comments