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

Convert Range into Levels for #447

Open
yarikoptic opened this issue Jun 6, 2024 · 1 comment
Open

Convert Range into Levels for #447

yarikoptic opened this issue Jun 6, 2024 · 1 comment

Comments

@yarikoptic
Copy link
Contributor

deno based validator in

fails with

Validating dataset fnirs_automaticity/: Running  bids-validator fnirs_automaticity --json --ignoreNiftiHeaders
  [
    {
      "key": "TSV_VALUE_INCORRECT_TYPE",
      "severity": "error",
      "reason": "A value in a column did match the acceptable type for that column headers specified format.",
      "files_1": [
        {
          "name": "participants.tsv",
          "path": "/participants.tsv",
          "evidence": "'10' {
    name: \"handedness\",
    display_name: \"Subject handedness\",
    description: 'String value indicating one of \"left\", \"right\", \"ambidextrous\".\n' +
      \"\n\" +
      'For \"left\", use one of these values'... 216 more characters,
    type: \"string\",
    enum: [
      \"left\",         \"l\",
      \"L\",            \"LEFT\",
      \"Left\",         \"right\",
      \"r\",            \"R\",
      \"RIGHT\",        \"Right\",
      \"ambidextrous\", \"a\",
      \"A\",            \"AMBIDEXTROUS\",
      \"Ambidextrous\", \"n/a\"
    ]
  }"
        }
      ]
    }
  ]

since values there are numeric 9 and 10:

❯ mlr --itsv  cut -f handedness fnirs_automaticity/participants.tsv | sort | uniq -c
     19 handedness=10
      5 handedness=9

and .json contains some ad-hoc Range thus trying to change default "Levels" assigned to that column.

❯ jq .handedness < fnirs_automaticity/participants.json
{
  "Description": "handedness of the participant as a score on the Dutch Handedness Questionnaire",
  "TermURL": "doi:1765/956",
  "Range": "-10 (left) to + 10 (right)"
}

I think it is easy to resolve by providing Levels. Alternative is to extend BIDS with support for range, but that is in the future and thus not feasible as a quick fix here.

attn @sappelhoff @rob-luke @robertoostenveld who mastered the original PR as depicted in e84c122

@effigies
Copy link
Contributor

effigies commented Jun 6, 2024

The issue remains that we are not yet validating JSON-defined columns.

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

No branches or pull requests

2 participants