Skip to content

Commit

Permalink
Merge pull request #66 from malariagen/0710-cc-65
Browse files Browse the repository at this point in the history
Upgrade `cohorts_analysis` to 20210927
  • Loading branch information
cclarkson authored Oct 14, 2021
2 parents 9d9eb4c + b61db65 commit 97c2a67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions malariagen_data/ag3.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def snp_allele_frequencies(
self,
transcript,
cohorts,
cohorts_analysis="20210702",
cohorts_analysis="20210927",
min_cohort_size=10,
site_mask=None,
site_filters="dt_20200416",
Expand Down Expand Up @@ -1661,7 +1661,7 @@ def gene_cnv_frequencies(
self,
contig,
cohorts,
cohorts_analysis="20210702",
cohorts_analysis="20210927",
min_cohort_size=10,
species_calls=("20200422", "aim"),
sample_sets="v3_wild",
Expand Down Expand Up @@ -1970,7 +1970,7 @@ def _read_cohort_metadata(self, *, sample_set, cohorts_analysis):
self._cache_cohort_metadata[(sample_set, cohorts_analysis)] = df
return df

def sample_cohorts(self, sample_sets="v3_wild", cohorts_analysis="20210702"):
def sample_cohorts(self, sample_sets="v3_wild", cohorts_analysis="20210927"):
"""Access cohorts metadata for one or more sample sets.
Parameters
Expand Down
10 changes: 5 additions & 5 deletions tests/test_ag3.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,20 +617,20 @@ def test_snp_allele_frequencies__str_cohorts():
df = ag3.snp_allele_frequencies(
transcript="AGAP004707-RD",
cohorts=cohorts,
cohorts_analysis="20210702",
cohorts_analysis="20210927",
min_cohort_size=10,
site_mask="gamb_colu",
sample_sets="v3_wild",
drop_invariant=True,
)
df_coh = ag3.sample_cohorts(sample_sets="v3_wild", cohorts_analysis="20210702")
df_coh = ag3.sample_cohorts(sample_sets="v3_wild", cohorts_analysis="20210927")
coh_nm = "cohort_" + cohorts
all_uni = df_coh[coh_nm].dropna().unique().tolist()
expected_fields = universal_fields + all_uni + ["max_af"]

assert df.columns.tolist() == expected_fields
assert isinstance(df, pd.DataFrame)
assert df.shape == (16639, 101)
assert df.shape == (16524, 103)


def test_snp_allele_frequencies__dict_cohorts():
Expand Down Expand Up @@ -1049,7 +1049,7 @@ def test_gene_cnv_frequencies(contig, cohorts):
cohort_labels = cohorts.keys()
if isinstance(cohorts, str):
df_coh = ag3.sample_cohorts(
sample_sets="v3_wild", cohorts_analysis="20210702"
sample_sets="v3_wild", cohorts_analysis="20210927"
)
coh_nm = "cohort_" + cohorts
cohort_labels = list(df_coh[coh_nm].dropna().unique())
Expand Down Expand Up @@ -1173,7 +1173,7 @@ def test_sample_cohorts(sample_sets):
)

ag3 = setup_ag3()
df_coh = ag3.sample_cohorts(sample_sets=sample_sets, cohorts_analysis="20210702")
df_coh = ag3.sample_cohorts(sample_sets=sample_sets, cohorts_analysis="20210927")
df_meta = ag3.sample_metadata(sample_sets=sample_sets)

assert tuple(df_coh.columns) == expected_cols
Expand Down

0 comments on commit 97c2a67

Please sign in to comment.