Mercurial > repos > dktanwar > test_fgsea_1
changeset 2:9e75d29c2409 draft default tip
Uploaded
author | dktanwar |
---|---|
date | Mon, 18 Dec 2017 21:08:31 -0500 |
parents | 91eed1b5c009 |
children | |
files | 16_fgsea/GSEA.R |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/16_fgsea/GSEA.R Tue Dec 12 21:19:55 2017 -0500 +++ b/16_fgsea/GSEA.R Mon Dec 18 21:08:31 2017 -0500 @@ -12,6 +12,7 @@ library("getopt") library("fgsea") library("Rcpp") +library("data.table") options(stringAsfactors = FALSE, useFancyQuotes = FALSE) @@ -35,8 +36,11 @@ # cat("\n output: ", options$output) # Rank file -ranks <- read.table(options$input1, header=F, colClasses = c("character", "numeric")) -ranks <- setNames(ranks[,2], ranks[,1]) +ranks <- fread(options$input1, header=T, stringsAsFactors = F) +ranks <- data.frame(ranks) +r <- ranks[abs(ranks$logFC) >= 0.5 & ranks$PValue <= 0.05,] +r <- r[,c(1, 2)] +ranks <- setNames(r[,2], r[,1]) # Pathways database pathways <- gmtPathways(options$input2)