Skip to content

Cohort access#58

Merged
cclarkson merged 10 commits intomasterfrom
51-cohort-access
Sep 9, 2021
Merged

Cohort access#58
cclarkson merged 10 commits intomasterfrom
51-cohort-access

Conversation

@cclarkson
Copy link
Copy Markdown
Collaborator

resolves #51

Adds a method Ag3.sample_cohorts(sample_sets, analysis) to access the Ag3 defined cohorts metadata. Tests have also been written for the method, but currently these point at the staging bucket. Once the metadata is copied to the release bucket, the tests should be updated.

@cclarkson cclarkson requested a review from alimanfoo August 12, 2021 15:11
# test a single sample set
sample_sets = "AG1000G-UG"
df_UG = ag3.sample_cohorts(sample_sets=sample_sets)
assert df_UG.sample_id[0] == "AC0007-C"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest:

df_UG_meta = ag3.sample_metadata(sample_sets=sample_set)
assert len(df_UG) == len(df_UG_meta)
assert df_UG['sample_id'].tolist() == df_UG_meta['sample_id'].tolist()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If compare with sample metadata, could make most of this generic, and use pytest.parameterize.

@cclarkson
Copy link
Copy Markdown
Collaborator Author

@alimanfoo, I've allowed crosses in the code and switched the test to pytest.parameterize. It should be good to go now.

Copy link
Copy Markdown
Member

@alimanfoo alimanfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 💐

@cclarkson cclarkson merged commit 7a39593 into master Sep 9, 2021
@cclarkson cclarkson deleted the 51-cohort-access branch September 9, 2021 15:53
@cclarkson
Copy link
Copy Markdown
Collaborator Author

resolved by #61

kathrynmurie pushed a commit to kathrynmurie/malariagen-data-python that referenced this pull request Oct 5, 2021
@alimanfoo alimanfoo added the BMGF-001927 Work supported by BMGF grant INV-001927 (MalariaGEN 2019-2024). label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BMGF-001927 Work supported by BMGF grant INV-001927 (MalariaGEN 2019-2024).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add access to predefined cohorts

2 participants