Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mapping #37

Closed
wants to merge 142 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
4731ba5
add ramp mapping
iblacksand Sep 18, 2023
bd50cb1
add install script
iblacksand Apr 10, 2023
ecf08bb
changed mappped to mapped :skull:
iblacksand Apr 11, 2023
b65ce88
formatting
iblacksand Apr 18, 2023
afbe812
adds working version of k-medoid
iblacksand Apr 24, 2023
5b6538f
set default k to 5 to fit examples
iblacksand Apr 24, 2023
a22c5f4
faster jaccard
iblacksand Apr 25, 2023
9d5a8cf
Working KEGG link. need to remove redundant results
iblacksand Apr 26, 2023
0633bbb
Adds working wikidata links
iblacksand Apr 26, 2023
5eeee7c
add CLARA
iblacksand May 4, 2023
5256603
add ability to toggle redundancy methods
iblacksand May 16, 2023
6f519c2
fix GSEA for metabolites
iblacksand May 18, 2023
51a96ac
fix ORA
iblacksand May 18, 2023
2d33462
add maxK for kMedoid and fix affinity prop labeling
iblacksand Jul 5, 2023
cf60e74
add start of adding Rust to package
iblacksand Sep 25, 2023
9105be2
add rewrite of fill_input_matrix
iblacksand Oct 6, 2023
f8f17cc
adds fill_input_data_frame, but returns list
iblacksand Oct 9, 2023
644b3a9
add basic output for GSEA
iblacksand Oct 9, 2023
77e1123
add GSEA config
iblacksand Oct 9, 2023
cf0ec6e
add GSEA vector creation
iblacksand Oct 10, 2023
3f88cec
convert list to dataframe using as.data.frame
iblacksand Oct 11, 2023
7eddc1f
first version of Rust GSEA
iblacksand Oct 11, 2023
2e3e2da
working version of GSEA
iblacksand Oct 12, 2023
1179275
Add working ORA
iblacksand Oct 12, 2023
ec742ee
add better readme
iblacksand Oct 13, 2023
f510980
attempt to fix running sum with no luck
iblacksand Oct 13, 2023
1406f92
Update README.md
iblacksand Oct 13, 2023
2ba2540
Fix running_sum and finalize first working version of R package
iblacksand Oct 16, 2023
fef4641
Fix repo in install instructions
iblacksand Oct 16, 2023
144a82a
add requirements
iblacksand Oct 16, 2023
7974410
Update README.md heading size
iblacksand Oct 16, 2023
b7ed1e8
Update R version
iblacksand Oct 16, 2023
a7f5d75
Update README.md links
iblacksand Oct 17, 2023
ad004a5
Update issue templates
iblacksand Oct 17, 2023
5585bf2
Update issue templates
iblacksand Oct 17, 2023
105f0ef
Update issue templates
iblacksand Oct 17, 2023
3133af1
fix ORA results not showing size
iblacksand Oct 17, 2023
93a2f2a
add more description about Rust installation
iblacksand Oct 17, 2023
a97f550
fix ORA fdrs
iblacksand Oct 17, 2023
94ffc7c
fix kMedoid imports
iblacksand Oct 18, 2023
68c5ce1
Update issue templates
iblacksand Oct 18, 2023
e63364c
update readme and rust version
iblacksand Oct 18, 2023
b4ec344
update rust download link
iblacksand Oct 18, 2023
2b7ec3c
default to AHash and no weighted-set cover
iblacksand Oct 19, 2023
5409594
fix kMedoid output and make rust version use master branch
iblacksand Oct 24, 2023
69d93f1
make k-Medoid deterministic
iblacksand Oct 24, 2023
e7b252f
use p.adjust instead of rust package for fdr methods
iblacksand Oct 25, 2023
c8d3320
fix GSEA gene set names being incorrectly format and not showing des …
iblacksand Oct 30, 2023
8a2cbbb
add start of multiomics
iblacksand Oct 31, 2023
44b08a4
add multiomics GSEA
iblacksand Nov 2, 2023
ce5e7dc
add start of combination of GMT files
iblacksand Nov 2, 2023
d96e164
update lib variable names
iblacksand Nov 2, 2023
1736acf
Create windows-compile.yml
iblacksand Nov 3, 2023
7e0af6a
add documentation and fix ORA reading
iblacksand Nov 2, 2023
ce0fe2e
add more ora support and start attempt at windows precompiled
iblacksand Nov 3, 2023
51a23fe
update to use faster rust
iblacksand Nov 3, 2023
7efc125
fix folder
iblacksand Nov 3, 2023
1d5ac8e
Fix typo
iblacksand Nov 3, 2023
2d22c3b
Update windows-compile.yml
iblacksand Nov 3, 2023
9c5e785
fix windows compilation paths
iblacksand Nov 3, 2023
1bd7e63
add updated link
iblacksand Nov 6, 2023
1cc0740
use gnu build for rust compilation
iblacksand Nov 6, 2023
fb8505b
add r install
iblacksand Nov 6, 2023
268bf9e
revert back to msvc
iblacksand Nov 6, 2023
8be12bd
add more multiomics ORA
iblacksand Nov 7, 2023
afb3cd6
add pkgdown
iblacksand Nov 7, 2023
cdda968
add installation page
iblacksand Nov 7, 2023
db72160
add better checks and logos
iblacksand Nov 8, 2023
bc7dc46
fix windows and add better function comments
iblacksand Nov 9, 2023
063a17d
fix documentation
iblacksand Nov 9, 2023
3acde49
update Rd
iblacksand Nov 9, 2023
1514aaf
fix multiple lists not being read correctly for ORA
iblacksand Nov 9, 2023
797034a
fix news, leading edge, affinity propagation crash
iblacksand Nov 13, 2023
9833623
fix reading of id lists
iblacksand Nov 14, 2023
7d3be53
Metaanalysis ORA working with rust results
iblacksand Nov 15, 2023
12fc4e4
Update to comments, add multiomics ORA to dataframe
iblacksand Nov 20, 2023
b18dcbe
generate reports for ORA individual runs
iblacksand Nov 21, 2023
7769caf
add start of metareport function
iblacksand Dec 1, 2023
6e78776
fix list names
iblacksand Dec 1, 2023
c84f1be
get start of working template
iblacksand Dec 4, 2023
2020f35
save progress of new dataset
iblacksand Dec 4, 2023
78c72e0
working version of iFrames
iblacksand Dec 4, 2023
41dd755
Fix genetables not displaying
iblacksand Dec 4, 2023
fe95aab
First working version of ORA meta-analysis
iblacksand Dec 7, 2023
2e27276
Clean up Meta-analysis output
iblacksand Dec 8, 2023
0367601
Start addition of multiomic GSEA
iblacksand Dec 8, 2023
814f65a
More work on GSEA
iblacksand Dec 8, 2023
3a5efff
More updates to multi-omic GSEA
iblacksand Dec 8, 2023
c656b01
fix reading of ranked lists
iblacksand Dec 10, 2023
c124bfe
fix rnk files if they contain metabolites
iblacksand Dec 10, 2023
40c65ce
More possible fixes to GSEA
iblacksand Dec 11, 2023
77dbc8e
fix multigsea
iblacksand Dec 11, 2023
984e7c9
get working GSEA
iblacksand Dec 11, 2023
9ef9869
Get enrichment results printed
iblacksand Dec 11, 2023
1f6d4d6
fix row name problem
iblacksand Dec 11, 2023
4275c79
Fix GSEA dataframes
iblacksand Dec 12, 2023
c74ca50
working report
iblacksand Dec 12, 2023
6bd89fc
switch to poolr and more link modification
iblacksand Dec 14, 2023
5f92d0e
Bump zerocopy from 0.7.26 to 0.7.31 in /src/rust
dependabot[bot] Dec 15, 2023
2b05244
fix gsea not showing top results
iblacksand Dec 15, 2023
2539db5
Fix single list results not showing sizes
iblacksand Dec 18, 2023
24dd980
Add enrichedSigs list and fix gsea wikipathways
iblacksand Dec 18, 2023
8c3f8a6
sanitize file name
iblacksand Dec 21, 2023
5491f78
set fdr as only sig method
iblacksand Dec 21, 2023
4aab506
remove bad print
iblacksand Dec 21, 2023
8bce38a
fix loading of lists with just one analyte type
iblacksand Dec 21, 2023
3d3e8d3
disable dags for multiomics temporarily
iblacksand Dec 21, 2023
a288b59
verify no dag for multi-lest
iblacksand Dec 21, 2023
820596c
wikipathways ORA multicoloring
iblacksand Dec 22, 2023
932e53d
fix wikipathways multi-coloring
iblacksand Dec 22, 2023
9bbedb7
add KEGG multicoloring
iblacksand Dec 23, 2023
ea25908
set bar graph as default for meta-analysis and upgrade to v0.5.0
iblacksand Jan 4, 2024
678ebf7
Merge pull request #8 from iblacksand/dependabot/cargo/src/rust/zeroc…
iblacksand Jan 4, 2024
479306e
update documentation
iblacksand Jan 4, 2024
b68ca52
Use gene symbols for wikipathways to avoid xreferencing
iblacksand Jan 10, 2024
ec01203
update to use dev version
iblacksand Jan 11, 2024
9139c5f
update package used
iblacksand Jan 11, 2024
ec318db
update to latest dev
iblacksand Jan 11, 2024
bcab3e5
Merge branch 'master' into update
iblacksand Jan 17, 2024
2f9c848
Merge pull request #10 from bzhanglab/update
iblacksand Jan 17, 2024
f4de204
Update lib to use git version and rename function calls
iblacksand Jan 18, 2024
9414952
remove multiomic:: calls
iblacksand Jan 18, 2024
f911344
Update webgestalt_lib to v0.2.0 (#12)
iblacksand Jan 18, 2024
0fdbd54
Fix issue #11 by reducing font size (#13)
iblacksand Jan 18, 2024
5a35dda
Update lib to use crate.io version and rename function calls (#14)
iblacksand Feb 2, 2024
f05d4c1
work on transitioning kegg gsea
iblacksand Feb 2, 2024
50f8936
fix multicoloring for kegg in gsea
iblacksand Feb 2, 2024
6c22445
kegg ora fix
iblacksand Feb 6, 2024
9e4f935
use white kegg maps
iblacksand Feb 19, 2024
75958d6
Fix des breakage and wikipathway coloring
iblacksand Feb 27, 2024
2fa8b73
fix FDR calculations for multi-list gsea
iblacksand Feb 29, 2024
8990aa3
add description and move github page link
iblacksand Feb 29, 2024
569b2d7
use github action instead of gh-pages for pages
iblacksand Feb 29, 2024
9bac130
Merge pull request #15 from iblacksand/gsea-coloring
iblacksand Feb 29, 2024
56fdbd0
updates permissions
iblacksand Feb 29, 2024
4048aff
use get_gmt for metabolite resolution. needs testing
iblacksand Feb 29, 2024
ac7fc19
add metabolite resolution with extra checks
iblacksand Mar 1, 2024
2c6c52e
update checkout action
iblacksand Mar 1, 2024
395f567
better id mapping error
iblacksand Mar 1, 2024
ec68aa2
Start work on moving rust to vendor and better cran checks
iblacksand Mar 1, 2024
acb8974
add windows config
iblacksand Mar 1, 2024
f6d0d7f
Merge pull request #16 from iblacksand/metabolite-resolution
iblacksand Mar 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix multicoloring for kegg in gsea
  • Loading branch information
iblacksand committed Feb 2, 2024
commit 50f89361ace88c336846f03f1f652dd6bd15bb18
11 changes: 0 additions & 11 deletions R/WebGestaltRMultiomicsGSEA.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,10 @@ WebGestaltRMultiOmicsGSEA <- function(analyteLists = NULL, analyteListFiles = NU
idsInSet[[enrichedSig$geneSet[[j]]]] <- unique(unlist(idsInSet[[enrichedSig$geneSet[[j]]]]))
enrichedSig$size[[j]] <- length(idsInSet[[enrichedSig$geneSet[[j]]]])
}
print(head(enrichedSig))
print(head(idsInSet))
for (k in seq_along(enrichedSig$link)) {

enrichedSig$link[[k]] <- metaLinkModification("GSEA", enrichedSig$link[[k]], idsInSet[[enrichedSig$geneSet[[k]]]], interestGeneMaps, hostName)
}
}
# if (organism != "others") {
# enrichedSig$link <- mapply(
# function(link, geneList) linkModification("GSEA", link, geneList, interestingGeneMap),
# enrichedSig$link,
# enrichedSig$leadingEdgeId
# )
# }

if ("database" %in% colnames(geneSet)) {
# add source database for multiple databases
enrichedSig <- enrichedSig %>% left_join(unique(geneSet[, c("geneSet", "database")]), by = "geneSet")
Expand Down
2 changes: 0 additions & 2 deletions R/createMetaReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ createMetaReport <- function(hostName = NULL, outputDirectory = NULL, organism =
allContent <- paste(allContent, "<b-tab-item label=\"", tabs[[i]]$title, "\"><iframe style=\"width: 100%\" src=\"", tabs[[i]]$path, "\"></iframe></b-tab-item>\n", sep = "")
}
allContent <- paste(allContent, "</b-tabs>\n", sep = "")
# tabs <- list(tabs = tabs)
print(toJSON(tabs))
header <- readLines(system.file("templates/header.mustache", package = "WebGestaltR"))
footer <- readLines(system.file("templates/footer.mustache", package = "WebGestaltR"))
template <- readLines(system.file("templates/meta_template.mustache", package = "WebGestaltR"))
Expand Down
77 changes: 38 additions & 39 deletions R/metaLinkModification.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte
modified_links <- c("www.kegg.jp", "www.wikipathways.org")
is_modified <- any(sapply(modified_links, function(x) any(grepl(x, enrichPathwayLink, fixed = TRUE))))
if (grepl("PathwayWidget", enrichPathwayLink, fixed = FALSE)) {
enrichPathwayLink <- gsub("www.wikipathways.org/wpi/PathwayWidget.php?id=", "pathway-viewer.toolforge.org/embed/", enrichPathwayLink, fixed=TRUE)
enrichPathwayLink <- gsub("www.wikipathways.org/wpi/PathwayWidget.php?id=", "pathway-viewer.toolforge.org/embed/", enrichPathwayLink, fixed = TRUE)
enrichPathwayLink <- paste0(enrichPathwayLink, "?")
} else if (grepl("kegg.jp", enrichPathwayLink, fixed = TRUE)) {
enrichPathwayLink <- gsub("show_pathway?", "show_pathway?map=", enrichPathwayLink, fixed=TRUE)
enrichPathwayLink <- gsub("show_pathway?", "show_pathway?map=", enrichPathwayLink, fixed = TRUE)
}
if (is_modified) {
for (i in seq_along(all_sets)) {
Expand All @@ -48,7 +48,6 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte
set_addition <- meta_keggMetaboliteLinkModification(enrichMethod, kegg_geneList, rampc_geneList, all_genes, interestingGeneMap, hostName, j)
kegg_colordbs[[length(kegg_colordbs) + 1]] <- set_addition
} else if (grepl("toolforge.org", enrichPathwayLink, fixed = TRUE)) {

mapped_genes <- simple_mapping(all_genes, "hsapiens", "rampc", "hmdb", "rampc", hostName, no_dups = TRUE)
if (is.null(mapped_genes)) {
next
Expand Down Expand Up @@ -76,12 +75,12 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte
color_string <- paste0(color_string, "+", color)
}
}
split_string <- "%0A"
split_string <- "%0d%0a"
if (j == 1) {
split_string <- ""
}
if (color_string != "") {
enrichPathwayLink <- paste0(enrichPathwayLink, gene, "+", color_string, split_string)
enrichPathwayLink <- paste0(enrichPathwayLink, gene, color_string, split_string)
}
}
}
Expand All @@ -100,7 +99,7 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte
entrez_geneList <- interestingGeneMap$mapped$geneSymbol[interestingGeneMap$mapped$geneSymbol %in% all_genes_symbol]
if (grepl("www.kegg.jp", enrichPathwayLink, fixed = TRUE)) {
set_addition <- meta_keggLinkModification(enrichMethod, entrez_geneList, all_genes_symbol, interestingGeneMap, hostName, j)
kegg_colordbs[[length(kegg_colordbs) + 1]] <- set_addition
kegg_colordbs[[length(kegg_colordbs) + 1]] <- set_addition
} else if (grepl("toolforge.org", enrichPathwayLink, fixed = TRUE)) {
set_addition <- meta_wikiLinkModification(enrichMethod, entrez_geneList, all_genes_symbol, interestingGeneMap, hostName, j)
enrichPathwayLink <- paste0(enrichPathwayLink, set_addition, "&")
Expand All @@ -111,23 +110,24 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte
enrichPathwayLink <- paste0(enrichPathwayLink, "&multi_query=")
}
for (j in seq_along(all_genes)) {
gene <- all_genes[[j]]
gene <- all_genes_symbol[[j]]
color_string <- ""
for (k in seq_along(kegg_colordbs)) {
color_db <- kegg_colordbs[[k]]
if (gene %in% color_db$analyte) {
color <- unique(unlist(color_db$color[color_db$analyte == gene]))
color <- unique(unlist(color_db$color[color_db$analyte == gene]))
color <- color[1]
color <- gsub("#", "%23", color, fixed = TRUE)
color_string <- paste0(color_string, "+", color)
}
}
split_string <- "%0A"
split_string <- "%0d%0a"
if (j == 1) {
split_string <- ""
}
if (color_string != "") {
enrichPathwayLink <- paste0(enrichPathwayLink, gene, "+", color_string, split_string)
entrez_gene <- mapping_table[mapping_table$all_genes_symbol == gene, "all_genes"]
enrichPathwayLink <- paste0(enrichPathwayLink, entrez_gene, color_string, split_string)
}
}
}
Expand All @@ -139,7 +139,7 @@ metaLinkModification <- function(enrichMethod, enrichPathwayLink, geneList, inte


meta_keggMetaboliteLinkModification <- function(enrichMethod, geneList, rampc_geneList, all_genes, interestingGeneMap, hostName, color_index) {
enrichPathwayLink <- ""
enrichPathwayLink <- ""
found <- sapply(geneList, function(x) x <- gsub("kegg:", "", x, ignore.case = TRUE))
not_found <- all_genes[!(all_genes %in% geneList)]
not_found <- sapply(not_found, function(x) x <- gsub("kegg:", "", x, ignore.case = TRUE))
Expand Down Expand Up @@ -206,36 +206,35 @@ meta_keggLinkModification <- function(enrichMethod, geneList, all_genes, interes
color_db$analyte <- unlist(color_db$analyte)
color_db$color <- unlist(color_db$color)
} else if (enrichMethod == "GSEA") {
scores <- filter(interestingGeneMap$mapped, .data$entrezgene %in% geneList)[["score"]]
maxScore <- max(scores)
minScore <- min(scores)
print(paste0("maxScore: ", maxScore, " minScore: ", minScore))
tmp <- getPaletteForGsea(maxScore, minScore)
palette <- tmp[[1]]
palette <- shift_colors(palette, color_index)
breaks <- tmp[[2]]
colors <- sapply(scores, function(s) palette[max(which(breaks <= s))])
for (i in seq_along(colors)) {
colors[[i]] <- gsub("#", "%23", colors[[i]], fixed = TRUE)
}
unique_colors <- unique(colors)
scores <- list()
for (i in seq_along(found)) {
color <- colors[[i]]
color_db$analyte[[i]] <- found[[i]]
color_db$color[[i]] <- color
scores[[i]] <- interestingGeneMap$mapped[interestingGeneMap$mapped$geneSymbol == found[[i]], "score"]
}
scores <- unlist(scores)
if (length(unlist(scores)) != 0) {
maxScore <- max(unlist(scores))
minScore <- min(unlist(scores))
tmp <- getPaletteForGsea(maxScore, minScore)
palette <- tmp[[1]]
palette <- shift_colors(palette, color_index)
breaks <- tmp[[2]]
colors <- sapply(scores, function(s) palette[max(which(breaks <= s))])
for (i in seq_along(colors)) {
colors[[i]] <- gsub("#", "%23", colors[[i]], fixed = TRUE)
}
for (i in seq_along(found)) {
color <- colors[[i]]
color_db$analyte[[i]] <- found[[i]]
color_db$color[[i]] <- color
}
}
# for (i in seq_along(unique_colors)) {
# color <- unique_colors[[i]]
# all_colored_genes <- found[[colors == color]]
# all_colored_genes <- paste(all_colored_genes, collapse = ",")
# enrichPathwayLink <- paste0(enrichPathwayLink, "&", color, "=", all_colored_genes)
# }
ora_white <- get_white(color_index)
# enrichPathwayLink <- paste0(enrichPathwayLink, "&", ora_white, "=")
for (i in seq_along(not_found)) {
color_db$analyte[[i + length(found)]] <- not_found[[i]]
color_db$color[[i + length(found)]] <- ora_white
}
color_db$analyte <- unlist(color_db$analyte)
color_db$color <- unlist(color_db$color)
}
return(color_db)
}
Expand Down Expand Up @@ -277,7 +276,7 @@ meta_wikiMetaboliteLinkModification <- function(enrichMethod, geneList, rampc_ge
for (i in seq_along(colors)) {
colors[[i]] <- gsub("#", "%23", colors[[i]], fixed = TRUE)
}
unique_colors = unique(colors)
unique_colors <- unique(colors)
for (i in seq_along(unique_colors)) {
color <- unique_colors[[i]]
all_colored_genes <- found[[colors == color]]
Expand All @@ -290,7 +289,7 @@ meta_wikiMetaboliteLinkModification <- function(enrichMethod, geneList, rampc_ge
enrichPathwayLink <- paste0(enrichPathwayLink, not_found[[i]], ",")
}
}

return(enrichPathwayLink)
}

Expand All @@ -308,7 +307,7 @@ meta_wikiLinkModification <- function(enrichMethod, geneList, all_genes, interes
ora_white <- get_white(color_index)
enrichPathwayLink <- paste0(enrichPathwayLink, "&", ora_white, "=")
for (i in seq_along(not_found)) {
enrichPathwayLink <- paste0(enrichPathwayLink,not_found[[i]], ",")
enrichPathwayLink <- paste0(enrichPathwayLink, not_found[[i]], ",")
}
} else if (enrichMethod == "GSEA") {
scores <- filter(interestingGeneMap$mapped, .data$entrezgene %in% geneList)[["score"]]
Expand All @@ -322,7 +321,7 @@ meta_wikiLinkModification <- function(enrichMethod, geneList, all_genes, interes
for (i in seq_along(colors)) {
colors[[i]] <- gsub("#", "%23", colors[[i]], fixed = TRUE)
}
unique_colors = unique(colors)
unique_colors <- unique(colors)
for (i in seq_along(unique_colors)) {
color <- unique_colors[[i]]
all_colored_genes <- found[[colors == color]]
Expand Down Expand Up @@ -363,4 +362,4 @@ shift_colors <- function(colors, shift) {
colors <- gsub("#", "0x", colors, fixed = TRUE)
colors <- paste0("#", sapply(colors, function(x) sprintf("%06x", strtoi(x) + shift)))
return(colors)
}
}