Hello,
I'm running the spicy() function on a SpatialDataset, all_RData_merged, that contains the following colData:
Formal class 'DFrame' [package "S4Vectors"] with 6 slots
..@ rownames : chr [1:107810] "1" "2" "3" "4" ...
..@ nrows : int 107810
..@ elementType : chr "ANY"
..@ elementMetadata: NULL
..@ metadata : list()
..@ listData :List of 10
.. ..$ Cell.ID : chr [1:107810] "1" "2" "3" "4" ...
.. ..$ Phenotype : chr [1:107810] "OTHER" "OTHER" "OTHER" "OTHER" ...
.. ..$ sample_id : chr [1:107810] "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" ...
.. ..$ Location_Tag : chr [1:107810] "Outside" "Outside" "Outside" "Outside" ...
.. ..$ Sample_ID : Factor w/ 2 levels "BL","BEF": 2 2 2 2 2 2 2 2 2 2 ...
.. ..$ Patient_ID : chr [1:107810] "009-01" "009-01" "009-01" "009-01" ...
.. ..$ ROI_ID : chr [1:107810] "ROI_1" "ROI_1" "ROI_1" "ROI_1" ...
.. ..$ Response_after_IT : Factor w/ 2 levels "non-PR","PR": 1 1 1 1 1 1 1 1 1 1 ...
.. ..$ Response_after_RCT: Factor w/ 2 levels "non-CR","CR": 2 2 2 2 2 2 2 2 2 2 ...
.. ..$ Response_EOT : Factor w/ 2 levels "non-CR","CR": 2 2 2 2 2 2 2 2 2 2 ...
- when I run:
spicy <- spicy(all_RData_merged,
condition = "Sample_ID",
subject = "Patient_ID",
imageID = "ROI_ID",
cellType = "Phenotype",
spatialCoords = c("Cell.X.Position", "Cell.Y.Position"))
I obtain a SpicyResults object with the following "coefficient" slot:

and I can calculate topPairs(spicy) withpout any problem.
- However when I use either Response_after_IT, Response_after_RCT or Response_EOT, as the condition, e.g.:
spicy <- spicy(all_RData_merged,
condition = "Response_EOT",
subject = "Patient_ID",
imageID = "ROI_ID",
cellType = "Phenotype",
spatialCoords = c("Cell.X.Position", "Cell.Y.Position"))
the SpicyResults object contains this "coefficient" slot:

and topPairs(spicy) returns:
Error in topPairs(spicy, n = Inf) : coef not a column name
I really don't understand why this works in one case and not the other.
My session info are:
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.4
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.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
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/Paris
tzcode source: internal
attached base packages:
NULL
other attached packages:
[1] lubridate_1.9.4 forcats_1.0.1
[3] stringr_1.6.0 purrr_1.2.0
[5] readr_2.1.6 tidyr_1.3.1
[7] tibble_3.3.0 tidyverse_2.0.0
[9] readxl_1.4.5 survival_3.8-3
[11] dplyr_1.1.4 imcRtools_1.14.0
[13] SpatialDatasets_1.6.3 ExperimentHub_2.16.1
[15] AnnotationHub_3.16.1 BiocFileCache_2.16.2
[17] dbplyr_2.5.1 SpatialExperiment_1.18.1
[19] SingleCellExperiment_1.30.1 SummarizedExperiment_1.38.1
[21] Biobase_2.68.0 GenomicRanges_1.60.0
[23] GenomeInfoDb_1.44.3 IRanges_2.42.0
[25] S4Vectors_0.46.0 BiocGenerics_0.54.1
[27] generics_0.1.4 MatrixGenerics_1.20.0
[29] matrixStats_1.5.0 ggplot2_4.0.1
[31] spicyR_1.20.5
Thanks in advance for help on this
Hello,
I'm running the spicy() function on a SpatialDataset, all_RData_merged, that contains the following colData:
Formal class 'DFrame' [package "S4Vectors"] with 6 slots
..@ rownames : chr [1:107810] "1" "2" "3" "4" ...
..@ nrows : int 107810
..@ elementType : chr "ANY"
..@ elementMetadata: NULL
..@ metadata : list()
..@ listData :List of 10
.. ..$ Cell.ID : chr [1:107810] "1" "2" "3" "4" ...
.. ..$ Phenotype : chr [1:107810] "OTHER" "OTHER" "OTHER" "OTHER" ...
.. ..$ sample_id : chr [1:107810] "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" "sample01.009-01_BEF_ROI_1" ...
.. ..$ Location_Tag : chr [1:107810] "Outside" "Outside" "Outside" "Outside" ...
.. ..$ Sample_ID : Factor w/ 2 levels "BL","BEF": 2 2 2 2 2 2 2 2 2 2 ...
.. ..$ Patient_ID : chr [1:107810] "009-01" "009-01" "009-01" "009-01" ...
.. ..$ ROI_ID : chr [1:107810] "ROI_1" "ROI_1" "ROI_1" "ROI_1" ...
.. ..$ Response_after_IT : Factor w/ 2 levels "non-PR","PR": 1 1 1 1 1 1 1 1 1 1 ...
.. ..$ Response_after_RCT: Factor w/ 2 levels "non-CR","CR": 2 2 2 2 2 2 2 2 2 2 ...
.. ..$ Response_EOT : Factor w/ 2 levels "non-CR","CR": 2 2 2 2 2 2 2 2 2 2 ...
spicy <- spicy(all_RData_merged,
condition = "Sample_ID",
subject = "Patient_ID",
imageID = "ROI_ID",
cellType = "Phenotype",
spatialCoords = c("Cell.X.Position", "Cell.Y.Position"))
I obtain a SpicyResults object with the following "coefficient" slot:
spicy <- spicy(all_RData_merged,
condition = "Response_EOT",
subject = "Patient_ID",
imageID = "ROI_ID",
cellType = "Phenotype",
spatialCoords = c("Cell.X.Position", "Cell.Y.Position"))
the SpicyResults object contains this "coefficient" slot:
I really don't understand why this works in one case and not the other.
My session info are:
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.4
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.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
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/Paris
tzcode source: internal
attached base packages:
NULL
other attached packages:
[1] lubridate_1.9.4 forcats_1.0.1
[3] stringr_1.6.0 purrr_1.2.0
[5] readr_2.1.6 tidyr_1.3.1
[7] tibble_3.3.0 tidyverse_2.0.0
[9] readxl_1.4.5 survival_3.8-3
[11] dplyr_1.1.4 imcRtools_1.14.0
[13] SpatialDatasets_1.6.3 ExperimentHub_2.16.1
[15] AnnotationHub_3.16.1 BiocFileCache_2.16.2
[17] dbplyr_2.5.1 SpatialExperiment_1.18.1
[19] SingleCellExperiment_1.30.1 SummarizedExperiment_1.38.1
[21] Biobase_2.68.0 GenomicRanges_1.60.0
[23] GenomeInfoDb_1.44.3 IRanges_2.42.0
[25] S4Vectors_0.46.0 BiocGenerics_0.54.1
[27] generics_0.1.4 MatrixGenerics_1.20.0
[29] matrixStats_1.5.0 ggplot2_4.0.1
[31] spicyR_1.20.5
Thanks in advance for help on this