Git Product home page Git Product logo

cbnplot's People

Contributors

jwokaty avatar noriakis avatar xiangpin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cbnplot's Issues

Code running error

Dear Dr, I encountered an error. When running the example codes following documents of CBNplot3.4, some code cannot running successfully in Linux. Please help me.

dep = depmap::depmap_crispr()
bngeneplot(results = pway,
exp = vsted,
expSample = incSample,
pathNum = 15, R = 10, compareRef = T,
convertSymbol = T, pathDb = "reactome", compareRefType = "intersection",
expRow = "ENSEMBL", sizeDep = T, dep = dep, strengthPlot = T, nStrength = 10)

'select()' returned 1:1 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.
此外: Warning messages:
1: In averaged.network.backend(strength = strength, threshold = threshold) :
arc BRIP1 -> CHEK1 would introduce cycles in the graph, ignoring.
2: In averaged.network.backend(strength = strength, threshold = threshold) :
arc MRE11 -> BRIP1 would introduce cycles in the graph, ignoring.
3: In cextend(av, strict = FALSE) :
no consistent extension of av is possible.

no edge present in graph

bngeneplot(results = pway,

  •        exp = vsted,
    
  •        expSample = incSample,
    
  •        pathNum = 13, R = 50, showDir = T,
    
  •        convertSymbol = T,
    
  •        expRow = "ENSEMBL",
    
  •        strThresh = 0.7)
    

'select()' returned 1:many mapping between keys and columns
'select()' returned 1:1 mapping between keys and columns
no edge present in graph

Could you explain why I am getting this? Thanks

CODE ERROR

Dear Dr, I encountered an error. When running the example codes following documents of CBNplot, some code cannot running successfully in Windows. Please help me.

bngeneplot(results=ego,exp = vsted,convertSymbol =FALSE,pathNum = 3)
'select()' returned 1:many mapping between keys and columns
the number of gene is zero or one
[1] "error"

Invalid columns: SYMBOL. Please use the columns method to see a listing of valid arguments

Hi,Dr.noriakis, I try ro use the CBNplot with the orgDb made by myself for plant (rice), but when I entered the command as:bngeneplot(results = pwaygo,exp = gene,orgDb = osa), but the errors as "Error in .testForValidCols(x, cols) :
Invalid columns: SYMBOL. Please use the columns method to see a listing of valid arguments.
In addition: Warning message:
In setReadable(results, OrgDb = orgDb) :
Fail to convert input geneID to SYMBOL since no SYMBOL information available in the provided OrgDb..."

Using Examples in "bnpathplot", but Error in UseMethod("rescale") : no applicable method for 'rescale' applied to an object of class "AsIs"

I used the examples from CBNplot, but when I run the function "bnpathplot", I can't view the "res".

My codes are here:

library(CBNplot)
data("exampleEaRes");data("exampleGeneExp")
res <- bnpathplot(results = exampleEaRes, exp = exampleGeneExp, R = 10, expRow = "ENSEMBL")
res

the Error is :
Error in UseMethod("rescale") :
no applicable method for 'rescale' applied to an object of class "AsIs"

2fda6bb4b63a807dc51412af58cbdfc

Error reported in R and website tools

Dear authors, Please accept my sincere thanks for providing such a useful tool.
But I encountered some errors reported when using my own data.

orgDb: org.Mm.eg.db

Error in R:

Error in data.type(x) :   variable Mx1 is not supported in bnlearn (type: integer).
(genelist: ENTREZ IDs(.txt);expression table: row: ENTREZ IDs, column: samples)

Error in the website:

something wrong with reading the gene list data, probably the wrong specification of gene ID type.
(genelist: ENSEBLE IDs(.txt);expression table: row: ENSEBLE IDs, column: samples)

R >= 4.2 is necessary?

Hi @noriakis,

I want to try this tool but find that you limit it with R>=4.2. Is it necessary? As most Linux cannot install with a so new R version due to permission to update the R on a server or other reasons.

Best

Shixiang

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  

Does CBNplot Discretize Input VSD Data During Network Construction?

Hello developers and users,
I am deeply intrigued by the process CBNplot employs to construct Bayesian Networks and I am particularly interested in understanding how it handles continuous data. Specifically, I would like to inquire whether CBNplot automatically discretizes vsd data inputs during the network construction phase.
Thank you in advance for your assistance!

Best regards

Error message with the example "The plot with the reference"

I tried to follow the example code with "The plot with the reference (https://noriakis.github.io/software/CBNplot/bngeneplot.html#the-plot-with-the-reference)", but with an error message "error in (function (classes, fdef, mtable) : The function 'convertIdentifiers' tag 'NULL' could not find inheritance methods ", also maybe with other error message "Error in UseMethod("filter") : "Filter" has no methods for "c('double', 'numeric')" target objects ", and the code
library("graphite")
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)
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

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 methods
[9] base

other attached packages:
[1] graphite_1.42.0 CBNplot_0.99.2
[3] DOSE_3.22.0 org.Hs.eg.db_3.15.0
[5] AnnotationDbi_1.58.0 DESeq2_1.36.0
[7] stringr_1.4.0 gridExtra_2.3
[9] tibble_3.1.7 viridis_0.6.2
[11] viridisLite_0.4.0 depmap_1.10.0
[13] ExperimentHub_2.4.0 AnnotationHub_3.4.0
[15] BiocFileCache_2.4.0 dbplyr_2.2.0
[17] dplyr_1.0.9 pheatmap_1.0.12
[19] bluster_1.6.0 scater_1.24.0
[21] ggplot2_3.3.6 scran_1.24.0
[23] scuttle_1.6.2 scRNAseq_2.10.0
[25] SingleCellExperiment_1.18.0 SummarizedExperiment_1.26.1
[27] Biobase_2.56.0 GenomicRanges_1.48.0
[29] GenomeInfoDb_1.32.2 IRanges_2.30.0
[31] S4Vectors_0.34.0 BiocGenerics_0.42.0
[33] MatrixGenerics_1.8.0 matrixStats_0.62.0

