nicolash2 / gggsea Goto Github PK
View Code? Open in Web Editor NEWGSEA plots in ggplot2
GSEA plots in ggplot2
I am running fgsea and then using gggsea to generate enrichment plots. The fgsea function runs fine and generates the expected output. But when I try to run gseaCurve on the results, I am getting the following error:
Error in dplyr::nth()
:
! Can't convert from n
to due to loss of precision.
• Locations: 1
#the code I used is given below
#----------------------------------------------------------------------------------------------------
#run fgsea
fgseaRes = fgsea(pathways = wiki,
stats = ranks,
eps = 0,
minSize = 15,
maxSize = 250)
#---------------------------------------------------------------------------------------------------------------
#see top 6 rows of fgsea output
head(fgseaRes[order(pval),])
pathway pval padj log2err ES NES size
1: WP_CYTOPLASMIC_RIBOSOMAL_PROTEINS 1.447420e-06 0.0006064688 0.6435518 0.5371137 2.041871 86
2: WP_MIRNA_TARGETS_IN_ECM_AND_MEMBRANE_RECEPTORS 1.549642e-04 0.0324649906 0.5188481 -0.7044984 -2.018585 21
3: WP_PI3KAKT_SIGNALING_PATHWAY 5.404412e-04 0.0754816230 0.4772708 -0.3456294 -1.521484 210
4: WP_FOCAL_ADHESION 8.625880e-04 0.0903560961 0.4772708 -0.3736142 -1.577802 156
5: WP_FOCAL_ADHESION_PI3KAKTMTORSIGNALING_PATHWAY 1.350562e-03 0.1042326774 0.4550599 -0.3365220 -1.481279 208
6: WP_OXIDATIVE_PHOSPHORYLATION 1.646682e-03 0.1042326774 0.4550599 0.4791410 1.705835 59
leadingEdge
1: RPL18A,RPS15,RPL29,RPL10,RPS11,RPL28,...
2: COL3A1,COL5A3,THBS2,LAMA4,COL4A1,COL1A2,...
3: PIK3CD,IL7R,PGF,EFNA1,FGF1,KDR,...
4: PIK3CD,PGF,HCK,KDR,COL1A1,ITGA8,...
5: PIK3CD,IL7R,PGF,EFNA1,FGF1,KDR,...
6: NDUFA4L2,NDUFA3,NDUFS7,ATP5F1D,ATP5MC2,NDUFS6,...
#-------------------------------------------------------------------------------------------------------------------------
#run gggsea
devtools::install_github("nicolash2/gggsea")
library(gggsea)
#call sorted ranked file and selected pathways file
rl = ranks
setlist = wiki[topPathways]
res = gseaCurve(rl, setlist, fgseaRes)
Error indplyr::nth()
:
! Can't convert fromn
to due to loss of precision.
• Locations: 1
Runrlang::last_error()
to see where the error occurred.
#backtrace of the error
Backtrace:
▆
└─gggsea (local) `<fn>`(set = dots[[1L]][[1L]], setname = dots[[2L]][[1L]])
├─base::merge(...)
├─base::merge.data.frame(...)
│ ├─base::nrow(y <- as.data.frame(y))
│ └─base::as.data.frame(y)
└─gggsea:::.colorGradient(rl, lowestPoint, sizeFactor)
├─base::unlist(...)
└─base::lapply(...)
└─gggsea (local) FUN(X[[i]], ...)
└─**dplyr::nth(sort(abs(rl)), length(rl) * x)**
└─vctrs::vec_cast(n, to = integer(), x_arg = "n")
└─vctrs (local) `<fn>`()
└─vctrs:::vec_cast.integer.double(...)
└─vctrs::maybe_lossy_cast(...)
├─base::withRestarts(...)
│ └─base (local) withOneRestart(expr, restarts[[1L]])
│ └─base (local) doWithOneRestart(return(expr), restart)
└─vctrs:::stop_lossy_cast(...)
└─vctrs::stop_incompatible_cast(...)
└─vctrs::stop_incompatible_type(...)
└─vctrs:::stop_incompatible(...)
└─vctrs:::stop_vctrs(...)
└─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = vctrs_error_call(call))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.