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

fix: cell culture edge case for zebrafish, fly, roundworm #1249

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

joyceyan
Copy link
Contributor

@joyceyan joyceyan commented Feb 4, 2025

Reason for Change

feedback from brian mott: https://czi-sci.slack.com/archives/C07AV4NU9D2/p1738627367824459?thread_ts=1738345846.792719&cid=C07AV4NU9D2

When tissue_type == cell culture, then the rules for cell_type_ontology_term_id should apply for tissue_ontology_term_id. However, only CL terms are valid in this case, instead of both CL and the respective organism cell ontology (FBbt, ZFA, or WBbt)

i also picked up one of the minor nits which was to remove the \n from error messages

Changes

  • updates the validator to ensure that this case is now caught properly. this does make the schema definition even more janky.
  • @ejmolinelli i do recall you mentioning that we can easily extend the validator to name rules and apply rules in certain areas. i wasn't sure if you made much (or any) progess actually writing code for that, but this would definitely be a good place for that. i decided against actually trying to implement that change in this PR since i didn't want to duplicate work if you had already started working on this.

Testing

  • wrote tests to verify correctness
  • i updated some existing tests to just validate yes / no instead of asserting on exact error message copy

Notes for Reviewer

@joyceyan joyceyan requested a review from ejmolinelli February 4, 2025 01:08
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.87%. Comparing base (210bf9f) to head (69ad6a3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1249      +/-   ##
==========================================
- Coverage   89.89%   89.87%   -0.03%     
==========================================
  Files          19       19              
  Lines        2188     2193       +5     
==========================================
+ Hits         1967     1971       +4     
- Misses        221      222       +1     
Components Coverage Δ
cellxgene_schema_cli 90.82% <100.00%> (-0.04%) ⬇️
migration_assistant 91.26% <ø> (ø)
schema_bump_dry_run_genes 79.80% <ø> (ø)
schema_bump_dry_run_ontologies 99.53% <ø> (ø)

@brianraymor
Copy link
Contributor

Hi @joyceyan -please do not update the CLI code before the schema is updated. Clarifying the requirement with @jahilton on #sci-data-eng.

@ejmolinelli
Copy link
Contributor

Hi @joyceyan I did say that we can used named rule sets. However, that was an experimental branch that we abandoned to shift our focus to delivering on this release instead of spending time updating the validator.

It wold be a relatively easy addition to the schema but could potentially introduce infinite loops so some caution and extra testing would be required. We should add this to the maintenance tasks and flag this issue as an example where that feature would come in handy.

Copy link
Contributor

@ejmolinelli ejmolinelli left a comment

Choose a reason for hiding this comment

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

Hey Joyce. This works as far as I can tell. A few non-urgent nits.

  1. Add to the test_cell_culture_tissue_ontology_term_id_invalid tests using the wrong organism specific ontology e.g. ZFA for worm, WBt for zebrafish,
  2. maintain the allowed ontology prefix map as a constant outside of the validation function, so it's perhaps easier to identify as a global constraint and not an implementation detail.

@joyceyan joyceyan merged commit 011bbad into main Feb 5, 2025
12 of 14 checks passed
@joyceyan joyceyan deleted the joyce/fix-cell-cultures branch February 5, 2025 16:00
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.

3 participants