Is there any possibility to have this tool work with scRNA-seq data?

Hello, thanks for providing such an amazing tools!

I noticed this tool is available for bulk RNA data. But since the scRNA-seq data is much more large and sparse, I don't know whether it can work with scRNA-seq data. And for a more complex situation, I identify differential genes with trajectory inference method, which means there is no literally group/condition at all, what should I do to deal with this situation.

I'd be more than grateful if you can answer my question!

Missing legend when saving image

Hi,
Thanks for the tool, I have some problems while saving the image, below is my code:

pdf("cbn_electrontransport.pdf",width = 8,height = 6)
bngeneplot(results = pwayGO,exp = cbnexp, # expSample = incSample,
           pathNum = 28, R = 50, showDir = T,interactive =T,
           convertSymbol = T,expRow = "ENSEMBL", hub=5,strThresh = 0.7)
dev.off()

I found that the legend and title are missing in the saved picture, why does this happen and how can I solve it.

Thanks,
LeeLee

Question about the CBNplot R package Installation

Dear noriakis,
I have a question about the Installation.

When i try to install the CBNplot package, the following error occured:

install_github("noriakis/CBNplot")
Downloading GitHub repo noriakis/CBNplot@HEAD
✔ checking for file ‘/private/var/folders/g6/7gbr59tn5pv8hp87cwtklph00000gn/T/Rtmpjbmq1D/remotes14b4f7307c85a/noriakis-CBNplot-5809de4/DESCRIPTION’ ...
─ preparing ‘CBNplot’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘CBNplot_0.99.2.tar.gz’

  • installing source package ‘CBNplot’ ...
    ** using staged installation
    ** R
    ** data
    ** byte-compile and prepare package for lazy loading
    Error: the object 'namespace:bnlearn' has no exit 'choose.direction'
    Stop execution
    ERROR: lazy loading failed for package ‘CBNplot’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/CBNplot’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/g6/7gbr59tn5pv8hp87cwtklph00000gn/T//Rtmpjbmq1D/file14b4f3f2c7b6/CBNplot_0.99.2.tar.gz’ had non-zero exit status

I have installed the bnlearn package (4.8.1), what should I do to deal with this situation.

I'd be more than grateful if you can answer my question!

can't determine keyType automatically; need to set 'keyType' explicitly...

Hello,Dear Dr, When I run the data for non-model species following documents of CBNplot, some code cannot running successfully in Linux.

library(DESeq2)
library(clusterProfiler)
library(ggplot2)
library(CBNplot)
counts = read.table("rsem.merged.gene_counts_SDRE.tsv_round", header=1, row.names=1,sep=' ')
meta = sapply(colnames(counts), function (x) substring(x,1,2))
meta = data.frame(meta)
colnames(meta) = c("Condition")
dds <- DESeqDataSetFromMatrix(countData = counts,
                              colData = meta,
                              design= ~ Condition)
filt <- rowSums(counts(dds) < 10) > dim(meta)[1]*0.9
dds <- dds[!filt,]
## Perform DESeq2()
dds = DESeq(dds)
res = results(dds, pAdjustMethod = "bonferroni")
## apply variance stabilizing transformation
v = vst(dds, blind=FALSE)
vsted = assay(v)
pdf(file = "./PCA_DESeq2QC.pdf", width = 12, height = 9);
DESeq2::plotPCA(v, intgroup="Condition")+
    theme_bw()
dev.off()

sig = subset(res, padj<0.05)
cand.entrez = rownames(sig)
GO_anno <- read.csv("gene_go_annotation_from_ipr_nr.tab", sep = "\t",header = T,check.names = F)                               
GO_description <- read.csv("go_term.list", sep = "\t",header = T,check.names = F)                                              
KEGG_anno <- read.csv("kegg_gene.txt", sep = "\t",header = T,check.names = F)                                                  
KEGG_description <- read.csv("kegg_description.txt", sep = "\t", check.names = F, header = T)
#Go enrichment analysis
pwayGO <- clusterProfiler::enricher(cand.entrez,TERM2GENE=GO_anno,TERM2NAME=GO_description,pvalueCutoff = 0.05, pAdjustMethod = "BH")
## Store the similarity
pwayGO = enrichplot::pairwise_termsim(pwayGO)
## Define including samples
incSample = rownames(subset(meta, Condition=="SD"))
#plot
pdf(file = "./barplot_GO.pdf", width = 12, height = 9);
barplot(pwayGO, showCategory = 15)
dev.off()

pdf(file = "./bngeneplot_GO.pdf", width = 12, height = 9);
bngeneplot(results = pwayGO,
           exp = vsted,
           expSample = incSample,
           pathNum = 13, R = 50, showDir = T,
           convertSymbol = FALSE,
           strThresh = 0.7)
dev.off()

I have encountered problems as follows

> bngeneplot(results = pwayGO,
+            exp = vsted,
+            expSample = incSample,
+            pathNum = 13, R = 50, showDir = T,
+            convertSymbol = T,
+            expRow = "ENSEMBL",
+            strThresh = 0.7)
Error in setReadable(results, OrgDb = orgDb) : 
  can't determine keyType automatically; need to set 'keyType' explicitly...
> dev.off()
null device 
          1 

Good luck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.