Problems in documentation's chapter 3
Hi! Thanks for developing CBNplot! I just want reproduce the documentation of CBNplot, but some codes cannot running successfully in Win10. By the way, could you share the file, tcgablcaData.rda? or send it to my e-mail, [email protected]. Thank you!
Qin
#3.3 The plot with the reference
library(parallel)
cl = makeCluster(4)
bngeneplot(results = pway,
exp = vsted,
expSample = incSample,
pathNum = 13, R = 30, compareRef = T,
convertSymbol = T, pathDb = "reactome",
expRow = "ENSEMBL", cl = cl)
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:1 mapping between keys and columns
#Error in (function (classes, fdef, mtable) :
# unable to find an inherited method for function ‘convertIdentifiers’ for signature ‘"NULL"’
#In addition: Warning messages:
#1: In averaged.network.backend(strength = strength, threshold = threshold) :
# arc CKAP5 -> AURKB would introduce cycles in the graph, ignoring.
#2: In averaged.network.backend(strength = strength, threshold = threshold) :
# arc SPC24 -> CENPE would introduce cycles in the graph, ignoring.
#3: In averaged.network.backend(strength = strength, threshold = threshold) :
# arc SPC24 -> DSN1 would introduce cycles in the graph, ignoring.
#4: In averaged.network.backend(strength = strength, threshold = threshold) :
# arc XPO1 -> BUB1 would introduce cycles in the graph, ignoring.
#5: In averaged.network.backend(strength = strength, threshold = threshold) :
# arc XPO1 -> RHOB would introduce cycles in the graph, ignoring.
dep = depmap::depmap_crispr()
bngeneplot(results = pway,
exp = vsted,
expSample = incSample,
pathNum = 15, R = 5,compareRef = T,
convertSymbol = T, pathDb = "reactome", compareRefType = "intersection",
expRow = "ENSEMBL", sizeDep = T, dep = dep)
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:1 mapping between keys and columns
#Error in checkHT(n, dx <- dim(x)) :
# invalid 'n' - must contain at least one non-missing element, got none.
#In addition: There were 50 or more warnings (use warnings() to see the first 50)
sessionInfo()
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8
[2] LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] TCGAbiolinks_2.24.1 DOSE_3.22.0
[3] DESeq2_1.36.0 SummarizedExperiment_1.26.1
[5] MatrixGenerics_1.8.0 matrixStats_0.62.0
[7] GenomicRanges_1.48.0 GenomeInfoDb_1.32.2
[9] oaqc_1.0 bnlearn_4.7.1
[11] depmap_1.10.0 dplyr_1.0.9
[13] graphite_1.42.0 org.Hs.eg.db_3.15.0
[15] AnnotationDbi_1.58.0 IRanges_2.30.0
[17] S4Vectors_0.34.0 Biobase_2.56.0
[19] BiocGenerics_0.42.0 ReactomePA_1.40.0
[21] clusterProfiler_4.4.2 ggplot2_3.3.6
[23] CBNplot_0.99.2
loaded via a namespace (and not attached):
[1] snow_0.4-4 shadowtext_0.1.2
[3] AnnotationHub_3.4.0 fastmatch_1.1-3
[5] BiocFileCache_2.4.0 plyr_1.8.7
[7] igraph_1.3.2 lazyeval_0.2.2
[9] splines_4.2.0 gmp_0.6-5
[11] BiocParallel_1.30.3 digest_0.6.29
[13] yulab.utils_0.0.4 htmltools_0.5.2
[15] GOSemSim_2.22.0 viridis_0.6.2
[17] GO.db_3.15.0 fansi_1.0.3
[19] magrittr_2.0.3 memoise_2.0.1
[21] tzdb_0.3.0 readr_2.1.2
[23] annotate_1.74.0 Biostrings_2.64.0
[25] graphlayouts_0.8.0 pvclust_2.2-0
[27] prettyunits_1.1.1 enrichplot_1.16.1
[29] colorspace_2.0-3 rvest_1.0.2
[31] blob_1.2.3 rappdirs_0.3.3
[33] ggrepel_0.9.1 ggdist_3.1.1
[35] xfun_0.31 crayon_1.5.1
[37] RCurl_1.98-1.7 jsonlite_1.8.0
[39] graph_1.74.0 scatterpie_0.1.7
[41] genefilter_1.78.0 survival_3.3-1
[43] ape_5.6-2 glue_1.6.2
[45] polyclip_1.10-0 gtable_0.3.0
[47] zlibbioc_1.42.0 XVector_0.36.0
[49] DelayedArray_0.22.0 distributional_0.3.0
[51] Rmpfr_0.8-9 scales_1.2.0
[53] DBI_1.1.2 Rcpp_1.0.8.3
[55] progress_1.2.2 viridisLite_0.4.0
[57] xtable_1.8-4 gridGraphics_0.5-1
[59] tidytree_0.3.9 bit_4.0.4
[61] reactome.db_1.79.0 httr_1.4.3
[63] fgsea_1.22.0 RColorBrewer_1.1-3
[65] ellipsis_0.3.2 XML_3.99-0.10
[67] pkgconfig_2.0.3 farver_2.1.0
[69] dbplyr_2.2.0 locfit_1.5-9.5
[71] utf8_1.2.2 labeling_0.4.2
[73] ggplotify_0.1.0 tidyselect_1.1.2
[75] rlang_1.0.2 reshape2_1.4.4
[77] later_1.3.0 munsell_0.5.0
[79] BiocVersion_3.15.2 tools_4.2.0
[81] cachem_1.0.6 downloader_0.4
[83] cli_3.3.0 generics_0.1.2
[85] RSQLite_2.2.14 ExperimentHub_2.4.0
[87] stringr_1.4.0 fastmap_1.1.0
[89] yaml_2.3.5 ggtree_3.4.0
[91] knitr_1.39 bit64_4.0.5
[93] tidygraph_1.2.1 purrr_0.3.4
[95] KEGGREST_1.36.2 ggraph_2.0.5
[97] nlme_3.1-157 mime_0.12
[99] aplot_0.1.6 xml2_1.3.3
[101] DO.db_2.9 biomaRt_2.52.0
[103] compiler_4.2.0 rstudioapi_0.13
[105] filelock_1.0.2 curl_4.3.2
[107] png_0.1-7 interactiveDisplayBase_1.34.0
[109] treeio_1.20.0 geneplotter_1.74.0
[111] tibble_3.1.7 tweenr_1.0.2
[113] stringi_1.7.6 TCGAbiolinksGUI.data_1.16.0
[115] lattice_0.20-45 Matrix_1.4-1
[117] vctrs_0.4.1 pillar_1.7.0
[119] lifecycle_1.0.1 BiocManager_1.30.18
[121] data.table_1.14.2 bitops_1.0-7
[123] httpuv_1.6.5 patchwork_1.1.1
[125] qvalue_2.28.0 R6_2.5.1
[127] promises_1.2.0.1 gridExtra_2.3
[129] codetools_0.2-18 MASS_7.3-57
[131] assertthat_0.2.1 withr_2.5.0
[133] GenomeInfoDbData_1.2.8 hms_1.1.1
[135] grid_4.2.0 ggfun_0.0.6
[137] tidyr_1.2.0 ggnewscale_0.4.7
[139] ggforce_0.3.3 shiny_1.7.1
Dear @Ci-TJ, Thank you very much for your feedback on the error.
I apologize for the delayed response. It seems that the code you provided works under my environment, and the error might come from the differences in input for bngeneplot, or environmental differences. I will look into the issue with the environment you provided, and could you please share with me the input for bngeneplot?
The comparison with the reference can only be used with the enrichment analysis of supported pathway databases under graphite::pathways() like Reactome (pathDb="reactome") or KEGG (pathDb="kegg").
I apologize it is not currently documented and will add to the new documentation.
Regarding the tcgablcaData.rda, the data comes from TCGAbiolinks by running the following code.
library(TCGAbiolinks)
query <- GDCquery(project = "TCGA-BLCA",
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
sample.type = "Primary Tumor",
workflow.type = "HTSeq - Counts")
download <- GDCdownload(query)
tcgaData <- GDCprepare(query)
Hi! I I found the object pway in my enviroment is different with yours, but still in vain after I dealed with it. What's more, I found the tcgablcaData.rda that you sent to me just has one object tcgaData, but vstedTCGA and metadata are also needed. I'm sorry that I am not familiar with TCGA data.
pway@result$Description[1:3]
#[1] "Homo sapiens\r: Cell Cycle Checkpoints"
#[2] "Homo sapiens\r: Amplification of signal from the kinetochores"
#[3] "Homo sapiens\r: Amplification of signal from unattached kinetochores via a MAD2 inhibitory signal"
pway@result$Description <- gsub(".*\r: ","",pway@result$Description)
pway@result$Description[1:3]
#[1] "Cell Cycle Checkpoints"
#[2] "Amplification of signal from the kinetochores"
#[3] "Amplification of signal from unattached kinetochores via a MAD2 inhibitory signal"
library(parallel)
cl = makeCluster(4)
bngeneplot(results = pway,
exp = vsted,
expSample = incSample,
pathNum = 13, R = 30, compareRef = T,
convertSymbol = T, pathDb = "reactome",
expRow = "ENSEMBL", cl = cl)
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:1 mapping between keys and columns
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:many mapping between keys and columns
#'select()' returned 1:many mapping between keys and columns
#Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto), :
# Viewport has zero dimension(s)
#In addition: There were 23 warnings (use warnings() to see them)
###################
ls()
character(0)
> load("tcgablcaData.rda")
> ls()
[1] "tcgaData"
Dear @Ci-TJ,
Thank you for your detailed comment. As you stated, the problem is from the version of reactome.db, which adds "Homo sapiens\r: " to the pathway names in the newest version. I have inserted codes to strip these prefixes in the new commit and would like to see if it works in your environment.
As for the Viewport error, it occasionally happens when the plotting window of like RStudio is too small. Would you mind saving the plot to PNG or JPEG to see if it works?
Regarding the vstedTCGA and metadata, I apologize for not clarifying how these are created. We obtained count data and metadata from tcgaData, and perform VST on created DESeqDataSet for demonstrating purposes like the below code.
dataAssay <- assays(tcgaData)
tcgaCount <- dataAssay@listData$`HTSeq - Counts`
metadata <- data.frame(tcgaData@colData) %>%
dplyr::select(age_at_diagnosis, paper_Combined.T.and.LN.category) %>% na.omit() %>%
filter(paper_Combined.T.and.LN.category!="ND")
metadata$age_at_diagnosis <- as.numeric(scale(metadata$age_at_diagnosis))
metadata$paper_Combined.T.and.LN.category <- as.factor(metadata$paper_Combined.T.and.LN.category)
ddsTCGA <- DESeqDataSetFromMatrix(countData = tcgaCount[,rownames(metadata)],
colData = metadata,
design= ~ age_at_diagnosis + paper_Combined.T.and.LN.category)
vstedTCGA <- assay(vst(ddsTCGA, blind=FALSE))
I apologize for the inconvenience, and it's possible that other parts of the documentation may not work. I am currently revising the entire codes and documentation (like using the RSEM data from UCSC Xena), to more accurately present the use cases of the package.
Thank you very much for your feedback and I will try to update the package as soon as possible.
Thank you for your prompt response! Although I also had trouble with chapter 4, everything is moving in a good direction. I will be waiting for your good news.