Repository navigation
[BUG] Error in the simulation outlier step #11
Copy link
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
Minimal reproducible example
library(SelectSim)
> str(m_selectsim)
List of 4
$ M :List of 2
..$ Nonsense: num [1:15236, 1:884] 0 0 0 0 0 0 0 0 0 0 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:15236] "A1BG" "A1CF" "A2M" "A2ML1" ...
.. .. ..$ : chr [1:884] "0BM059818SC002" "0BM065793SC002" "0BM073778SC001" "10" ...
..$ Missense: num [1:15236, 1:884] 0 0 0 0 0 0 0 0 0 0 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:15236] "A1BG" "A1CF" "A2M" "A2ML1" ...
.. .. ..$ : chr [1:884] "0BM059818SC002" "0BM065793SC002" "0BM073778SC001" "10" ...
$ tmb :List of 2
..$ Nonsense:'data.frame': 775 obs. of 2 variables:
.. ..$ sample : Factor w/ 884 levels "0BM059818SC002",..: 1 2 3 6 8 9 11 13 14 15 ...
.. ..$ mutation: int [1:775] 13 2 2 1 5 1 2 10 9 2 ...
..$ Missense:'data.frame': 75 obs. of 2 variables:
.. ..$ sample : Factor w/ 884 levels "0BM059818SC002",..: 10 14 63 64 66 70 74 81 82 90 ...
.. ..$ mutation: int [1:75] 1 1 1 2 2 1 1 1 1 1 ...
$ sample.class : Factor w/ 2 levels "BM","PCT": 1 1 1 1 1 1 1 1 1 1 ...
..- attr(*, "names")= chr [1:884] "0BM059818SC002" "0BM065793SC002" "0BM073778SC001" "10" ...
$ alteration.class: Named chr [1:15236] "mut" "mut" "mut" "mut" ...
..- attr(*, "names")= chr [1:15236] "PALMD" "FRRS1" "AGL" "HIAT1" ...
> aux <- SelectSim::selectX(
+ M = m_selectsim, min.freq = 2,
+ sample.class = m_selectsim$sample.class,
+ alteration.class = m_selectsim$alteration.class)
[1] "#### Creating SelectSim object ####"
[1] "Step1-> Parsing and Filtering GAM..."
[1] "Number of features: 15236"
[1] "Number of features after filtering: 190"
[1] "-> Alteration Landscape object created"
[1] "Step2-> Generating Template object..."
[1] "-> Template object created"
[1] "Step3-> Generating sample weight matrix..."
[1] "-> Weight Matrix created"
[1] "Step4-> Generating null model..."
[1] "-> Removing the outliers matrix from null model..."
Error in snMut[, i] <- colSums(obj$null[[i]]) :
replacement has length zero
In addition:
Warning messages:
1: In al$tmb[["total"]] + am$tmb[[i]][, c("mutation")] :
longer object length is not a multiple of shorter object length
2: In al$tmb[["total"]] + am$tmb[[i]][, c("mutation")] :
longer object length is not a multiple of shorter object lengthEnvironment
- SelectSim version: 0.1.6
- R version: 4.5.3 (2026-03-11)
- OS: macOS Tahoe 26.6.2
- Installation method:
devtools::install_github("CSOgroup/SelectSim")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
[-][BUG][/-][+][BUG] Error in the simulation outlier step[/+]Arvindiyer commentedon Sep 1, 2026
@jgarces02
I'm happy to help 👍🏽. Thanks again for the clear write-up; it made this a quick diagnosis.
Arvindiyer commentedon Sep 1, 2026
TODO (tracking checklist to close it)
jgarces02 commentedon Sep 1, 2026
Nice. All checked the factor type in all tables except in that variable 😓. Now it works perfectly.
And good catch with the different sizes, I didn't pay too much attention while the error was happening.
Thanks a lot for your help, @Arvindiyer!
(I won't close it as I see you're still doing things in regard this issue)
Arvindiyer commentedon Sep 1, 2026
@jgarces02 Thanks again for bringing this to my attention. I’ll work on it and fix the bug. Glad to hear the suggested workaround worked well 👍🏽😊
No need to close the issue on your end—I’ll take care of that once the fix is in. And if anything else comes up, feel free to open another issue anytime. Happy to help!
Fix crash from factor sample.class and sparse tmb tables (#11)