@@ -617,7 +617,7 @@ def sample_stats(
617
617
return conditional_merge_datasets (ds , variables .validate (new_ds ), merge )
618
618
619
619
620
- def infer_non_alleles (
620
+ def infer_call_genotype_fill (
621
621
ds : Dataset ,
622
622
* ,
623
623
call_genotype : Hashable = variables .call_genotype ,
@@ -626,24 +626,22 @@ def infer_non_alleles(
626
626
variables .validate (ds , {call_genotype : variables .call_genotype_spec })
627
627
mixed_ploidy = ds [variables .call_genotype ].attrs .get ("mixed_ploidy" , False )
628
628
if mixed_ploidy :
629
- call_genotype_non_allele = ds [call_genotype ] < - 1
629
+ call_genotype_fill = ds [call_genotype ] < - 1
630
630
else :
631
- call_genotype_non_allele = xr .full_like (ds [call_genotype ], False , "b1" )
632
- new_ds = create_dataset (
633
- {variables .call_genotype_non_allele : call_genotype_non_allele }
634
- )
631
+ call_genotype_fill = xr .full_like (ds [call_genotype ], False , "b1" )
632
+ new_ds = create_dataset ({variables .call_genotype_fill : call_genotype_fill })
635
633
return conditional_merge_datasets (ds , variables .validate (new_ds ), merge )
636
634
637
635
638
636
def infer_call_ploidy (
639
637
ds : Dataset ,
640
638
* ,
641
639
call_genotype : Hashable = variables .call_genotype ,
642
- call_genotype_non_allele : Hashable = variables .call_genotype_non_allele ,
640
+ call_genotype_fill : Hashable = variables .call_genotype_fill ,
643
641
merge : bool = True ,
644
642
) -> Dataset :
645
643
"""Infer the ploidy of each call genotype based on the number of
646
- non-allele values in each call genotype.
644
+ fill ( non-allele) values in each call genotype.
647
645
648
646
Parameters
649
647
----------
@@ -653,12 +651,12 @@ def infer_call_ploidy(
653
651
Input variable name holding call_genotype as defined by
654
652
:data:`sgkit.variables.call_genotype_spec`.
655
653
Must be present in ``ds``.
656
- call_genotype_non_allele
657
- Input variable name holding call_genotype_non_allele as defined by
658
- :data:`sgkit.variables.call_genotype_non_allele_spec `.
654
+ call_genotype_fill
655
+ Input variable name holding call_genotype_fill as defined by
656
+ :data:`sgkit.variables.call_genotype_fill_spec `.
659
657
If the variable is not present in ``ds``, it will be computed
660
- assuming that allele values less than -1 are non-alleles in mixed ploidy
661
- datasets, or that no non-alleles are present in fixed ploidy datasets.
658
+ assuming that allele values less than -1 are fill ( non-allele) values in mixed ploidy
659
+ datasets, or that no fill values are present in fixed ploidy datasets.
662
660
merge
663
661
If True (the default), merge the input dataset and the computed
664
662
output variables into a single dataset, otherwise return only
@@ -671,13 +669,13 @@ def infer_call_ploidy(
671
669
"""
672
670
ds = define_variable_if_absent (
673
671
ds ,
674
- variables .call_genotype_non_allele ,
675
- call_genotype_non_allele ,
676
- infer_non_alleles ,
672
+ variables .call_genotype_fill ,
673
+ call_genotype_fill ,
674
+ infer_call_genotype_fill ,
677
675
)
678
676
mixed_ploidy = ds [variables .call_genotype ].attrs .get ("mixed_ploidy" , False )
679
677
if mixed_ploidy :
680
- call_ploidy = (~ ds [call_genotype_non_allele ]).sum (axis = - 1 )
678
+ call_ploidy = (~ ds [call_genotype_fill ]).sum (axis = - 1 )
681
679
else :
682
680
ploidy = ds [variables .call_genotype ].shape [- 1 ]
683
681
call_ploidy = xr .full_like (ds [variables .call_genotype ][..., 0 ], ploidy )
@@ -694,7 +692,7 @@ def infer_variant_ploidy(
694
692
merge : bool = True ,
695
693
) -> Dataset :
696
694
"""Infer the ploidy at each variant across all samples based on
697
- the number of non-allele values in call genotypes.
695
+ the number of fill ( non-allele) values in call genotypes.
698
696
699
697
Parameters
700
698
----------
@@ -743,7 +741,7 @@ def infer_sample_ploidy(
743
741
merge : bool = True ,
744
742
) -> Dataset :
745
743
"""Infer the ploidy of each sample across all variants based on
746
- the number of non-allele values in call genotypes.
744
+ the number of fill ( non-allele) values in call genotypes.
747
745
748
746
Parameters
749
747
----------
0 commit comments