Skip to content

Get date_time from file structure if METADATA is missing and emit a warning#2

Open
budhaChowdhury wants to merge 1 commit intoshaliulab:masterfrom
budhaChowdhury:missing-METADATA-patch
Open

Get date_time from file structure if METADATA is missing and emit a warning#2
budhaChowdhury wants to merge 1 commit intoshaliulab:masterfrom
budhaChowdhury:missing-METADATA-patch

Conversation

@budhaChowdhury
Copy link

This is useful to avoid the following error upon calling load_ethoscope

Error in `[.data.table`(roi_dt, , `:=`(t, (t + ms_after_ref)/1000)) : 
  RHS of assignment to existing column 't' is zero length but not NULL. If you intend to delete the column use NULL. Otherwise, the RHS must have length > 0; e.g., NA_integer_. If you are trying to change the column type to be an empty list column then, as with all column type changes, provide a full length RHS vector such as vector('list',nrow(DT)); i.e., 'plonk' in the new column.

The error occurs because ms_after_ref is a vector of length 0 because it is derived from experiment_info$date_time, which is NULL or at least not Truthy (length 0, etc) when the METADATA table is empty. The fix is to get the date_time of the dbfile from the filename or the folder itself. However, all dbfiles should have a METADATA for documentation purposes.

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

Successfully merging this pull request may close these issues.

1 participant