chris-mcginnis-ucsf/DoubletFinder

Error message with DoubleFinder:Error in RunPCA(seu_wdoublets, npcs = length(PCs)) : unused argument (npcs = length(PCs))

Opened this issue · 0 comments

Hello,

I want to use DoubleFinder for my scRNAseq dataset, but I've exhausted all the online resources to solve the issue with no success. Could you please advise on how to make it work?
Please let me know if you need additional information.

Thank you for your help.
Anita

Issue:

Code:
sweep.res.list <-paramSweep(sobj, PCs = 1:35, sct = TRUE)
DefaultAssay(sobj)
[1] "SCT"

produces the following error message
##Error Message:
Finished calculating residuals for counts
Set default assay to SCT
[1] "Running PCA..."
Error in RunPCA(seu_wdoublets, npcs = length(PCs)) :
unused argument (npcs = length(PCs))

Additional Information:
scRNAseq Dataset:
Version(sobj)
[1] ‘5.0.2’

Packages version:
DoubletFinder_2.0.4
Seurat_5.1.0

The following code was tailored to my dataset:
Pre-process Seurat object (sctransform)
seu_kidney <- CreateSeuratObject(kidney.data)
seu_kidney <- SCTransform(seu_kidney)
seu_kidney <- RunPCA(seu_kidney)
seu_kidney <- RunUMAP(seu_kidney, dims = 1:10)

pK Identification (no ground-truth)
sweep.res.list_kidney <- paramSweep(seu_kidney, PCs = 1:10, sct = FALSE)
sweep.stats_kidney <- summarizeSweep(sweep.res.list_kidney, GT = FALSE)
bcmvn_kidney <- find.pK(sweep.stats_kidney)

Additional interesting observation that I can only use "RunPCA" and "RunUMAP" if the package's name is indicated:
sobj <- Seurat::RunPCA(sobj,npcs = 40)
sobj <- Seurat::RunUMAP(fsobj, dims = 1:35)

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

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

other attached packages:
[1] DoubletFinder_2.0.4 sctransform_0.4.1 fields_15.2
[4] viridisLite_0.4.2 spam_2.10-0 patchwork_1.2.0
[7] gridExtra_2.3 clustree_0.5.1 ggraph_2.2.1
[10] cluster_2.1.6 tidyr_1.3.1.9000 scCATCH_3.2.2
[13] SeuratDisk_0.0.0.9021 loomR_0.2.1.9000 hdf5r_1.3.10
[16] R6_2.5.1 scCustomize_2.1.2 dplyr_1.1.4
[19] Matrix_1.7-0 scater_1.32.0 ggplot2_3.5.1
[22] scuttle_1.14.0 SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0
[25] Biobase_2.64.0 GenomicRanges_1.56.0 GenomeInfoDb_1.40.0
[28] IRanges_2.38.0 S4Vectors_0.42.0 BiocGenerics_0.50.0
[31] MatrixGenerics_1.16.0 matrixStats_1.3.0 data.table_1.15.4
[34] cowplot_1.1.3 ILoReg_1.14.0 Seurat_5.1.0
[37] SeuratObject_5.0.2 sp_2.1-4

