Closed elisulvaran closed 1 year ago
Can you check if you still have this issue when using the seurat5 branch version (https://github.com/stuart-lab/signac/tree/seurat5)? This branch is needed for Seurat v5
Unfortunately no. Here's my session info:
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.4.2 Signac_1.10.0 Seurat_4.9.9.9049
[4] SeuratObject_4.9.9.9085 sp_2.0-0
loaded via a namespace (and not attached):
[1] spam_2.9-1 fastmatch_1.1-3 plyr_1.8.8 igraph_1.5.0
[5] lazyeval_0.2.2 splines_4.2.1 RcppHNSW_0.4.1 BiocParallel_1.32.6
[9] listenv_0.9.0 scattermore_1.2 GenomeInfoDb_1.34.9 digest_0.6.32
[13] htmltools_0.5.5 fansi_1.0.4 magrittr_2.0.3 tensor_1.5
[17] cluster_2.1.4 ROCR_1.0-11 remotes_2.4.2 globals_0.16.2
[21] Biostrings_2.66.0 matrixStats_1.0.0 spatstat.sparse_3.0-2 prettyunits_1.1.1
[25] colorspace_2.1-0 ggrepel_0.9.3 xfun_0.39 dplyr_1.1.2
[29] callr_3.7.3 crayon_1.5.2 RCurl_1.98-1.12 jsonlite_1.8.5
[33] progressr_0.13.0 spatstat.data_3.0-1 survival_3.5-5 zoo_1.8-12
[37] glue_1.6.2 polyclip_1.10-4 gtable_0.3.3 zlibbioc_1.44.0
[41] XVector_0.38.0 leiden_0.4.3 pkgbuild_1.4.0 future.apply_1.11.0
[45] BiocGenerics_0.44.0 abind_1.4-5 scales_1.2.1 spatstat.random_3.1-5
[49] miniUI_0.1.1.1 Rcpp_1.0.10 viridisLite_0.4.2 xtable_1.8-4
[53] reticulate_1.30 dotCall64_1.0-2 stats4_4.2.1 htmlwidgets_1.6.2
[57] httr_1.4.6 RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3
[61] farver_2.1.1 pkgconfig_2.0.3 uwot_0.1.15 deldir_1.0-9
[65] utf8_1.2.3 labeling_0.4.2 tidyselect_1.2.0 rlang_1.1.1
[69] reshape2_1.4.4 later_1.3.1 munsell_0.5.0 tools_4.2.1
[73] cli_3.6.1 generics_0.1.3 ggridges_0.5.4 stringr_1.5.0
[77] fastmap_1.1.1 goftest_1.2-3 processx_3.8.1 knitr_1.43
[81] fitdistrplus_1.1-11 purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0
[85] future_1.32.0 nlme_3.1-162 mime_0.12 RcppRoll_0.3.0
[89] compiler_4.2.1 rstudioapi_0.14 plotly_4.10.2 curl_5.0.1
[93] png_0.1-8 spatstat.utils_3.0-3 tibble_3.2.1 stringi_1.7.12
[97] ps_1.7.5 desc_1.4.2 RSpectra_0.16-1 lattice_0.21-8
[101] Matrix_1.5-4.1 vctrs_0.6.3 pillar_1.9.0 lifecycle_1.0.3
[105] spatstat.geom_3.2-1 lmtest_0.9-40 RcppAnnoy_0.0.20 data.table_1.14.8
[109] cowplot_1.1.1 bitops_1.0-7 irlba_2.3.5.1 httpuv_1.6.11
[113] patchwork_1.1.2 GenomicRanges_1.50.2 R6_2.5.1 promises_1.2.0.1
[117] KernSmooth_2.23-21 gridExtra_2.3 IRanges_2.32.0 parallelly_1.36.0
[121] codetools_0.2-19 fastDummies_1.6.3 MASS_7.3-60 rprojroot_2.0.3
[125] withr_2.5.0 sctransform_0.3.5 Rsamtools_2.14.0 S4Vectors_0.36.2
[129] GenomeInfoDbData_1.2.9 parallel_4.2.1 grid_4.2.1 tidyr_1.3.0
[133] Rtsne_0.16 spatstat.explore_3.2-1 shiny_1.7.4
This session info still says that you have Signac 1.10.0 installed, please install from the seurat5 branch and try again
Hi! So I ran the code on the page you linked and I'm getting the following message:
> if (!requireNamespace("remotes", quietly = TRUE))
install.packages("remotes")
> remotes::install_github("stuart-lab/signac", ref = "develop")
Skipping install of 'Signac' from a github remote, the SHA1 (2ad6c3c9) has not changed since last install.
Use `force = TRUE` to force installation
I used force = TRUE
and the package downloaded, but when I import it it's still the same version. How could I work around it in that case?
Thanks!
To install the seurat5 branch you need to run:
remotes::install_github("stuart-lab/signac", ref = "seurat5")
Hello! Unfortunately, that didn't solve it either. However, I'm not sure if Signac was properly updated, because after running the line you provided, it looks like now I have version 1.9.0.9000. I ran it multiple times and I also tried uninstalling it and re installing it and that was the version that was in all cases. Here's my session info:
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.4.2 Signac_1.9.0.9000 Seurat_4.9.9.9049
[4] SeuratObject_4.9.9.9085 sp_2.0-0 edgeR_3.40.2
[7] limma_3.54.2
loaded via a namespace (and not attached):
[1] rappdirs_0.3.3 scattermore_1.2 tidyr_1.3.0
[4] bit64_4.0.5 knitr_1.43 irlba_2.3.5.1
[7] DelayedArray_0.24.0 data.table_1.14.8 KEGGREST_1.38.0
[10] RCurl_1.98-1.12 doParallel_1.0.17 generics_0.1.3
[13] BiocGenerics_0.44.0 ScaledMatrix_1.6.0 cowplot_1.1.1
[16] RSQLite_2.3.1 RANN_2.6.1 future_1.32.0
[19] bit_4.0.5 tzdb_0.4.0 spatstat.data_3.0-1
[22] xml2_1.3.4 httpuv_1.6.11 SummarizedExperiment_1.28.0
[25] xfun_0.39 celldex_1.8.0 hms_1.1.3
[28] evaluate_0.21 promises_1.2.0.1 fansi_1.0.4
[31] progress_1.2.2 dbplyr_2.3.2 readxl_1.4.2
[34] igraph_1.5.0 DBI_1.1.3 htmlwidgets_1.6.2
[37] spatstat.geom_3.2-1 stats4_4.2.1 purrr_1.0.1
[40] ellipsis_0.3.2 RSpectra_0.16-1 dplyr_1.1.2
[43] backports_1.4.1 deldir_1.0-9 sparseMatrixStats_1.10.0
[46] MatrixGenerics_1.10.0 vctrs_0.6.3 SingleCellExperiment_1.20.1
[49] Biobase_2.58.0 ROCR_1.0-11 abind_1.4-5
[52] cachem_1.0.8 withr_2.5.0 progressr_0.13.0
[55] checkmate_2.2.0 sctransform_0.3.5 prettyunits_1.1.1
[58] scran_1.26.2 goftest_1.2-3 cluster_2.1.4
[61] ExperimentHub_2.6.0 dir.expiry_1.6.0 dotCall64_1.0-2
[64] lazyeval_0.2.2 crayon_1.5.2 basilisk.utils_1.11.1
[67] spatstat.explore_3.2-1 pkgconfig_2.0.3 GenomeInfoDb_1.34.9
[70] nlme_3.1-162 rlang_1.1.1 globals_0.16.2
[73] lifecycle_1.0.3 miniUI_0.1.1.1 filelock_1.0.2
[76] fastDummies_1.6.3 BiocFileCache_2.6.1 rsvd_1.0.5
[79] AnnotationHub_3.6.0 cellranger_1.1.0 polyclip_1.10-4
[82] RcppHNSW_0.4.1 matrixStats_1.0.0 lmtest_0.9-40
[85] Matrix_1.5-4.1 zoo_1.8-12 ggridges_0.5.4
[88] GlobalOptions_0.1.2 png_0.1-8 viridisLite_0.4.2
[91] rjson_0.2.21 bitops_1.0-7 KernSmooth_2.23-21
[94] spam_2.9-1 Biostrings_2.66.0 blob_1.2.4
[97] DelayedMatrixStats_1.20.0 shape_1.4.6 stringr_1.5.0
[100] parallelly_1.36.0 spatstat.random_3.1-5 readr_2.1.4
[103] S4Vectors_0.36.2 beachmat_2.14.2 scales_1.2.1
[106] memoise_2.0.1 magrittr_2.0.3 plyr_1.8.8
[109] ica_1.0-3 zlibbioc_1.44.0 compiler_4.2.1
[112] dqrng_0.3.0 RColorBrewer_1.1-3 clue_0.3-64
[115] fitdistrplus_1.1-11 Rsamtools_2.14.0 cli_3.6.1
[118] XVector_0.38.0 listenv_0.9.0 patchwork_1.1.2
[121] pbapply_1.7-0 MASS_7.3-60 tidyselect_1.2.0
[124] liana_0.1.9 stringi_1.7.12 yaml_2.3.7
[127] BiocSingular_1.14.0 locfit_1.5-9.7 ggrepel_0.9.3
[130] grid_4.2.1 fastmatch_1.1-3 tools_4.2.1
[133] future.apply_1.11.0 parallel_4.2.1 circlize_0.4.15
[136] rstudioapi_0.14 bluster_1.8.0 foreach_1.5.2
[139] metapod_1.6.0 gridExtra_2.3 Rtsne_0.16
[142] digest_0.6.32 BiocManager_1.30.20 shiny_1.7.4
[145] Rcpp_1.0.10 GenomicRanges_1.50.2 scuttle_1.8.4
[148] BiocVersion_3.16.0 later_1.3.1 RcppAnnoy_0.0.20
[151] httr_1.4.6 AnnotationDbi_1.60.2 ComplexHeatmap_2.14.0
[154] colorspace_2.1-0 rvest_1.0.3 tensor_1.5
[157] reticulate_1.30 IRanges_2.32.0 splines_4.2.1
[160] uwot_0.1.15 RcppRoll_0.3.0 statmod_1.5.0
[163] OmnipathR_3.7.0 spatstat.utils_3.0-3 basilisk_1.11.2
[166] plotly_4.10.2 xtable_1.8-4 jsonlite_1.8.5
[169] R6_2.5.1 pillar_1.9.0 htmltools_0.5.5
[172] mime_0.12 glue_1.6.2 fastmap_1.1.1
[175] BiocParallel_1.32.6 BiocNeighbors_1.16.0 interactiveDisplayBase_1.36.0
[178] codetools_0.2-19 utf8_1.2.3 lattice_0.21-8
[181] spatstat.sparse_3.0-2 tibble_3.2.1 logger_0.2.2
[184] curl_5.0.1 leiden_0.4.3 survival_3.5-5
[187] rmarkdown_2.22 munsell_0.5.0 GetoptLong_1.0.5
[190] GenomeInfoDbData_1.2.9 iterators_1.0.14 reshape2_1.4.4
[193] gtable_0.3.3
Ok this message sh: /my/path/to/macs2: is a directory
suggests that the path you're supplying for macs2 is not correct, it's pointing to a directory rather than the macs2 program itself. If you run which macs2
in your terminal you can copy the path that it gives you and that should work (alternatively, if macs2 is in your path you should be able to leave the macs2.path
parameter empty in the CallPeaks()
function). I think the issue is it doesn't find macs2, and so no outputs are created.
Hi,
So that seems to have solved the initial problem, and now it does run longer, but then at some point I keep getting this output (attaching screenshot) and my RStudio simply stops responding. Do you know why this is happening?
Thank you!!
I have not seen that before, could you show the error message?
There's no error message, or at least not that I can see. Once those characters start popping up R pretty much freezes and I can't scroll through the output anymore
Can you verify that you can run macs2 on these files outside of R (on the command line) without error?
Yes, I can. I just ran it for one of my samples, and I got the outputs _model.R, _peaks.narrowPeaks, _peaks.xls, and _summits.bed.
How many cells in each group that you're grouping by?
I have the following:
Macrophages 1902
DC 492
B_cell 16583
CD8+ T-cells 1842
Monocytes 160
Fibroblasts 314
NK cells 82
Smooth muscle 225
Chondrocytes 266
Endothelial cells 263
CD4+ T-cells 3731
Adipocytes 62
However, this is from my filtered dataset after applying QC metrics in Seurat.
I'm not sure what the issue is here. You could try running one the whole dataset rather than splitting by cell type to see if it is somehow related to running per-celltype.
I was getting the (title) error a lot and had no idea what the issue was or how to debug it. After looking through peaks.R I realised that it was a general MACS2 error and had nothing to do with Signac, and that it was indeed telling me that my files were not where they said they were.
To debug this yourself, future reader:
myseurobj[["ATAC"]]$fragments
## it might give you a list, but I'm just going to check the first
myseurobj[["ATAC"]]$fragments[[1]]@path
## This shows you the file path of where the ATAC fragments are.
file.exists(myseurobj[["ATAC"]]$fragments[[1]]@path) ## Should be TRUE
If you have moved the ATAC fragments to somewhere else, then, dear reader, you need to update this in your Seurat object:
myseurobj[["ATAC"]]$fragments[[1]]@path <- "/my/new/path/to/ATAC_fragments.tsv.gz"
## And then re-run CallPeaks
EDIT: See @timoast's comment below about a native UpdatePath
function!
Note, the above example merely edits one path for one fragment. If all your fragment files have been moved to a different location, then you need to loop through your fragments and update the paths.
I've included a small script which does just this:
fixMyPaths_please <- function(seuratobj, oldpath, newpath){
frags <- seuratobj[["ATAC"]]$fragments
for (i in seq_along(frags)){
fpath <- frags[[i]]@path
if (file.exists(fpath)){
message(i, " - ", fpath, " - exists, not changing")
} else {
message(i, " - ", fpath, " - DOES NOT exist, changing")
new_fpath <- sub(oldpath, newpath, fpath)
if (file.exists(new_fpath)){
seuratobj[["ATAC"]]$fragments[[i]]@path <- new_fpath
message(i, " - changed to valid path: ", new_fpath)
} else {
message(paste0(i, " - INVALID new path: ", new_fpath))
stop("Check your paths")
}
}
}
return(seuratobj)
}
## Assume I moved my fragments from "/home/mtekman/analysis" to "/opt/backup/2023/analysis"
myseurat <- fixMyPaths_please(myseurat, "/home/mtekman", "/opt/backup/2023")
@mtekman we have a function for this, UpdatePath: https://stuartlab.org/signac/reference/updatepath
Oh lmao, I wish I knew about that sooner! Leaving my comment as is just in case it helps someone.
Edit: Does UpdatePath work for multiple fragment files in an object?
It operates on one fragment object at a time, but see here for an example of how to update for many fragment files: https://stuartlab.org/signac/articles/data_structures#changing-the-fragment-file-path-in-an-existing-fragment-object
Hi,
Firstly, thanks for creating this incredibly useful tool. I've been having some issues while trying to run CallPeaks on my object. I followed some of the suggestions in other issues (#473, #560, #648, #676, #1376, etc), but I haven't been able to solve it. I am running this in a MacBook in RStudio. I already confirmed I have permissions to my output directory (I ran
chmod +rw output
to make sure), and I also confirmed I can run macs2 outside of R.This is how my object looks like:
And here's my code:
When I run the CallPeaks function, it runs well for the first steps, but then the following error comes up:
Making sure the directory exists:
Attaching session info:
Help on this matter would be greatly appreciated! Thanks!