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

Formalize participants' age to actually allow for other than year units/durations #1633

Open
yarikoptic opened this issue Oct 18, 2023 · 3 comments · May be fixed by #1791
Open

Formalize participants' age to actually allow for other than year units/durations #1633

yarikoptic opened this issue Oct 18, 2023 · 3 comments · May be fixed by #1791

Comments

@yarikoptic
Copy link
Collaborator

ATM it must be in years (according to schema and hardcoded there assumptions), although text suggests differently

If no `units` is provided for age, it will be assumed to be in years relative to date of birth.

which was suggested/accepted in code review of #459 but 1. no alternative units are specified (thus unknown/useless) ; 2. such relaxation was not later reflected in the schema which now just hardcode via unit: years without alternative unit values provided. (not even sure if we formalize units to be machine readable ATM, e.g. see #1631 to fix some values)

@bids-standard/bep032 is working on animal ecephys. In "animal world" restriction to age in years is often too restrictive, ambiguous in conversion (# of days in a year changes, # of days in month variable, etc) or not even expressive enough (pre-gestational age etc; let's keep that for a separate issue). So we need to improve on specification of age by allowing other "units" and also allow for metadata field following some dictionary which would allow specification of the "age reference". Here is what is done in other standards/uses:

  • NWB uses "age" of "text" type . For DANDI then it allows for treating ISO 8601 Durations values if those are specified, enforced during metadata validation using nwbinspector . Use of ISO 8601 makes any duration inambigous.

Since we are "unit" oriented ATM, I think the easiest resolution for this aspect would be to just do implement in the schema on what is promised in the text:

  • Consider "Units" sidecar file value
  • Define explicit "unit" values which would be accepted for age: year, month, day, hour, minute, s, ms

Question to schema folks (@effigies @rwblair @nellh): how difficult would be to generalize current check

CheckAge89:
  issue:
    code: AGE_89
    message: .... trimmed...
    level: warning
  selectors:
    - path == 'participants.tsv'
    - columns.age != null
  checks:
    - max(columns.age) < 89

to support use of the "Units" in the side car?

@Remi-Gau
Copy link
Collaborator

@effigies
Copy link
Collaborator

The schema can definitely be pervertedused to handle units:

checks:
- |
ome.PhysicalSizeX * 10 ** (-3 * index(["mm", "um", "nm"], ome.PhysicalSizeXUnit))
== sidecar.PixelSize[0] * 10 ** (-3 * index(["mm", "um", "nm"], sidecar.PixelSizeUnit))
- |
ome.PhysicalSizeY * 10 ** (-3 * index(["mm", "um", "nm"], ome.PhysicalSizeYUnit))
== sidecar.PixelSize[1] * 10 ** (-3 * index(["mm", "um", "nm"], sidecar.PixelSizeUnit))
- |
ome.PhysicalSizeZ * 10 ** (-3 * index(["mm", "um", "nm"], ome.PhysicalSizeZUnit))
== sidecar.PixelSize[2] * 10 ** (-3 * index(["mm", "um", "nm"], sidecar.PixelSizeUnit))

@yarikoptic
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants