Skip to content

Iz heart tier2#1651

Open
idazucchi wants to merge 110 commits intostagingfrom
iz-heart-tier2
Open

Iz heart tier2#1651
idazucchi wants to merge 110 commits intostagingfrom
iz-heart-tier2

Conversation

@idazucchi
Copy link
Collaborator

@idazucchi idazucchi commented Feb 11, 2026

Release notes

This PR adds the tier 2 fields requested by the Heart bionetwork (reference sheet here) - none of the fields added in this PR are required

Please note that the modules blood_test, lifestyle are introduced in the Adipose PR which will be merged before the Heart PR, I pulled them into this branch because I need to add fields to them

New optional fields

For module/biomaterial/medical_history.json :

  • diseases_history
  • device_treatment
  • cardioplegia

For module/biomaterial/lifestyle.json :

  • substance_type
  • substance_frequency
  • substance_use_duration
  • substance_duration_since_last_use

For module/biomaterial/medical_tests.json :

  • ecg_heart_rate
  • ecg_heart_rhythm
  • ecg_pr_interval_duration
  • ecg_qrs_complex_duration
  • ecg_lbbb_rbbb_ivcd
  • ecg_qt_interval_corrected
  • ecg_time_offset
  • echo_aortic_stenosis
  • echo_aortic_regurgitation
  • echo_mitral_regurgitation
  • echo_mitral_stenosis
  • echo_tricuspid_regurgitation
  • echo_estimated_rvsp
  • echo_lvedv
  • echo_lvedv_indexed
  • echo_lvesv
  • echo_lvesv_indexed
  • echo_lvef
  • echo_lv_mass
  • echo_lv_mass_indexed
  • echo_rv_fac
  • echo_tapse
  • echo_lv_septum_thickness
  • echo_pw_thickness
  • echo_la_dimension
  • echo_lav_indexed
  • echo_time_offset
  • mri_lvedv
  • mri_lvedv_indexed
  • mri_lvesv
  • mri_lvesv_indexed
  • mri_lvef
  • mri_lv_mass
  • mri_lv_mass_indexed
  • mri_rv_ejection_fraction
  • mri_mid_wall_lge
  • mri_epicardial_lge
  • mri_infarct_pattern_lge
  • mri_myocardial_oedema
  • mri_time_offset
  • mps_lvef
  • mps_inducible_ischaemic
  • mps_scar
  • mps_time_offset

For module/biomaterial/blood_test.json :

  • sodium
  • sodium_unit
  • potassium
  • potassium_unit
  • urea
  • urea_unit
  • creatinine
  • creatinine_unit
  • total_bilirubin
  • total_bilirubin_unit

For type/biomaterial/specimen_from_organism.json :

  • transplant_rejection_reason"

Changes to existing fields

For specimen_from_organism.json:

  • transplant_organ : changed the type from boolean to enum. The enum validation is not compatible with the boolean, but the mapping between boolean and enum is clear so moving to a more recent version of the schema will be easy if needed

Reviews requested

Need 4 Reviewers to approve because this is a major update

@idazucchi idazucchi self-assigned this Feb 18, 2026
@idazucchi idazucchi added the content Any PR that incorporates changes to the schema label Feb 18, 2026
Copy link
Contributor

@hannes-ucsc hannes-ucsc left a comment

Choose a reason for hiding this comment

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

Many of the regexes in here are buggy and pass on nonsensical inputs

Image

I believe I posted a working alternative on one your other PRs.

idazucchi and others added 4 commits February 26, 2026 16:11
# Conflicts:
#	docs/jsonBrowser/type.md
#	json_schema/type/biomaterial/specimen_from_organism.json
#	json_schema/type/protocol/biomaterial_collection/collection_protocol.json
#	json_schema/versions.json
@idazucchi
Copy link
Collaborator Author

Hi @hannes-ucsc
I've addressed the regex issue, please let me know if you have other comments

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the metadata schema to support additional (mostly optional) tier-2 biomaterial and clinical fields (notably for Heart), introduces new biomaterial modules, and updates associated docs/tests and CI configuration to match the schema changes.

