Functions to calculate distance matrices using cpu or gpu computing

calculate_distance_pearson_gpu(x)

calculate_distance_spearman_gpu(x)

calculate_distance_uncentered_gpu(x)

calculate_distance_euclidean_gpu(x)

calculate_distance_pearson_cpu(x)

calculate_distance_spearman_cpu(x)

calculate_distance_uncentered_cpu(x)

calculate_distance_euclidean_cpu(x)

select_distance(distancetype = "pearson", usegpu = TRUE)

Arguments

x

an expression matrix with features as rows and samples as columns

distancetype

a character that can be either 'pearson', 'uncentered', 'spearman' or 'euclidean'

usegpu

logical TRUE or FALSE

Value

select_distance(distancetype, usegpu) assigns global function calculate_distance according to the parameters specified

calculate_distance_pearson_gpu(x) returns columnwise pearson distance calculated using the GPU

calculate_distance_pearson_cpu(x) returns columnwise pearson distance calculated using the CPU

calculate_distance_uncentered_gpu(x) returns columnwise uncentered pearson distance calculated using the GPU

calculate_distance_uncentered_cpu(x) returns columnwise uncentered pearson distance calculated using the CPU

calculate_distance_spearman_gpu(x) returns columnwise spearman distance calculated using the GPU

calculate_distance_spearman_cpu(x) returns columnwise spearman distance calculated using the CPU

calculate_distance_euclidean_gpu(x) returns columnwise euclidean distance calculated using the GPU

calculate_distance_euclidean_cpu(x) returns columnwise euclidean distance calculated using the CPU

Examples

if (FALSE) { rna_luad<-use_rna_luad() prm <- rna_luad$TCGA$expression_matrix #Will select the calculate_distance_pearson_cpu() function to calculate the distance matrix calculate_distance<-select_distance(distancetype= "pearson", usegpu=FALSE) calculate_distance(prm) }