loaded via a namespace (and not attached):
[1] progress_1.2.3 gld_2.6.6 urlchecker_1.0.1
[4] goftest_1.2-3 vctrs_0.6.5 LiblineaR_2.10-23
[7] spatstat.random_3.2-3 digest_0.6.35 png_0.1-8
[10] shape_1.4.6.1 proxy_0.4-27 Exact_3.2
[13] ggrepel_0.9.5 deldir_2.0-4 parallelly_1.37.1
[16] MASS_7.3-60.2 reshape2_1.4.4 httpuv_1.6.15
[19] foreach_1.5.2 withr_3.0.0 ggrastr_1.0.2
[22] xfun_0.44 ggfun_0.1.4 ellipsis_0.3.2
[25] survival_3.6-4 doRNG_1.8.6 memoise_2.0.1
[28] ggbeeswarm_0.7.2 janitor_2.2.0 profvis_0.3.8
[31] zoo_1.8-12 GlobalOptions_0.1.2 pbapply_1.7-2
[34] prettyunits_1.2.0 rematch2_2.1.2 promises_1.3.0
[37] httr_1.4.7 globals_0.16.3 fitdistrplus_1.1-11
[40] rstudioapi_0.16.0 UCSC.utils_1.0.0 miniUI_0.1.1.1
[43] generics_0.1.3 zlibbioc_1.50.0 ScaledMatrix_1.12.0
[46] polyclip_1.10-6 doSNOW_1.0.20 GenomeInfoDbData_1.2.12
[49] SparseArray_1.4.3 xtable_1.8-4 stringr_1.5.1
[52] evaluate_0.23 S4Arrays_1.4.0 hms_1.1.3
[55] irlba_2.3.5.1 colorspace_2.1-0 ROCR_1.0-11
[58] reticulate_1.36.1 readxl_1.4.3 spatstat.data_3.0-4
[61] magrittr_2.0.3 lmtest_0.9-40 snakecase_0.11.1
[64] glmGamPoi_1.16.0 later_1.3.2 viridis_0.6.5
[67] lattice_0.22-6 spatstat.geom_3.2-9 future.apply_1.11.2
[70] SparseM_1.81 scattermore_1.2 RcppAnnoy_0.0.22
[73] class_7.3-22 pillar_1.9.0 nlme_3.1-164
[76] iterators_1.0.14 compiler_4.4.0 beachmat_2.20.0
[79] RSpectra_0.16-1 stringi_1.8.4 DescTools_0.99.54
[82] tensor_1.5 dendextend_1.17.1 devtools_2.4.5
[85] lubridate_1.9.3 plyr_1.8.9 crayon_1.5.2
[88] abind_1.4-5 gridGraphics_0.5-1 locfit_1.5-9.9
[91] graphlayouts_1.1.1 bit_4.0.5 rootSolve_1.8.2.4
[94] fastcluster_1.2.6 codetools_0.2-20 BiocSingular_1.20.0
[97] openssl_2.2.0 e1071_1.7-14 lmom_3.0
[100] paletteer_1.6.0 plotly_4.10.4 mime_0.12
[103] splines_4.4.0 circlize_0.4.16 Rcpp_1.0.12
[106] fastDummies_1.7.3 sparseMatrixStats_1.16.0 cellranger_1.1.0
[109] knitr_1.46 utf8_1.2.4 fs_1.6.4
[112] listenv_0.9.1 checkmate_2.3.1 DelayedMatrixStats_1.26.0
[115] pkgbuild_1.4.4 expm_0.999-9 openxlsx_4.2.5.2
[118] ggplotify_0.1.2 tibble_3.2.1 statmod_1.5.0
[121] tweenr_2.0.3 pkgconfig_2.0.3 pheatmap_1.0.12
[124] tools_4.4.0 cachem_1.1.0 aricode_1.0.3
[127] fastmap_1.2.0 rmarkdown_2.27 scales_1.3.0
[130] grid_4.4.0 usethis_2.2.3 ica_1.0-3
[133] ggprism_1.0.5 BiocManager_1.30.23 dotCall64_1.1-1
[136] RANN_2.6.1 snow_0.4-4 farver_2.1.2
[139] tidygraph_1.3.1 yaml_2.3.8 cli_3.6.2
[142] purrr_1.0.2 leiden_0.4.3.1 lifecycle_1.0.4
[145] askpass_1.2.0 uwot_0.2.2 mvtnorm_1.2-4
[148] sessioninfo_1.2.2 backports_1.4.1 BiocParallel_1.38.0
[151] timechange_0.3.0 gtable_0.3.5 umap_0.2.10.0
[154] ggridges_0.5.6 progressr_0.14.0 limma_3.60.0
[157] jsonlite_1.8.8 edgeR_4.2.0 RcppHNSW_0.6.0
[160] bit64_4.0.5 Rtsne_0.17 yulab.utils_0.1.4
[163] spatstat.utils_3.0-4 BiocNeighbors_1.22.0 zip_2.3.1
[166] RcppParallel_5.1.7 lazyeval_0.2.2 shiny_1.8.1.1
[169] htmltools_0.5.8.1 glue_1.7.0 XVector_0.44.0
[172] boot_1.3-30 igraph_2.0.3 forcats_1.0.0
[175] labeling_0.4.3 rngtools_1.5.2 pkgload_1.3.4
[178] ArchR_1.0.2 aplot_0.2.2 DelayedArray_0.30.1
[181] tidyselect_1.2.1 vipor_0.4.7 maps_3.4.2
[184] ggforce_0.4.2 future_1.33.2 rsvd_1.0.5
[187] munsell_0.5.1 KernSmooth_2.23-24 htmlwidgets_1.6.4
[190] RColorBrewer_1.1-3 rlang_1.1.3 spatstat.sparse_3.0-3
[193] spatstat.explore_3.2-7 remotes_2.5.0 fansi_1.0.6
[196] parallelDist_0.2.6 beeswarm_0.4.0