stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
327 stars 88 forks source link

The chromassay bug for sep parameter #1037

Closed honghh2018 closed 2 years ago

honghh2018 commented 2 years ago

Hi @timoast , There was a bug in CreateChromatinAssay function, the sep parameter can not be using when setting with c(":","-")

The chrom coordination still showing format like chr1-2222-3333, not turn into the chr1:2222-3333.

That would be occurred a error in motif analysis.

add motif information

pbmc1 <- AddMotifs(

  • object = pbmc1,
  • genome = BSgenome.Hsapiens.UCSC.hg19,
  • pfm = pfm
  • ) Building motif matrix Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'matchMotifs' for signature '"PWMatrixList", "Assay"'

The code lying below:

p1<-Read10X_h5('./merge2/outs/filtered_peak_bc_matrix.h5')

metadata <- read.csv( file = "./merge2/outs/singlecell.csv", header = TRUE, row.names = 1 ) head(metadata[1:10,1:10]) rownames(p1)<-gsub(":","-",rownames(p1))

chromassay <- CreateChromatinAssay( counts = p1, genome = 'hg19', fragments = './merge2/outs/fragments.tsv.gz', min.cells = 10, min.features = 200, sep = c(":","-") ) R.version
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 0.2
year 2020
month 06
day 22
svn rev 78730
language R
version.string R version 4.0.2 (2020-06-22) nickname Taking Off Again

sessionInfo() R version 4.0.2 (2020-06-22) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS: /share/nas1/Data/software/R/R-4.0.2/lib64/R/lib/libRblas.so LAPACK: /share/nas1/Data/software/R/R-4.0.2/lib64/R/lib/libRlapack.so

locale: [1] LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC=C LC_TIME=zh_CN.UTF-8
[4] LC_COLLATE=zh_CN.UTF-8 LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES=zh_CN.UTF-8
[7] LC_PAPER=zh_CN.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] GenomeInfoDb_1.26.2 IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.0 SeuratObject_4.0.4 [6] Seurat_4.1.0 Signac_1.6.0

loaded via a namespace (and not attached): [1] Rtsne_0.15 colorspace_2.0-0 deldir_1.0-6 ellipsis_0.3.2
[5] ggridges_0.5.3 lsa_0.73.2 XVector_0.30.0 GenomicRanges_1.42.0
[9] rstudioapi_0.13 spatstat.data_2.1-0 farver_2.0.3 leiden_0.3.7
[13] listenv_0.8.0 SnowballC_0.7.0 bit64_4.0.5 ggrepel_0.9.1
[17] fansi_0.4.2 codetools_0.2-16 splines_4.0.2 docopt_0.7.1
[21] polyclip_1.10-0 RcppRoll_0.3.0 jsonlite_1.7.2 Rsamtools_2.6.0
[25] ica_1.0-2 cluster_2.1.0 png_0.1-7 uwot_0.1.10
[29] ggforce_0.3.2 shiny_1.6.0 sctransform_0.3.3 spatstat.sparse_2.0-0 [33] compiler_4.0.2 httr_1.4.2 assertthat_0.2.1 Matrix_1.3-4
[37] fastmap_1.1.0 lazyeval_0.2.2 cli_3.2.0 tweenr_1.0.1
[41] later_1.1.0.1 htmltools_0.5.1.1 tools_4.0.2 igraph_1.2.6
[45] gtable_0.3.0 glue_1.6.2 GenomeInfoDbData_1.2.4 RANN_2.6.1
[49] reshape2_1.4.4 dplyr_1.0.8 fastmatch_1.1-0 Rcpp_1.0.7
[53] slam_0.1-48 scattermore_0.7 vctrs_0.3.8 Biostrings_2.58.0
[57] nlme_3.1-148 ggseqlogo_0.1 lmtest_0.9-38 stringr_1.4.0
[61] globals_0.14.0 mime_0.9 miniUI_0.1.1.1 lifecycle_1.0.1
[65] irlba_2.3.3 goftest_1.2-2 future_1.21.0 zlibbioc_1.36.0
[69] MASS_7.3-51.6 zoo_1.8-8 scales_1.1.1 spatstat.core_2.1-2
[73] promises_1.2.0.1 spatstat.utils_2.3-0 RColorBrewer_1.1-2 yaml_2.2.1
[77] reticulate_1.18 pbapply_1.4-3 gridExtra_2.3 ggplot2_3.3.3
[81] rpart_4.1-15 stringi_1.5.3 BiocParallel_1.24.1 rlang_1.0.2
[85] pkgconfig_2.0.3 matrixStats_0.58.0 bitops_1.0-6 qlcMatrix_0.9.7
[89] lattice_0.20-41 tensor_1.5 ROCR_1.0-11 purrr_0.3.4
[93] patchwork_1.1.1 htmlwidgets_1.5.3 bit_4.0.4 cowplot_1.1.1
[97] tidyselect_1.1.2 parallelly_1.23.0 RcppAnnoy_0.0.18 plyr_1.8.6
[101] magrittr_2.0.1 R6_2.5.0 generics_0.1.0 DBI_1.1.1
[105] mgcv_1.8-31 pillar_1.6.4 fitdistrplus_1.1-3 abind_1.4-5
[109] survival_3.1-12 RCurl_1.98-1.2 tibble_3.1.6 future.apply_1.7.0
[113] hdf5r_1.3.3 crayon_1.4.1 KernSmooth_2.23-17 utf8_1.1.4
[117] spatstat.geom_2.3-2 plotly_4.9.3 grid_4.0.2 data.table_1.13.6
[121] sparsesvd_0.2 digest_0.6.27 xtable_1.8-4 tidyr_1.1.2
[125] httpuv_1.5.5 munsell_0.5.0 viridisLite_0.3.0

Best, hanhuihong

timoast commented 2 years ago

This is the correct behaviour. The sep parameter specifies the format of the genomic coordinates in the input matrix, the output will always use - as the separator.

honghh2018 commented 2 years ago

Thanks The soon reply. But The motif predicted error.

pbmc1 <- AddMotifs(

object = pbmc1, genome = BSgenome.Hsapiens.UCSC.hg19, pfm = pfm ) Building motif matrix Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'matchMotifs' for signature '"PWMatrixList", "Assay"'

how Can i fix This issue? Best hanhuihong

timoast commented 2 years ago

See https://github.com/timoast/signac/issues/339, https://github.com/timoast/signac/issues/334