Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add genetic ancestry fields for schema 5.3 #1132

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Conversation

joyceyan
Copy link
Contributor

Reason for Change

https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/gh/chanzuckerberg/single-cell-curation/1114

Changes

adds all the genetic ancestry fields as well as related validation. i also updated example_valid.h5ad with:

X = anndata.read_h5ad("example_valid.h5ad")
X.obs["genetic_ancestry_African"] = float('nan')
X.obs["genetic_ancestry_East_Asian"] = float('nan')
X.obs["genetic_ancestry_European"] = float('nan')
X.obs["genetic_ancestry_Indigenous_American"] = float('nan')
X.obs["genetic_ancestry_Oceanian"] = float('nan')
X.obs["genetic_ancestry_South_Asian"] = float('nan')
X.write_h5ad("example_valid_new.h5ad")

Testing

  • added new unit tests

Notes for Reviewer

@@ -582,3 +582,15 @@ components:
- "cell culture"
- "organoid"
- "tissue"
genetic_ancestry_African:
type: genetic_ancestry_value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i initially tried doing something like:

type: float
rule: genetic_ancestry_African >= 0 and genetic_ancestry_African <= 1 or genetic_ancestry_African == float('nan')

but i couldn't quite figure out how to get the NaN check to work correctly with the query syntax. so i just created a new genetic_ancestry_value type

@joyceyan joyceyan force-pushed the joyce/genetic-ancestry branch from e4d5a58 to 36901ab Compare November 26, 2024 23:26
Copy link
Contributor

@nayib-jose-gloria nayib-jose-gloria left a comment

Choose a reason for hiding this comment

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

This looks good, but its missing validation for "All observations with the same donor_id MUST contain the same value." for each genetic_ancestry_*

@joyceyan joyceyan force-pushed the joyce/genetic-ancestry branch from b65f2d1 to 477f592 Compare November 27, 2024 18:18
Copy link
Contributor

@nayib-jose-gloria nayib-jose-gloria left a comment

Choose a reason for hiding this comment

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

One suggestion, non-blocking. Implementation looks good!

@joyceyan joyceyan merged commit 7f840ce into main Nov 27, 2024
7 of 8 checks passed
@joyceyan joyceyan deleted the joyce/genetic-ancestry branch November 27, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants