Skip to content

Instantly share code, notes, and snippets.

View GuangchuangYu's full-sized avatar
🎯
Focusing

Guangchuang Yu GuangchuangYu

🎯
Focusing
View GitHub Profile
@GuangchuangYu
GuangchuangYu / ss-pkg.R
Created April 19, 2019 06:14
R packages for semantic similarity measurement
d <- data.frame(pkg = c("GOSim", "GOSemSim", "DOSE", "meshes",
"DOSim", "HPOSim", "ppiPre", "MeSHSim", "meshr"),
year = c(2007, 2010, 2015, 2018, 2011, 2015, 2013, 2015, 2015),
journal = c("BMC Bioinformatics", rep("Bioinformatics", 3),
"BMC Bioinformatics", "PLoS One", "BMC Systems Biology",
"Journal of Bioinformatics and computational biology",
"BMC Bioinformatics"),
y = c(1, 1, 2, 3, 2, 4, 5, 2.8, 3.2))
require(ggplot2)
## devtools::install_github("stephenturner/msigdf")
library(msigdf)
library(dplyr)
library(clusterProfiler)
c2 <- msigdf.human %>%
filter(collection == "c2") %>% select(geneset, entrez) %>% as.data.frame
data(geneList)
de <- names(geneList)[1:100]
@GuangchuangYu
GuangchuangYu / Antithetic_variates.R
Created February 29, 2012 06:40
The antithetic variates method is a variance reduction technique used in Monte Carlo methods.
## Antithetic sampling reframes our estimate as a sum of negatively
## correlated random variables, using the fact that negative
## correlation reduces the variance of a sum.
## http://en.wikipedia.org/wiki/Antithetic_variates
g <- function(x) 1/(1+x)
N <- 1500
n <- 50
u1 <- matrix(runif(2 * n * N), ncol = n)