sbgnview's People
sbgnview's Issues
Cannot specify `sbgn.id.attr` when using default databases
User-defined sbgn.id.attr
gets overwritten in:
SBGNview/R/parsing.utilities.R
Lines 78 to 84 in bbaeea8
I would expect that user-provided sbgn.id.attr
takes precedence over the deduced sbgn.id.attr
.
A way to hide SBGN notation link?
I would like to hide the link to SBGN notation link as it is of no use for me. I see that there is a if.insert.sbgn.link
argument in color.panel
function but it is not exposed. Am I missing something, or does it need to be exposed?
Normalise compound names?
When using compound names to match SMPDB entities, the matching is case-sensitive. I think it would be a reasonable default to make it case-insensitive as otherwise some matches may be left out
A way to reduce verbosity when running `SBGNview`?
Hi, thanks for a great package. I would like to disable all logs like "SBGN file exists:", "parsing arcs", "SBGNview object generated". Currently I have to run suppressMessages(SBGNview())
which is rather inconvenient. Could SBGNview
reduce the amount of messages printed by default and allow to increase verbosity as opt-in (or disable any messages at all) via an argument?
Error in changeDataId Function when Mapping Symbols to pathwayCommons
An error is encountered in the provided code when the changeDataId function is used to map gene data from "symbol" to "pathwayCommons". However, mapping from "symbol" to "entrez" and then to "pathwayCommons" works, so I think this is a bug.
library(SBGNview)
#> Loading required package: pathview
#>
#> ##############################################################################
#> Pathview is an open source software package distributed under GNU General
#> Public License version 3 (GPLv3). Details of GPLv3 is available at
#> http://www.gnu.org/licenses/gpl-3.0.html. Particullary, users are required to
#> formally cite the original Pathview paper (not just mention it) in publications
#> or products. For details, do citation("pathview") within R.
#>
#> The pathview downloads and uses KEGG data. Non-academic uses may require a KEGG
#> license agreement (details at http://www.kegg.jp/kegg/legal.html).
#> ##############################################################################
#> Loading required package: SBGNview.data
#> ##############################################################################
#> SBGNview is an open source software package distributed under GNU General
#> Public License version 3 (GPLv3). Details of GPLv3 is available at
#> http://www.gnu.org/licenses/gpl-3.0.html.
#>
#> Users are required to formally cite the SBGNview paper and Pathview paper (not
#> just mention them) in publications or products. For details, do
#> 'citation("SBGNview"); citation("Pathview")' within R.
#> ##############################################################################
#Load data
gene.data <- gse16873.d
# Map entrez to pathwayCommons
gene.data.entrez.to.pathwayCommons <- changeDataId(gene.data,
input.type = "entrez",
output.type = "pathwayCommons",
mol.type = "gene",
sum.method = "sum")
#>
#> hsa_ENTREZID_pathwayCommons mapping table loaded from SBGNview.data
#> Changing data IDs
#> Finished changing data IDs
head(gene.data.entrez.to.pathwayCommons, 5)
#> DCIS_1
#> Protein_000250be0b7ce9123ef439995f26fa1e 0.3209480
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc 0.2479337
#> Protein_000b5881617c17b2c87c72bc3585c252 0.3344750
#> Protein_000be815679a2fe779da5eb31081ba20 -0.2698879
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 -0.2698879
#> DCIS_2
#> Protein_000250be0b7ce9123ef439995f26fa1e -0.32585772
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc 1.03972870
#> Protein_000b5881617c17b2c87c72bc3585c252 0.35504432
#> Protein_000be815679a2fe779da5eb31081ba20 0.04336225
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 0.04336225
#> DCIS_3
#> Protein_000250be0b7ce9123ef439995f26fa1e -0.1627042
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc 0.1227578
#> Protein_000b5881617c17b2c87c72bc3585c252 0.2104026
#> Protein_000be815679a2fe779da5eb31081ba20 0.1431029
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 0.1431029
#> DCIS_4
#> Protein_000250be0b7ce9123ef439995f26fa1e 0.2740461
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc -0.3604340
#> Protein_000b5881617c17b2c87c72bc3585c252 -0.1034979
#> Protein_000be815679a2fe779da5eb31081ba20 0.2115067
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 0.2115067
#> DCIS_5
#> Protein_000250be0b7ce9123ef439995f26fa1e 0.30930810
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc 0.18060937
#> Protein_000b5881617c17b2c87c72bc3585c252 0.47849178
#> Protein_000be815679a2fe779da5eb31081ba20 -0.08359934
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 -0.08359934
#> DCIS_6
#> Protein_000250be0b7ce9123ef439995f26fa1e 0.28478271
#> Protein_0002d93f5ea4dd15ef9852f0d2ae15cc 0.11317578
#> Protein_000b5881617c17b2c87c72bc3585c252 0.09148291
#> Protein_000be815679a2fe779da5eb31081ba20 0.11285730
#> Protein_000be815679a2fe779da5eb31081ba20_Complex_855d843284bb4f558426811e0ce43095 0.11285730
# Map entrez to symbol
gene.data.entrez.to.symbols <- changeDataId(gene.data,
input.type = "entrez",
output.type = "symbol",
mol.type = "gene",
sum.method = "sum")
#>
#> Generating mapping using Pathview
#>
#> ID mapping not pre-generated
#> Mapping: ENTREZID, symbol
#> 'select()' returned 1:1 mapping between keys and columns
#> [1] "Note: 136 of 11979 unique input IDs unmapped."
#> Changing data IDs
#> Finished changing data IDs
head(gene.data.entrez.to.symbols , 5)
#> DCIS_1 DCIS_2 DCIS_3 DCIS_4 DCIS_5
#> A1CF 0.005634741 -0.007154708 0.08461335 -0.002498477 -0.02486110
#> A2M 0.063928476 -1.407243562 -0.11532037 -1.364733407 -1.17499147
#> A4GALT 0.069798856 0.035496296 0.02984971 -0.107390271 -0.08307566
#> A4GNT -0.221460129 0.044872809 0.05547348 -0.028840867 -0.05907705
#> AAAS -0.118385905 -0.051635875 -0.13042244 -0.161630790 0.05169151
#> DCIS_6
#> A1CF 0.01359610
#> A2M -0.56069215
#> A4GALT 0.09333546
#> A4GNT -0.01005320
#> AAAS 0.03947178
# Map symbol to pathwayCommons
gene.data.symbol.to.pathwayCommons <- changeDataId(data.input.id = gene.data.symbols,
input.type = "symbol",
output.type = "pathwayCommons",
mol.type = "gene",
sum.method = "sum")
#> Error in changeDataId(data.input.id = gene.data.symbols, input.type = "symbol", : object 'gene.data.symbols' not found
head(gene.data.symbol.to.pathwayCommons, 5)
#> Error in head(gene.data.symbol.to.pathwayCommons, 5): object 'gene.data.symbol.to.pathwayCommons' not found
Created on 2023-05-23 with reprex v2.0.2
`
loaded via a namespace (and not attached):
[1] tidyr_1.3.0 bit64_4.0.5 knitr_1.42 DelayedArray_0.24.0 rpart_4.1.19
[6] KEGGREST_1.38.0 RCurl_1.98-1.12 doParallel_1.0.17 generics_0.1.3 callr_3.7.3
[11] cowplot_1.1.1 RSQLite_2.3.1 shadowtext_0.1.2 bit_4.0.5 enrichplot_1.18.4
[16] webshot_0.5.4 xml2_1.3.4 httpuv_1.6.11 assertthat_0.2.1 fontawesome_0.5.1
[21] xfun_0.39 jquerylib_0.1.4 babelgene_22.9 evaluate_0.21 promises_1.2.0.1
[26] TSP_1.2-4 fansi_1.0.4 caTools_1.18.2 dendextend_1.17.1 Rgraphviz_2.42.0
[31] DBI_1.1.3 geneplotter_1.76.0 htmlwidgets_1.6.2 stringdist_0.9.10 purrr_1.0.1
[36] ellipsis_0.3.2 crosstalk_1.2.0 backports_1.4.1 annotate_1.76.0 vctrs_0.6.2
[41] abind_1.4-5 cachem_1.0.8 withr_2.5.0 ggforce_0.4.1 HDO.db_0.99.1
[46] checkmate_2.2.0 treeio_1.22.0 cluster_2.1.4 DOSE_3.24.2 ape_5.7-1
[51] lazyeval_0.2.2 labeling_0.4.2 edgeR_3.40.2 pkgconfig_2.0.3 tweenr_2.0.2
[56] seriation_1.4.2 nnet_7.3-19 rlang_1.1.1 lifecycle_1.0.3 downloader_0.4
[61] registry_0.5-1 dichromat_2.0-0.1 rsvg_2.4.0 polyclip_1.10-4 graph_1.76.0
[66] Matrix_1.5-4.1 aplot_0.1.10 org.Mmu.eg.db_3.16.0 base64enc_0.1-3 processx_3.8.1
[71] GlobalOptions_0.1.2 png_0.1-8 rjson_0.2.21 ca_0.71.1 bitops_1.0-7
[76] gson_0.1.0 KernSmooth_2.23-21 Biostrings_2.66.0 blob_1.2.4 shape_1.4.6
[81] qvalue_2.30.0 gridGraphics_0.5-1 ggsignif_0.6.4 scales_1.2.1 memoise_2.0.1
[86] magrittr_2.0.3 zlibbioc_1.44.0 compiler_4.2.1 scatterpie_0.1.9 clue_0.3-64
[91] KEGGgraph_1.58.3 cli_3.6.1 XVector_0.38.0 ps_1.7.5 patchwork_1.1.2
[96] htmlTable_2.4.1 Formula_1.2-5 MASS_7.3-60 tidyselect_1.2.0 yaml_2.3.7
[101] GOSemSim_2.24.0 locfit_1.5-9.7 sass_0.4.6 fastmatch_1.1-3 tools_4.2.1
[106] rstudioapi_0.14 foreach_1.5.2 foreign_0.8-84 farver_2.1.1 ggraph_2.1.0
[111] digest_0.6.31 BiocManager_1.30.20 Rcpp_1.0.10 broom_1.0.4 later_1.3.1
[116] org.Hs.eg.db_3.16.0 httr_1.4.6 AnnotationDbi_1.60.2 Rdpack_2.4 colorspace_2.1-0
[121] fs_1.6.2 XML_3.99-0.14 splines_4.2.1 yulab.utils_0.0.6 tidytree_0.4.2
[126] graphlayouts_1.0.0 renv_0.17.3 mapproj_1.2.11 ggplotify_0.1.0 xtable_1.8-4
[131] jsonlite_1.8.4 ggtree_3.6.2 tidygraph_1.2.3 ggfun_0.0.9 R6_2.5.1
[136] pillar_1.9.0 htmltools_0.5.5 mime_0.12 glue_1.6.2 fastmap_1.1.1
[141] clusterProfiler_4.6.2 codetools_0.2-19 maps_3.4.1 fgsea_1.24.0 utf8_1.2.3
[146] bslib_0.4.2 lattice_0.21-8 tibble_3.2.1 curl_5.0.0 gtools_3.9.4
[151] clipr_0.8.0 Rttf2pt1_1.3.12 zip_2.3.0 GO.db_3.16.0 limma_3.54.2
[156] survival_3.5-5 rmarkdown_2.21 munsell_0.5.0 GetoptLong_1.0.5 GenomeInfoDbData_1.2.9
[161] iterators_1.0.14 gtable_0.3.3 msigdbr_7.5.1 rbibutils_2.2.13
`
Mapping using own mapping table depends on column order
Hi,
I tried SBGNview with a custom SBGN file and supplied my user-provided mapping table. Because I made the mapping table manually in an excel-file it coincidentally occurred, that the column for the parameter gene.id.type was not the first column but the second column and the first column was the parameter sbgn.gene.id.type. When I tried running it, it was not able to map any IDs. After some troubleshooting I tried creating a mini-mapping table in R (with the reverse column order), which had previously worked on a different SBGN file and it worked. After changing the column order it also worked with the actual file I was trying to visualize. This makes me think, that some part of the mapping refers to columns not (only) by name but (also) by order. For my understanding, this is not clearly indicated in the documentation of the function arguments. I would also personally prefer the function not to depend on column order if I am already indicating it by the name, but I think it would be okay if this is clearly indicated in the documentation.
Best,
Micha
Error in xml2::xml_find_all(sbgn.xml, ".//map")[[1]] : subscript out of bounds
I tried to plot the reactome pathway R-HSA-212165, and I downloaded sbml file from https://reactome.org/content/detail/R-HSA-212165, and run the code as below, and gave me the error. how can I fix it? Thank you.
SBGNview.obj <- SBGNview(
gene.data = log2(datafoldchange),
gene.id.type = "SYMBOL",
sbgn.gene.id.type ="uniprot",
input.sbgn = "R-HSA-212165.sbml",
sbgn.dir = ".",
output.file = "quick.start",
output.formats = c("png")
)
Processing pathway: R-HSA-212165.sbml
R-HSA-212165.sbml looks like a local file. Using it directly.
Using user defined pathway SBGN-ML file!!
Generating mapping using Pathview
ID mapping not pre-generated
Mapping: SYMBOL, uniprot
'select()' returned 1:many mapping between keys and columns
[1] "Note: 190 of 5889 unique input IDs unmapped."
Changing data IDs
Finished changing data IDs
reading SBGN-ML file for arcs info: ./R-HSA-212165.sbml
Rendering SBGN graph
checking graph size and create margin for color panel
parsing ports
parsing glyphs
Error in xml2::xml_find_all(sbgn.xml, ".//map")[[1]] :
subscript out of bounds
In addition: Warning messages:
1: In max(x + w) : no non-missing arguments to max; returning -Inf
2: In max(y + h) : no non-missing arguments to max; returning -Inf
3: In min(y) : no non-missing arguments to min; returning Inf
4: In min(x) : no non-missing arguments to min; returning Inf
Error handling in mapping utilities is not user-friendly
SBGNview/R/mapping.utilities.R
Lines 465 to 476 in bbaeea8
has bare stop()
. Because of #4 I was using suppressMessages(SBGNview())
and getting no error messages. The error message could be paste
d and moved into stop()
.
Example code for reading a local SBGN-ML file
Hello,
Is there an example code that I can look at for using SBGN-ML files from other sources?
Thanks
-Burak
Compatible with MSigDB pathways?
Hi
Is this tool compatible with MSigDB pathways? If so, is there some example code available?
Thanks in advance.
--
With kind regards
Tim
Rendering to screen without writing to file
I am attempting to use SBGNview
in Jupyter notebook. I am not interested in saving the result to file but only in embedding the SVG string in the notebook for interactive viewing. Would it be possible to add a utility function allowing to displaying the result? Most R packages I know use print
for display and have a dedicated save
method, but here the print.SBGNview
is used as save which prevents some use-cases. I am happy to open PR if this is welcome.
Opacity of split compound nodes is 0.6 for the split part
Hi,
I tried SBGN View with a minimal custom SBGN, to see if I can manage to visualize omics data of both transcriptome and metabolome via SBGN_View. I noticed that if compound nodes are split, the right part has only an opacity/alpha of 0.6 when opening the .svg in inkscape. First I thought this may be due to my SBGN-file, but the same happens, when using the example in 5.2 of the vignette (https://bioconductor.org/packages/release/bioc/vignettes/SBGNview/inst/doc/SBGNview.Vignette.html#53_Visualize_both_gene_data_and_compound_data). It would be great if you could check this.
Best,
Micha
Setting viewBox on SVG
The generated SVG file forces dimensions by width
and height
attributes. This makes it impossible to resize it easily in some interactive contexts. Would you be happy to accept a PR adding viewBox
argument which allows the SVG to fit to the available space while preserving the dimensions of content?
Feature request KEGG pathway maps
Hi,
Thank you for this useful package. I was wondering, whether there are plans to also include KEGG pathway maps in SGBNview. I know that those are covered by Pathview but with SGBNview it looks like the output is easier to customize (e.g. output in .svg). I know there are ways to theoretically do this myself with KEGGtranslator (http://www.cogsys.cs.uni-tuebingen.de/software/KEGGtranslator/) or Vanted (https://www.cls.uni-konstanz.de/software/vanted/) and SGBN-ED (https://kim25.wwwdns.kim.uni-konstanz.de/vanted/addons/sbgn-ed/). I will see if I can manage to do this but I think generally, other users may benefit from the addition of KEGG pathways to SGBNview. For example I work with data from tomato (Solanum Lycopersicum) and the only database I could query for plant-specific pathways with SGBNview is MetaCyc, which did not annotate many of my genes properly. This may be similar for other users working with non-human/non-mammalian/non-model species.
I have another question. Is there a way to adjust bins and limits of the scale as there is in pathview? I did not find this in the documentation.
Thanks a lot for your help and consideration!
Best,
Micha
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.