File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1872,9 +1872,10 @@ def biallelic_snp_calls(
18721872
18731873 # Apply missingness condition.
18741874 if max_missing_an is not None :
1875- an_missing = (ds_out .sizes ["samples" ] * ds_out .sizes ["ploidy" ]) - an
1875+ an_total = ds_out .sizes ["samples" ] * ds_out .sizes ["ploidy" ]
1876+ an_missing = an_total - an
18761877 if isinstance (max_missing_an , float ):
1877- an_missing_frac = an_missing / an
1878+ an_missing_frac = an_missing / an_total
18781879 loc_missing = an_missing_frac <= max_missing_an
18791880 else :
18801881 loc_missing = an_missing <= max_missing_an
Original file line number Diff line number Diff line change @@ -1066,7 +1066,7 @@ def cohort_diversity_stats(
10661066 cohort_label , cohort_query = cohort
10671067
10681068 else :
1069- raise TypeError (r "invalid cohort parameter: {cohort!r}" )
1069+ raise TypeError (f "invalid cohort parameter: { cohort !r} " )
10701070
10711071 debug ("access allele counts" )
10721072 ac = self .snp_allele_counts (
Original file line number Diff line number Diff line change @@ -430,6 +430,7 @@ def _init_filesystem(url, **kwargs):
430430 """Initialise a fsspec filesystem from a given base URL and parameters."""
431431
432432 storage_options = None # To prevent using before assignment (Pylint).
433+ simplecache_options = kwargs .pop ("simplecache" , None )
433434
434435 # Special case Google Cloud Storage, authenticate the user.
435436 if "gs://" in url or "gcs://" in url :
@@ -487,6 +488,9 @@ def _init_filesystem(url, **kwargs):
487488 # Some other kind of URL, pass through kwargs as-is.
488489 storage_options = kwargs
489490
491+ if simplecache_options is not None :
492+ storage_options ["simplecache" ] = simplecache_options
493+
490494 # Process the URL using fsspec.
491495 fs , path = url_to_fs (url , ** storage_options )
492496
Original file line number Diff line number Diff line change @@ -1723,8 +1723,9 @@ def test_biallelic_snp_calls_and_diplotypes_with_conditions_fractional(
17231723 an = ac .sum (axis = 1 )
17241724 ac_min = ac .min (axis = 1 )
17251725 assert np .all ((ac_min / an ) >= min_minor_ac )
1726- an_missing = (ds .sizes ["samples" ] * ds .sizes ["ploidy" ]) - an
1727- assert np .all ((an_missing / an ) <= max_missing_an )
1726+ an_total = ds .sizes ["samples" ] * ds .sizes ["ploidy" ]
1727+ an_missing = an_total - an
1728+ assert np .all ((an_missing / an_total ) <= max_missing_an )
17281729 gt = ds ["call_genotype" ].values
17291730 ac_check = allel .GenotypeArray (gt ).count_alleles (max_allele = 1 )
17301731 assert np .all (ac == ac_check )
You can’t perform that action at this time.
0 commit comments