Changes:

  • Added new schema properties across biomaterial modules/types (e.g., expanded medical tests/history, transplant metadata updates).
  • Introduced new biomaterial modules (blood_test, lifestyle) and wired them into existing schemas and docs.
  • Updated testing/tooling docs and CI to run Python tests with pytest, plus updated some example project test JSONs.

Reviewed changes

Copilot reviewed 21 out of 25 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/schema_test_files/project/test_pass_project_0.json Updates project example to schema v20 and adds required data_use_restriction.
tests/schema_test_files/project/test_fail_project_0.json Updates failing project example to schema v20 and adds required data_use_restriction.
tests/README.md Updates Node instructions and adds VS Code test-running guidance.
requirements.txt Adds pytest for Python test execution.
package-lock.json Adds a root lockfile (separate from tests/package-lock.json).
json_schema/versions.json Registers new biomaterial modules in the version map.
json_schema/update_log.csv Adds release-log entries for some schema changes.
json_schema/type/protocol/sequencing/library_preparation_protocol.json Adds processing_time.
json_schema/type/protocol/biomaterial_collection/collection_protocol.json Adds biopsy_procedure enum.
json_schema/type/biomaterial/specimen_from_organism.json Changes transplant_organ to enum; adds transplant and other new fields.
json_schema/type/biomaterial/cell_suspension.json Adds nuclei_yield.
json_schema/module/biomaterial/reproductive_history.json Fixes describedBy pattern; adds menstrual_cycle_stage.
json_schema/module/biomaterial/medical_tests.json Adds ECG/ECHO/MRI/MPS heart-related metrics.
json_schema/module/biomaterial/medical_history.json Adds fasting time, disease history, device treatment, cardioplegia, and blood test module ref.
json_schema/module/biomaterial/lifestyle.json New schema module for lifestyle/substance-use fields.
json_schema/module/biomaterial/human_specific.json Updates BMI representation; adds waist metrics and lifestyle module ref.
json_schema/module/biomaterial/blood_test.json New schema module for blood-test results and units.
docs/jsonBrowser/type.md Updates generated type docs for new/changed fields.
docs/jsonBrowser/required_fields.md Updates generated required-fields docs for new modules.
docs/jsonBrowser/module.md Updates generated module docs for new/changed fields.
.vscode/settings.json Adds local editor test runner + pytest configuration.
.pullapprove.yml Adjusts reviewer lists/groups.
.gitignore Adds *.pyc.
.github/workflows/schema-tests.yml Switches Python test invocation to pytest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

idazucchi and others added 2 commits March 5, 2026 15:01
…cursor's

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@hannes-ucsc hannes-ucsc left a comment

Choose a reason for hiding this comment

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

I had to abandon my review because it appears that both this PR and https://github.com/HumanCellAtlas/metadata-schema/pull/1638/changes touch some of the same files. The overlap is significant, so I think we should focus on on PR at a time. I won't be able to review this again until the other has been merged.

},
"nuclei_yield": {
"description": "Number of nuclei sequenced per mg of tissue.",
"type": "integer",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "integer",
"type": "integer",
"minimum": 0,

},
"fasting_time": {
"description": "Duration of the donor's fasting period (in hours) prior to sample collection.",
"type": "integer",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "integer",
"type": "integer",
"minimum": 0,

},
"androstenedione": {
"description": "Androstenedione in the last blood test of the donor before collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"dhea": {
"description": "Dehydroepiandrosterone (DHEA) in the last blood test of the donor before collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"estrogen": {
"description": "Estrogen in the last blood test of the donor before collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"free_fatty_acid": {
"description": "Free Fatty Acid (FFA) in the last blood test of the donor before collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"haematocrit": {
"description": "Percentage of red blood cells in whole blood from the donor's last blood test prior to biopsy collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"haemoglobin": {
"description": "Concentration of haemoglobin in whole blood from the donor's last blood test prior to biopsy collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"hba1c": {
"description": "Concentration of glycated hemoglobin (HbA1c) from the donor's last blood test prior to biopsy collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

},
"homa_ir": {
"description": "Homeostatic Model Assessment of Insulin Resistance (HOMA-IR) in the last blood test of the donor before collection.",
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": "number",
"type": "number",
"minimum": 0,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Any PR that incorporates changes to the schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants