Commit 83d59b3b authored by liiskolb's avatar liiskolb
Browse files

gosttable order and tidyr version

parent 0ed367d6
Package: gprofiler2
Type: Package
Title: Interface to the 'g:Profiler' Toolset
Version: 0.1.9
Version: 0.2.0
Author: Liis Kolberg <liis.kolberg@ut.ee>, Uku Raudvere <uku.raudvere@ut.ee>
Maintainer: Liis Kolberg <liis.kolberg@ut.ee>
Description: A toolset for functional enrichment analysis and visualization, gene/protein/SNP identifier conversion and mapping orthologous genes across species via 'g:Profiler' (<https://biit.cs.ut.ee/gprofiler>).
......@@ -16,7 +16,7 @@ License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
Imports: jsonlite, RCurl, ggplot2, plotly, tidyr, crosstalk, grDevices, gridExtra, grid, viridisLite, dplyr
Imports: jsonlite, RCurl, ggplot2, plotly, tidyr (>= 1.0.0), crosstalk, grDevices, gridExtra, grid, viridisLite, dplyr
Depends: R (>= 3.5)
Suggests:
knitr,
......
......@@ -493,7 +493,9 @@ gostplot <- function(gostres, capped = TRUE, interactive = TRUE, pal = c("GO:MF"
ggplot2::scale_y_continuous(expand = c(0, 0), limits = c(ymin, ymax),
labels = ticklabels,
breaks = tickvals) +
ggplot2::scale_x_continuous(expand = c(0, 0), limits = c(0, 210), breaks = (xScale(starts) + xScale(starts + widthscale))/2, labels = names(widthscale))
ggplot2::scale_x_continuous(expand = c(0, 0), limits = c(0, 210),
breaks = (xScale(starts) + xScale(starts + widthscale))/2,
labels = names(widthscale))
for (s in names(widthscale)){
xstart = xScale(starts[s])
......@@ -683,6 +685,9 @@ publish_gosttable <- function(gostres, highlight_terms = NULL, use_colors = TRUE
subdf$id <- match(subdf$term_id, highlight_terms)
# order by id column
subdf = subdf[order(subdf$id),]
# default column names to show
show_columns <- unique(append(show_columns, c("id", "term_id", "p_value")))
gp_colnames <- c("id", "source", "term_id", "term_name", "term_size", "query_size", "intersection_size", "p_value", "intersection_sizes", "query_sizes")
......@@ -846,7 +851,16 @@ upload_GMT_file <- function(gmtfile){
if (endsWith(gmtfile, ".gmt")){
# GMT file
gmturl = paste0(file.path(gp_globals$base_url, "api", "gost", "custom"), "/")
gmtdata <- paste(readLines(gmtfile, skipNul = TRUE), collapse = "\n")
# read in file and remove duplicated rows
gmtlist = unique(readLines(gmtfile, skipNul = TRUE))
# check for duplicated term_ids
term_ids = unlist(lapply(gmtlist, function(x) strsplit(x, "\t")[[1]][1]))
if (sum(duplicated(term_ids)) > 0){
duplicates = paste(term_ids[duplicated(term_ids)], collapse = ", ")
stop("Your GMT file includes duplicated identifiers: ", duplicates, ".\nPlease remove duplicated identifiers and try to upload again.")
}
gmtdata <- paste(gmtlist, collapse = "\n")
body <- jsonlite::toJSON((
list(
......@@ -863,7 +877,7 @@ upload_GMT_file <- function(gmtfile){
"Content-Type" = "application/json",
"charset" = "UTF-8",
"Expect" = "")
oldw <- getOption("warn")
oldw <- getOption("warn")
options(warn = -1)
h1 = RCurl::basicTextGatherer(.mapUnicode = FALSE)
h2 = RCurl::getCurlHandle() # Get info about the request
......
......@@ -318,7 +318,7 @@ In addition to the available GO, KEGG, etc data sources, users can upload their
`upload_GMT_file` enables to upload GMT file(s). The input `gmtfile` is the filename of the GMT file together with the path to the file. The input can also be several GMT files compressed into a ZIP file.
The file extension should be **.gmt** or **.zip** in case of multiple GMT files. The uploaded filename is used to define the source name in the enrichment results.
For example, using the BioCarta gene sets downloaded from the [MSigDB Collections] (http://software.broadinstitute.org/gsea/msigdb/collections.jsp#C7)
For example, using the BioCarta gene sets downloaded from the [MSigDB Collections](http://software.broadinstitute.org/gsea/msigdb/collections.jsp#C7)
```{r eval = F}
download.file(url = "http://software.broadinstitute.org/gsea/resources/msigdb/7.0/c2.cp.biocarta.v7.0.symbols.gmt", destfile = "extdata/biocarta.gmt")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment