DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

Error in nrow(fr) <= minEvents : comparison (<=) is not possible for language types #202

Closed AdamLeckenby closed 1 month ago

AdamLeckenby commented 2 months ago

Thank you for this excellent package. I have been using it for sometime without issue. Unfortunately, after updating R to 4.4.0 with a fresh install, I'm running into an unexpected issue. This may not relate to CytoExploreR directly, but rather one of the dependencies - I can provide further information if you require anything.

Describe the bug When drawing a gate which is to be saved in a gating template (csv), an error code is returned and no gating information is added to the .csv file. The .csv file is generated with headers, but no rows are added. The error information is:

Error in nrow(fr) <= minEvents : 
  comparison (<=) is not possible for language types

To Reproduce Steps to reproduce the behavior:

# Load required packages
library(CytoExploreR)

# Compensation FCS Files
cyto_save(Compensation,
save_as = "Compensation-Samples")

# Activation FCS Files
cyto_save(Activation,
save_as = "Activation-Samples")

# Setup compensation controls
gs <- cyto_setup("Compensation-Samples",
gatingTemplate = "Compensation-gatingTemplate.csv")

# Transform fluorescent channels - default logicle transformations
gs <- cyto_transform(gs)

# Gate Cells
cyto_gate_draw(gs,
parent = "root",
alias = "Cells",
channels = c("FSC-A", "SSC-A"),
gatingTemplate = "check.csv")
cyto_gate_draw(gs,
parent = "root",
alias = "Cells",
channels = c("FSC-A", "SSC-A"),
gatingTemplate = "check.csv",
popup=F)

Expected behavior In previous version of R, the csv file populated with gating information as expected.

Desktop (please complete the following information): Mac (M1 processor)

Additional context Issue appeared after updating to R version 4.4.0 from 4.2.3. No issue previously.

Session Information

R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_2.4.5       usethis_2.2.3        CytoExploreR_1.1.0   openCyto_2.13.0     
[5] flowCore_2.16.0      flowWorkspace_4.16.0
djhammill commented 2 months ago

Thanks for reporting this issue @AdamLeckenby - a BioC fix to openCyto is on the way. BioC ARM builds are taking some time so the fix may only be available in a week or so.

In the meantime, you can install directly from my branch on GitHub:

devtools::install_github("DillonHammill/openCyto", force = TRUE)
Mphi-s commented 2 months ago

@djhammill Thank you so much for fixing the program so quickly! Your branch worked. I heavily rely on CytoExploreR for my work, and your prompt response to the issue is greatly appreciated.