create_centroids: Create Centroids

Description Usage Arguments Value Examples

View source: R/results_functions.R

Description

This functions create the signature centroids estimated from the GalgoR output and the expression matrix of the training sets.

Usage

1
2
create_centroids(output, solution.names, train.set,
  distancetype = "pearson", usegpu = FALSE)

Arguments

output

@param output An object of class galgo.Obj

solution.names

A character vector with the names of the solutions for which the centroids are to be calculated

train.set

a matrix or data.frame. Must be an expression matrix with features in rows and samples in columns

distancetype

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

usegpu

logical TRUE or FALSE

Value

Returns a list with the centroid matrix for each of the solutions in solution.names, where each column represents the prototypic centroid of a subtype and each row the constituents features of the solution signature

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Load data
rna_luad <- use_rna_luad()
TCGA_expr <- rna_luad$TCGA$expression_matrix
TCGA_clinic <- rna_luad$TCGA$pheno_data
OS <- survival::Surv(time = TCGA_clinic$time, event = TCGA_clinic$status)

# Run galgo
output <- galgoR::galgo(generations = 10, population = 30, prob_matrix = TCGA_expr, OS = OS)
RESULTS <- non_dominated_summary(
  output = output, OS = OS,
  prob_matrix = TCGA_expr,
  distancetype = "pearson",
  usegpu = FALSE
)
CentroidsList <- create_centroids(output, RESULTS$solution, train.set = TCGA_expr)

## End(Not run)

harpomaxx/galgo documentation built on Aug. 11, 2020, 3:07 p.m.