Repository navigation
subscript out of bounds error in addIterativeLSI on Ubuntu but works on Windows #2319
Description
Hello,
I'm encountering an error when running addIterativeLSI on Ubuntu, while the same code works successfully on Windows with my own data. The tutorial data works fine on both systems.
Working Code (Tutorial Data):
rlibrary(ArchR)
library(parallel)
inputFiles <- c("HemeFragments/scATAC_BMMC_R1.fragments.tsv.gz",
"HemeFragments/scATAC_CD34_BMMC_R1.fragments.tsv.gz",
"HemeFragments/scATAC_PBMC_R1.fragments.tsv.gz")
names(inputFiles) <- c("scATAC_BMMC_R1","scATAC_CD34_BMMC_R1","scATAC_PBMC_R1")
addArchRGenome("hg19")
addArchRThreads(threads = 1)
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles,
sampleNames = names(inputFiles),
minTSS = 4,
minFrags = 1000,
addTileMat = TRUE,
addGeneScoreMat = TRUE
)
projHeme1 <- ArchRProject(
ArrowFiles = ArrowFiles,
outputDirectory = "HemeTutorial",
copyArrows = TRUE
)
This works fine
projHeme1 <- addIterativeLSI(
ArchRProj = projHeme1,
useMatrix = "TileMatrix",
name = "IterativeLSI",
iterations = 2,
clusterParams = list(
resolution = c(0.2),
sampleCells = 10000,
n.start = 10
),
varFeatures = 25000,
dimsToUse = 1:30
)
Failing Code (
My Data - Sus scrofa genome):
rlibrary(ArchR)
library(TxDb.Sscrofa.UCSC.susScr11.refGene)
library(BSgenome.Sscrofa.UCSC.susScr11)
library(org.Ss.eg.db)
library(GenomicFeatures)
addArchRLocking(locking = TRUE)
geneAnnotation <- createGeneAnnotation(
TxDb = TxDb.Sscrofa.UCSC.susScr11.refGene,
OrgDb = org.Ss.eg.db
)
genomeAnnotation <- createGenomeAnnotation(genome = BSgenome.Sscrofa.UCSC.susScr11)
inputFiles <- c("/public/home/szzx/dengsx/0_project/brain_singlecell/bash/scATACseq/dnbc4tools_result/LW2_HM_scATACseq/output/fragments.tsv.gz")
names(inputFiles) <- c("LW2_HM")
addArchRThreads(threads = 1)
ArrowFiles <- createArrowFiles(
inputFiles = inputFiles,
sampleNames = names(inputFiles),
geneAnnotation = geneAnnotation,
genomeAnnotation = genomeAnnotation,
minTSS = 4,
minFrags = 1000,
addTileMat = TRUE,
addGeneScoreMat = TRUE
)
projHeme1 <- ArchRProject(
ArrowFiles = ArrowFiles,
outputDirectory = "ArchR_LW2_HM",
copyArrows = TRUE,
geneAnnotation = geneAnnotation,
genomeAnnotation = genomeAnnotation
)
projHeme1 <- saveArchRProject(ArchRProj = projHeme1, outputDirectory = "Save-ProjHeme1", load = TRUE)
projHeme1 <- loadArchRProject(path = "./Save-ProjHeme1")
addArchRLocking(locking = TRUE)
This fails on Ubuntu but works on Windows
projHeme1 <- addIterativeLSI(
ArchRProj = projHeme1,
useMatrix = "TileMatrix",
name = "IterativeLSI",
iterations = 2,
clusterParams = list(
resolution = c(0.2),
sampleCells = 10000,
n.start = 10
),
varFeatures = 25000,
dimsToUse = 1:30
)
**Project Summary Before Error:**
class: ArchRProject
outputDirectory: /public/home/szzx/dengsx/0_project/brain_singlecell/bash/ArchR/test2/ArchR_LW2_HM
samples(1): LW2_HM
sampleColData names(1): ArrowFiles
cellColData names(11): Sample TSSEnrichment ... nFrags nDiFrags
numberOfCells(1): 19440
medianTSS(1): 6.04
medianFrags(1): 11516
**Error Message:**
2026-01-06 11:42:53.285473 : ERROR Found in .computeLSI for
LogFile = ArchRLogs/ArchR-addIterativeLSI-f9c674756b3d-Date-2026-01-06_Time-11-42-07.285761.log
<subscriptOutOfBoundsError in allLSI[cn, , drop = FALSE]: subscript out of bounds>
2026-01-06 11:42:53.295232 : ERROR Found in .LSIPartialMatrix for
LogFile = ArchRLogs/ArchR-addIterativeLSI-f9c674756b3d-Date-2026-01-06_Time-11-42-07.285761.log
<simpleError in .logError(e, fn = ".computeLSI", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above>
**Observations:**
1. The tutorial data (human hg19 genome) works perfectly on Ubuntu
2. My own data (pig susScr11 genome) fails on Ubuntu but works on Windows
3. The error occurs in the `.computeLSI` function with "subscript out of bounds"
4. Arrow file creation succeeds without issues
5. The project has 19,440 cells after filtering (original: 2,309,467 cells)
Any help would be greatly appreciated!
Activity
immanuelazn commentedon Jan 6, 2026
Hi @shaoxiong2588! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
If you are getting an error, it is likely due to something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help.
Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for.
If your post does not contain a reproducible example, it is unlikely to receive a response.
In addition to a reproducible example, you must do the following things before we help you, unless your original post already contained this information:
1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved?
2. Did you post your log file? If not, add it now.
3. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.
shaoxiong2588 commentedon Jan 6, 2026
log file :
Logging With ArchR!
Start Time : 2026-01-06 11:41:29.209963
------- ArchR Info
ArchRThreads = 1
------- System Info
Computer OS = unix
------- Session Info
R version 4.4.3 (2025-02-28)
Platform: x86_64-conda-linux-gnu
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /public/home/szzx/dengsx/miniconda3/envs/singlecell_seurat_V5/lib/libopenblasp-r0.3.30.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Asia/Shanghai
tzcode source: system (glibc)
attached base packages:
[1] stats4 grid stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] org.Ss.eg.db_3.20.0
[2] BSgenome.Sscrofa.UCSC.susScr11_1.4.2
[3] BSgenome_1.74.0
[4] rtracklayer_1.66.0
[5] BiocIO_1.16.0
[6] Biostrings_2.74.0
[7] XVector_0.46.0
[8] TxDb.Sscrofa.UCSC.susScr11.refGene_3.12.0
[9] GenomicFeatures_1.58.0
[10] AnnotationDbi_1.68.0
[11] rhdf5_2.50.0
[12] SummarizedExperiment_1.36.0
[13] Biobase_2.66.0
[14] RcppArmadillo_14.6.3-1
[15] Rcpp_1.1.0
[16] Matrix_1.7-3
[17] GenomicRanges_1.58.0
[18] GenomeInfoDb_1.42.0
[19] IRanges_2.40.0
[20] S4Vectors_0.44.0
[21] BiocGenerics_0.52.0
[22] sparseMatrixStats_1.18.0
[23] MatrixGenerics_1.18.0
[24] matrixStats_1.5.0
[25] data.table_1.17.8
[26] stringr_1.5.1
[27] plyr_1.8.9
[28] magrittr_2.0.3
[29] ggplot2_3.5.2
[30] gtable_0.3.6
[31] gtools_3.9.5
[32] gridExtra_2.3
[33] devtools_2.4.6
[34] usethis_3.2.1
[35] ArchR_1.0.3
loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 dplyr_1.1.4 farver_2.1.2
[4] blob_1.2.4 bitops_1.0-9 fastmap_1.2.0
[7] RCurl_1.98-1.17 GenomicAlignments_1.42.0 XML_3.99-0.17
[10] lifecycle_1.0.4 ellipsis_0.3.2 KEGGREST_1.46.0
[13] RSQLite_2.4.3 compiler_4.4.3 rlang_1.1.6
[16] tools_4.4.3 yaml_2.3.10 S4Arrays_1.6.0
[19] bit_4.6.0 pkgbuild_1.4.8 curl_7.0.0
[22] DelayedArray_0.32.0 RColorBrewer_1.1-3 BiocParallel_1.40.0
[25] pkgload_1.4.1 abind_1.4-5 withr_3.0.2
[28] purrr_1.1.0 Rhdf5lib_1.28.0 scales_1.4.0
[31] cli_3.6.5 crayon_1.5.3 generics_0.1.4
[34] remotes_2.5.0 httr_1.4.7 rjson_0.2.23
[37] sessioninfo_1.2.3 DBI_1.2.3 cachem_1.1.0
[40] zlibbioc_1.52.0 parallel_4.4.3 restfulr_0.0.16
[43] vctrs_0.6.5 jsonlite_2.0.0 bit64_4.6.0-1
[46] glue_1.8.0 codetools_0.2-20 stringi_1.8.7
[49] UCSC.utils_1.2.0 tibble_3.3.0 pillar_1.11.0
[52] rhdf5filters_1.18.0 GenomeInfoDbData_1.2.13 R6_2.6.1
[55] lattice_0.22-7 png_0.1-8 Rsamtools_2.22.0
[58] memoise_2.0.1 SparseArray_1.6.0 fs_1.6.6
[61] pkgconfig_2.0.3
------- Log Info
2026-01-06 11:41:29.339884 : createArrowFiles Input-Parameters, Class = list
createArrowFiles Input-Parameters$inputFiles: length = 1
LW2_HM
"/public/home/szzx/dengsx/0_project/brain_singlecell/bash/scATACseq/dnbc4tools_result/LW2_HM_scATACseq/output/fragments.tsv.gz"
createArrowFiles Input-Parameters$sampleNames: length = 1
[1] "LW2_HM"
createArrowFiles Input-Parameters$outputNames: length = 1
[1] "LW2_HM"
createArrowFiles Input-Parameters$validBarcodes: length = 0
NULL
createArrowFiles Input-Parameters$minTSS: length = 1
[1] 4
createArrowFiles Input-Parameters$minFrags: length = 1
[1] 1000
createArrowFiles Input-Parameters$maxFrags: length = 1
[1] 1e+05
createArrowFiles Input-Parameters$minFragSize: length = 1
[1] 10
createArrowFiles Input-Parameters$maxFragSize: length = 1
[1] 2000
createArrowFiles Input-Parameters$QCDir: length = 1
[1] "QualityControl"
createArrowFiles Input-Parameters$nucLength: length = 1
[1] 147
createArrowFiles Input-Parameters$promoterRegion: length = 2
[1] 2000 100
createArrowFiles Input-Parameters$excludeChr: length = 2
[1] "chrM" "chrY"
createArrowFiles Input-Parameters$nChunk: length = 1
[1] 5
createArrowFiles Input-Parameters$bcTag: length = 1
[1] "qname"
createArrowFiles Input-Parameters$gsubExpression: length = 0
NULL
createArrowFiles Input-Parameters$bamFlag: length = 0
NULL
createArrowFiles Input-Parameters$offsetPlus: length = 1
[1] 4
createArrowFiles Input-Parameters$offsetMinus: length = 1
[1] -5
createArrowFiles Input-Parameters$addTileMat: length = 1
[1] TRUE
createArrowFiles Input-Parameters$addGeneScoreMat: length = 1
[1] TRUE
createArrowFiles Input-Parameters$force: length = 1
[1] FALSE
createArrowFiles Input-Parameters$threads: length = 1
[1] 1
createArrowFiles Input-Parameters$parallelParam: length = 0
NULL
createArrowFiles Input-Parameters$subThreading: length = 1
[1] TRUE
createArrowFiles Input-Parameters$verbose: length = 1
[1] TRUE
createArrowFiles Input-Parameters$cleanTmp: length = 1
[1] TRUE
createArrowFiles Input-Parameters$logFile: length = 1
[1] "ArchRLogs/ArchR-createArrows-f9c664e69185-Date-2026-01-06_Time-11-41-29.177131.log"
createArrowFiles Input-Parameters$filterFrags: length = 1
[1] 1000
createArrowFiles Input-Parameters$filterTSS: length = 1
[1] 4
2026-01-06 11:41:29.352916 : Cleaning Temporary Files
2026-01-06 11:41:29.358418 : Batch Execution w/ safelapply!, 0 mins elapsed.
###########
2026-01-06 11:41:29.359044 : Creating Arrow File LW2_HM.arrow (LW2_HM : 1 of 1)
###########
2026-01-06 11:41:29.359328 : validBC, Class = NULL
validBC: length = 0
NULL
2026-01-06 11:41:29.380175 : (LW2_HM : 1 of 1) Checking if completed file exists!
2026-01-06 11:41:29.393424 : (LW2_HM : 1 of 1) Arrow Exists! Marking as completed since force = FALSE!, 0.001 mins elapsed.
------- Completed
End Time : 2026-01-06 11:41:29.395957
Elapsed Time Minutes = 0.00309103727340698
Elapsed Time Hours = 5.16141123241848e-05
class: ArchRProject
outputDirectory: /public/home/szzx/dengsx/0_project/brain_singlecell/bash/ArchR/test2/ArchR_LW2_HM
samples(1): LW2_HM
sampleColData names(1): ArrowFiles
cellColData names(11): Sample TSSEnrichment ... nFrags nDiFrags
numberOfCells(1): 2309467
medianTSS(1): 0
medianFrags(1): 92
class: ArchRProject
outputDirectory: /public/home/szzx/dengsx/0_project/brain_singlecell/bash/ArchR/test2/ArchR_LW2_HM
samples(1): LW2_HM
sampleColData names(1): ArrowFiles
cellColData names(11): Sample TSSEnrichment ... nFrags nDiFrags
numberOfCells(1): 19440
medianTSS(1): 6.04
medianFrags(1): 11516
[1] "LW2_HM" "LW2_HM" "LW2_HM" "LW2_HM" "LW2_HM" "LW2_HM"
DataFrame with 2309467 rows and 2 columns
bioNames bioNames2
LW2_HM#CELL48429_N1 LW2_HM LW2_HM
LW2_HM#CELL64567_N1 LW2_HM LW2_HM
LW2_HM#CELL11265_N2 LW2_HM LW2_HM
LW2_HM#CELL9353_N2 LW2_HM LW2_HM
LW2_HM#CELL15039_N5 LW2_HM LW2_HM
... ... ...
LW2_HM#CELL2308851_N1 LW2_HM NA
LW2_HM#CELL2308897_N1 LW2_HM NA
LW2_HM#CELL2308979_N1 LW2_HM NA
LW2_HM#CELL2309006_N1 LW2_HM NA
LW2_HM#CELL2309017_N1 LW2_HM NA
[1] "ArrowFiles" "IterativeLSI" "Save-ArchR-Project.rds"
2026-01-06 11:42:53.285473 : ERROR Found in .computeLSI for
LogFile = ArchRLogs/ArchR-addIterativeLSI-f9c674756b3d-Date-2026-01-06_Time-11-42-07.285761.log
<subscriptOutOfBoundsError in allLSI[cn, , drop = FALSE]: subscript out of bounds>
2026-01-06 11:42:53.295232 : ERROR Found in .LSIPartialMatrix for
LogFile = ArchRLogs/ArchR-addIterativeLSI-f9c674756b3d-Date-2026-01-06_Time-11-42-07.285761.log
<simpleError in .logError(e, fn = ".computeLSI", info = "", errorList = errorList, logFile = logFile): Exiting See Error Above>