/ROKET

This R package repository performs optimal transport and kernel regression hypothesis testing. Functions to perform large scale simulations are also provided.

Primary LanguageRGNU General Public License v3.0GPL-3.0

C++ R CRAN status DOI Project Status: Active - The project has reached a stable, usable state and is being actively developed.

This package is designed to perform optimal transport and hypothesis testing on kernel matrices when performing kernel regression. The software is optimized for calculating distance between pairs of samples based on the pairs of mutated gene statuses.

Installation

Click to expand!
# Dependencies
req_packs = c("devtools","Rcpp","RcppArmadillo","reshape2",
	"ggdendro","smarter","MiRKAT","ggplot2","ROKET")
all_packs = as.character(installed.packages()[,1])
rerun = 0
build_vign = ifelse(Sys.getenv("RSTUDIO_PANDOC") == "",FALSE,TRUE)

for(pack in req_packs){
	if( pack %in% all_packs ){
		library(package = pack,character.only = TRUE)
		next
	}
	
	bb = NULL
	if( pack %in% c("smarter","ROKET") ){
		repo = sprintf("pllittle/%s",pack)
		bb = tryCatch(devtools::install_github(repo = repo,
			build_vignettes = build_vign,
			dependencies = TRUE),
			error = function(ee){"error"})
	} else {
		bb = tryCatch(install.packages(pkgs = pack,
			dependencies = TRUE),
			error = function(ee){"error"})
	}
	
	if( !is.null(bb) && bb == "error" )
		stop(sprintf("Error for package = %s",pack))
	rerun = 1
}

if( rerun == 1 ) stop("Re-run above code")

By default, the software runs a single thread and loops through all pairs of samples for distance calculations. However if OpenMP is installed, the user can make use of multi-threaded calculations.

Vignette

# An Introduction
vignette(topic = "intro",package = "ROKET")

Citation

Little, P., Hsu, L., Sun, W. (2022). Associating Somatic Mutation with Clinical Outcomes through Kernel Regression and Optimal Transport. Biometrics. [HTML, PDF, SUPP]

Workflow

R package and code to perform the manuscript's workflow are provided here.