Skip to content

assaron/rgperftools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package provides a simple interface to run google perftools in R.

The package requires libgoogle-perftools-dev and google-perftools packages to be installed:

On Debian/Ubuntu run:

sudo apt install google-perftools libgoogle-perftools-dev

Install the package:

devtools::install_github("assaron/rgperftools")

Loading package:

library(rgperftools)

We'll be profiling fgsea:

library(fgsea)
data(exampleRanks)
data(examplePathways)

Running fgsea wrapped in profiler:

profOut <- tempfile("prof")
start_profiler(profOut)
fr <- fgseaMultilevel(examplePathways, exampleRanks, eps=0)
stop_profiler()

To get the visualization of results we first need path to used fgsea.so:

fgseaSoPath <- getLoadedDLLs()[["fgsea"]][["path"]]
fgseaSoPath
## [1] "/home/alserg/R/x86_64-pc-linux-gnu-library/3.6/fgsea/libs/fgsea.so"

And now we can explore the profiler output with google-pprof:

profOutSvg <- paste0(profOut, ".gif")
system2("google-pprof", args=c("--gif", fgseaSoPath, profOut), 
        stdout=profOutSvg)

Here is the result:

About

Wrapper for running gperftools in R

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published