bids-specification icon indicating copy to clipboard operation
bids-specification copied to clipboard

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

Open yarikoptic opened this issue 2 years ago • 3 comments

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?

yarikoptic avatar Oct 18 '23 15:10 yarikoptic

Sort of related:

  • https://github.com/bids-standard/bids-specification/issues/1020
  • https://github.com/bids-standard/bids-specification/issues/458

Remi-Gau avatar Oct 18 '23 16:10 Remi-Gau

The schema can definitely be ~~perverted~~used to handle units:

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

effigies avatar Oct 18 '23 16:10 effigies

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

yarikoptic avatar Oct 18 '23 20:10 yarikoptic