mathesong / bloodstream

A PET BIDS blood-processing tool
Other
5 stars 2 forks source link

Issue when json and tsv entries are not aligned #8

Closed mnoergaard closed 1 year ago

mnoergaard commented 1 year ago

According to the PET BIDS specification for blood data, the time column is required to be in column 1. However, if the json entries and the tsv entries are not aligned, but are all there in each json and tsv, I get the following error:

bloodstream('/Users/martinnorgaard/Downloads/COX-1','/Users/martinnorgaard/Downloads/COX-1/code/config_2023-06-14_id-ZiU9.json')

processing file: template.rmd |....... | 8% [subsetting]
Quitting from lines 83-114 [subsetting] (template.rmd) Error in dplyr::filter(): ℹ In argument: extension == "json" || extension == "tsv". Caused by error in extension == "json" || extension == "tsv": ! 'length = 56' in coercion to 'logical(1)' Backtrace:

  1. bids_parse_files(params$studypath) %>% ...
  2. dplyr:::filter.data.frame(., extension == "json" || extension == "tsv")
  3. dplyr:::filter_rows(.data, dots, by)
  4. dplyr:::filter_eval(...)
    1. mask$eval_all_filter(dots, env_filter)
    2. dplyr (local) eval()
mathesong commented 1 year ago

Is this resolved when the json and tsv orders are actually aligned?

It seems to me to be an issue of parsing the data in the first place. I've had this error before when I've had other non-BIDS files in the BIDS data folder which are not in the derivatives, code, phenotype or sourcedata folders. But actually, I realise that at present, I'm not looking into the bidsignore file: I only learnt about that last week. Could this be the issue? If not, then this is going to require a little bit more thorough debugging.

So, in summary: are there other files in the dataset which aren't in those folders (but which might be in the bidsignore file)? If not, then maybe you could either create a minimal version of the dataset to send me which reproduces the problem, or else we could do a screen share session sometime.

mnoergaard commented 1 year ago

This is resolved with the recent updates to bloodstream, and was caused by updates by other R packages (dplyr). Many thanks, @mathesong!