SpeedSage Intro

qusage is published software that is slow for large runs, SpeedSage corrects for speed and efficiency at large orders. there is Bottlenecking of Functions Qusage can improve the speed of its algorithm by minimizing the cost of computaiton.

changes Armadillo C++

trading NA flexibility slows down qusage runs, but having the user input no NAs enforcing good input, this speeds up calcIndividualExpressions, as well as using C++ libraries.

library(inline)
library(microbenchmark)
library(Rcpp)
library(parallel)
library(speedSage)
library(qusage)
library(ggplot2)
eset<-system.file("extdata","eset.RData",package="speedSage")
load(eset)
labels<-c(rep("t0",134),rep("t1",134))
contrast<-"t1-t0"
colnames(eset)<-c(rep("t0",134),rep("t1",134))
fileISG<-system.file("extdata","c2.cgp.v5.1.symbols.gmt",package="speedSage")
ISG.geneSet<-read.gmt(fileISG)
geneSets<-ISG.geneSet[grepl("DER_IFN_GAMMA_RESPONSE_UP",names(ISG.geneSet))]

#cpp functions
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/sigmaArm.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/sigmaSingle.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/bayesEstimation.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/notbayesEstimation.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/calcVIFarm.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/calcVIFarmalt.cpp")
sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/calcVIFarm_nosdalphaalt.cpp")

pairVector<-NULL
var.equal<-FALSE
filter.genes<-FALSE
n.points<-2^12


#setting up calcVif call objects
source("/home/arcolombo/Documents/github_repos/SpeedSage/R/qusageArm.R")
useAllData<-TRUE
useCAMERA<-FALSE
##### QuSage::qusage default calc
defaultSage<-qusage(eset,labels,contrast,geneSets,var.equal=FALSE)
mySage<-qusageArm(eset,labels,contrast,geneSets,var.equal=FALSE)

```r library(speedSage) useCAMERA<-FALSE sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/calcVIFarmalt.cpp") sourceCpp(file="/home/arcolombo/Documents/github_repos/SpeedSage/R/calcVIFarm_nosdalphaalt.cpp")

library(ggplot2) speedUp<-microbenchmark( defaultSage<-qusage(eset,labels,contrast,geneSets,var.equal=FALSE), mySage<-qusageArm(eset,labels,contrast,geneSets,var.equal=FALSE), times=1000)

autoplot(speedUp) speedUp

library(profr) defaultX<-profr(qusage(eset,labels,contrast,geneSets,var.equal=FALSE)) myX<-profr(qusageArm(eset,labels,contrast,geneSets,var.equal=FALSE))

default qusage

ggplot(defaultX)

with armadillo plot

ggplot(myX)



arcolombo/junk documentation built on May 10, 2019, 12:49 p.m.