BodenmillerGroup / imcRtools

An R package for handling and analysing imaging mass cytometry data
https://bodenmillergroup.github.io/imcRtools/
22 stars 10 forks source link

testInteractions() error #46

Closed erikgerdtsson closed 1 year ago

erikgerdtsson commented 3 years ago

The function does not handle the edge case if one of the CellTypes/labels has only one cell present in an ROI with no neighbors in expansion threshold. Throws an error in:

dat_stat[is.na(dat_baseline$ct), c("p_gt", "p_lt", "ct", "interaction", "p", "sig", "sigval") := NA]

(Works great otherwise, thanks for sharing)

erikgerdtsson commented 3 years ago

Error in [.data.table(dat_stat, is.na(dat_baseline$ct), :=(c("p_gt", : i evaluates to a logical vector length 1071 but there are 1089 rows. Recycling of logical i is no longer allowed as it hides more bugs than is worth the rare convenience. Explicitly use rep(...,length=.N) if you really need to recycle.

nilseling commented 3 years ago

Hi @erikgerdtsson Thanks for reporting this! Could you please let me know which version of the package you are using? I'll look into this next week.

erikgerdtsson commented 3 years ago

Hi @erikgerdtsson Thanks for reporting this! Could you please let me know which version of the package you are using? I'll look into this next week.

1.0.0

nilseling commented 3 years ago

Hi @erikgerdtsson

47 should have fixed this. The output now contains all possible label pairs across all images. Non existing labels per image are marked as NA.

Thanks again for raising the issue.

roseisgold commented 1 year ago

Hi! We are running version 1.4.2 and are coming across a similar error as above with the testInteractions() function. Feeling quite stuck. We will open a new issue but wanted to see if you had any advice for how to circumvent this! Thanks :)

nilseling commented 1 year ago

Hi @roseisgold

could you please share your SingleCellExperiment or SpatialExperiment with me at nils.eling@uzh.ch? I'd like to investigate this issue.

nilseling commented 1 year ago

After email contact this should have been resolved now in #103