bids-standard / bids-specification

Brain Imaging Data Structure (BIDS) Specification
https://bids-specification.readthedocs.io/
Creative Commons Attribution 4.0 International
272 stars 156 forks source link

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

Open yarikoptic opened 10 months ago

yarikoptic commented 10 months ago

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:

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:

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 commented 10 months ago

Sort of related:

effigies commented 10 months ago

The schema can definitely be pervertedused to handle units:

https://github.com/bids-standard/bids-specification/blob/0dcb141fccec5bbd92e482a071fefba0d0bbfdb1/src/schema/rules/checks/micr.yaml#L14-L23

yarikoptic commented 10 months ago

https://giphy.com/gifs/bushes-spicer-correction-COYGe9rZvfiaQ/fullscreen