Open TerezaClarence opened 1 year ago
Hi @TerezaClarence , I'm not fully sure what causes the issue here, are you using a publically PBMC available dataset? If you point me to where you have it from then I can try to reproduce the error
Dear @joschif I am using my multiome dataset, data were loaded from cellranger 10x multiome and preprocessed with seurat and signac. I have no idea why it's giving me the error - I tried to repeatedly just diet the data so it contains RNA and ATC-assay, but it still gives me the same error. Changing the DefaultAssay also didn't help.
Best, Tereza
Hello @TerezaClarence! Just to make sure, the RNA assay does have variable features, correct?
Hello,
I used the scMultiome analysis vignette on our unpublished data in which in Step3 a gene regulatory network reconstruction is performed using pando.
When I run infer_grn
I get the same error message as mentioned above:
attempt to select less than one element in integerOneIndex
13: (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x,
i, exact = exact))(x, ..., exact = exact)
12: `[[.data.frame`(args, i)
11: args[[i]]
10: is.factor(x)
9: as.factor(args[[i]])
8: interaction(groupings2, sep = "_")
7: data.frame(interaction(groupings2, sep = "_"))
6: fast_aggregate(x = x, groupings = groups, fun = fun)
5: aggregate_matrix(t(peaks_near_gene), groups = colnames(peaks_near_gene),
fun = "sum")
4: fit_grn_models.SeuratPlus(object = object, genes = genes, network_name = network_name,
peak_to_gene_method = peak_to_gene_method, upstream = upstream,
downstream = downstream, extend = extend, only_tss = only_tss,
parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor,
aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col,
method = method, alpha = alpha, family = family, interaction_term = interaction_term,
adjust_method = adjust_method, scale = scale, verbose = verbose,
...)
3: fit_grn_models(object = object, genes = genes, network_name = network_name,
peak_to_gene_method = peak_to_gene_method, upstream = upstream,
downstream = downstream, extend = extend, only_tss = only_tss,
parallel = parallel, tf_cor = tf_cor, peak_cor = peak_cor,
aggregate_rna_col = aggregate_rna_col, aggregate_peaks_col = aggregate_peaks_col,
method = method, alpha = alpha, family = family, interaction_term = interaction_term,
adjust_method = adjust_method, scale = scale, verbose = verbose,
...)
2: infer_grn.SeuratPlus(seurat, parallel = F, tf_cor = 0.05, method = "glm",
family = "gaussian", scale = F, verbose = T)
1: infer_grn(seurat, parallel = F, tf_cor = 0.05, method = "glm",
family = "gaussian", scale = F, verbose = T)
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.3.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] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] doParallel_1.0.17 iterators_1.0.14 foreach_1.5.2 Pando_1.0.3 JASPAR2020_0.99.10
[6] TFBSTools_1.36.0 presto_1.0.0 data.table_1.14.8 harmony_0.1.1 Rcpp_1.0.10
[11] ensembldb_2.22.0 AnnotationFilter_1.22.0 GenomicFeatures_1.50.4 AnnotationDbi_1.60.2 Biobase_2.58.0
[16] simspec_0.0.0.9000 BSgenome.Hsapiens.UCSC.hg38_1.4.5 BSgenome_1.66.3 rtracklayer_1.58.0 Biostrings_2.66.0
[21] XVector_0.38.0 GenomicRanges_1.50.2 GenomeInfoDb_1.34.9 IRanges_2.32.0 S4Vectors_0.36.2
[26] AnnotationHub_3.6.0 BiocFileCache_2.6.1 dbplyr_2.3.2 BiocGenerics_0.44.0 Signac_1.9.0
[31] SeuratObject_4.1.3 Seurat_4.3.0 patchwork_1.1.2 lubridate_1.9.2 forcats_1.0.0
[36] stringr_1.5.0 dplyr_1.1.2 purrr_1.0.1 readr_2.1.4 tidyr_1.3.0
[41] tibble_3.2.1 ggplot2_3.4.2 tidyverse_2.0.0
loaded via a namespace (and not attached):
[1] Hmisc_5.1-0 ica_1.0-3 RcppRoll_0.3.0 ps_1.7.5 Rsamtools_2.14.0
[6] lmtest_0.9-40 rprojroot_2.0.3 crayon_1.5.2 MASS_7.3-60 nlme_3.1-162
[11] backports_1.4.1 qlcMatrix_0.9.7 rlang_1.1.1 ROCR_1.0-11 irlba_2.3.5.1
[16] callr_3.7.3 limma_3.54.2 filelock_1.0.2 BiocParallel_1.32.6 rjson_0.2.21
[21] CNEr_1.34.0 bit64_4.0.5 glue_1.6.2 poweRlaw_0.70.6 sctransform_0.3.5
[26] processx_3.8.1 vipor_0.4.5 chromVAR_1.20.2 spatstat.sparse_3.0-1 spatstat.geom_3.2-1
[31] tidyselect_1.2.0 SummarizedExperiment_1.28.0 usethis_2.1.6 fitdistrplus_1.1-11 XML_3.99-0.14
[36] zoo_1.8-12 GenomicAlignments_1.34.1 xtable_1.8-4 magrittr_2.0.3 evaluate_0.21
[41] cli_3.6.1 zlibbioc_1.44.0 rstudioapi_0.14 miniUI_0.1.1.1 sp_1.6-0
[46] rpart_4.1.19 fastmatch_1.1-3 maps_3.4.1 shiny_1.7.4 xfun_0.39
[51] pkgbuild_1.4.0 cluster_2.1.4 caTools_1.18.2 tidygraph_1.2.3 KEGGREST_1.38.0
[56] interactiveDisplayBase_1.36.0 ggrepel_0.9.3 biovizBase_1.46.0 listenv_0.9.0 TFMPvalue_0.0.9
[61] png_0.1-8 future_1.32.0 withr_2.5.0 bitops_1.0-7 slam_0.1-50
[66] ggforce_0.4.1 plyr_1.8.8 sparsesvd_0.2-2 pracma_2.4.2 pillar_1.9.0
[71] cachem_1.0.8 fs_1.6.2 hdf5r_1.3.8 vctrs_0.6.2 ellipsis_0.3.2
[76] generics_0.1.3 devtools_2.4.5 tools_4.2.2 foreign_0.8-84 beeswarm_0.4.0
[81] munsell_0.5.0 tweenr_2.0.2 DelayedArray_0.24.0 fastmap_1.1.1 compiler_4.2.2
[86] pkgload_1.3.2 abind_1.4-5 httpuv_1.6.11 sessioninfo_1.2.2 plotly_4.10.1
[91] GenomeInfoDbData_1.2.9 gridExtra_2.3 lattice_0.21-8 ggpointdensity_0.1.0 deldir_1.0-9
[96] utf8_1.2.3 later_1.3.1 jsonlite_1.8.4 scales_1.2.1 docopt_0.7.1
[101] pbapply_1.7-0 sparseMatrixStats_1.10.0 lazyeval_0.2.2 nabor_0.5.0 promises_1.2.0.1
[106] R.utils_2.12.2 goftest_1.2-3 spatstat.utils_3.0-3 reticulate_1.28 checkmate_2.2.0
[111] rmarkdown_2.21 cowplot_1.1.1 Rtsne_0.16 dichromat_2.0-0.1 uwot_0.1.14
[116] igraph_1.4.3 survival_3.5-5 yaml_2.3.7 htmltools_0.5.5 memoise_2.0.1
[121] VariantAnnotation_1.44.1 profvis_0.3.8 BiocIO_1.8.0 graphlayouts_1.0.0 viridisLite_0.4.2
[126] digest_0.6.31 mime_0.12 rappdirs_0.3.3 pals_1.7 RSQLite_2.3.1
[131] future.apply_1.11.0 mapproj_1.2.11 remotes_2.4.2 urlchecker_1.0.1 blob_1.2.4
[136] R.oo_1.25.0 splines_4.2.2 Formula_1.2-5 labeling_0.4.2 ProtGenerics_1.30.0
[141] RCurl_1.98-1.12 hms_1.1.3 colorspace_2.1-0 base64enc_0.1-3 BiocManager_1.30.20
[146] ggbeeswarm_0.7.2 ggrastr_1.0.1 nnet_7.3-19 RANN_2.6.1 ggseqlogo_0.1
[151] fansi_1.0.4 tzdb_0.4.0 parallelly_1.35.0 R6_2.5.1 grid_4.2.2
[156] ggridges_0.5.4 lifecycle_1.0.3 curl_5.0.0 leiden_0.4.3 motifmatchr_1.20.0
[161] Matrix_1.5-4.1 desc_1.4.2 RcppAnnoy_0.0.20 RColorBrewer_1.1-3 spatstat.explore_3.2-1
[166] htmlwidgets_1.6.2 polyclip_1.10-4 biomaRt_2.54.1 timechange_0.2.0 seqLogo_1.64.0
[171] globals_0.16.2 htmlTable_2.4.1 spatstat.random_3.1-5 progressr_0.13.0 codetools_0.2-19
[176] matrixStats_0.63.0 GO.db_3.16.0 gtools_3.9.4 prettyunits_1.1.1 R.methodsS3_1.8.2
[181] gtable_0.3.3 DBI_1.1.3 tensor_1.5 httr_1.4.6 KernSmooth_2.23-21
[186] stringi_1.7.12 progress_1.2.2 reshape2_1.4.4 farver_2.1.1 annotate_1.76.0
[191] viridis_0.6.3 DT_0.28 xml2_1.3.4 restfulr_0.0.15 scattermore_1.1
[196] BiocVersion_3.16.0 bit_4.0.5 MatrixGenerics_1.10.0 spatstat.data_3.0-1 ggraph_2.1.0
[201] pkgconfig_2.0.3 DirichletMultinomial_1.40.0 knitr_1.43
Not part of dev team but might be useful:
In my understanding infer_grn()
will by default fit models for genes found as VariableFeatures. If VariableFeatures are not present in the object, it will throw the error that @TerezaClarence reported.
One can solve the problem by specifying genes using genes
argument in the infer_grn()
.
Dear Pndo developers,
I was wondering if you could help me to debug my code - I am just following your tutorial and applying it on my data below, however I ran into an error irrespective of which setup I use:
I am not sure what could be the problem, I tried to DietSeurat, so it only contains RNA and peaks or RNA and ATAC assay but I still got the same problem.
Thank you so much for your help.
Best regards, Tereza