cluster.patients: Clustering to find patient subtypes

Description Usage Arguments Value Author(s) Examples

View source: R/cluster.patients.R

Description

A wrapper function for using consensus clustering to subtype patients

Usage

1
2
3
4
cluster.patients(data.matrix, distance.metric, parent.output.dir,
new.result.dir, subtype.table.file = NULL, max.num.subtypes = 12, 
clustering.reps = 1000, proportion.features = 0.8, proportion.patients = 0.8, 
verbose = FALSE, consensus.cluster.write.table = TRUE);

Arguments

data.matrix

matrix with patients as rows and features as columns

distance.metric

distance metric for comparing patient profiles. ex. euclidean

parent.output.dir

directory where the consensus clustering function will create a directory of results

new.result.dir

directory name for consensus clustering results

subtype.table.file

filename for subtype assignment table for different number of clusters

max.num.subtypes

maximum number of clusters to separate patients into

clustering.reps

number of subsamples for consensus clustering function

proportion.features

proportion of features to sample for each clustering iteration

proportion.patients

proportion of patients to sample for each clustering iteration

verbose

logical, where TRUE indicates to print messages to the screen to indicate progress

consensus.cluster.write.table

logical, where TRUE indicates for the ConsensusClusterPlus function to writeTable

Value

consensus_cluster_result

consensus clustering function return value

subtype_table

the table written to subtype.table.file

Author(s)

Natalie Fox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Not run: 

# For this example instead of clustering CIS and IRF matrices,
# create a data matrix to see how the function works without
# running through the whole iSubGen process.
# This example is created with to have 4 distinct clusters
set.seed(5);
ex.matrix <- matrix(
  c(
    sample(c(0,1), 30, replace = TRUE), rep(1,75), rep(0,25),
    sample(c(0,1), 30, replace = TRUE), rep(1,75), rep(0,25),
    sample(c(0,1), 30, replace = TRUE), rep(1,75), rep(0,25),
    sample(c(0,1), 30, replace = TRUE), rep(1,100),
    sample(c(0,1), 30, replace = TRUE), rep(1,100),
    sample(c(0,1), 30, replace = TRUE), rep(1,100),
    sample(c(0,1), 30, replace = TRUE), rep(0,100),
    sample(c(0,1), 30, replace = TRUE), rep(0,100),
    sample(c(0,1), 30, replace = TRUE), rep(0,100),
    sample(c(0,1), 30, replace = TRUE), rep(0,75), rep(1,25),
    sample(c(0,1), 30, replace = TRUE), rep(0,75), rep(1,25),
    sample(c(0,1), 30, replace = TRUE), rep(0,75), rep(1,25)
    ),
  nrow=130);
rownames(ex.matrix) <- paste0('gene',1:130);
colnames(ex.matrix) <- paste0('patient',LETTERS[1:12]); 

# Use Consensus clustering to subtype the patient profiles
subtyping.results <- cluster.patients(
  data.matrix = ex.matrix,
  distance.metric = 'euclidean',
  parent.output.dir = './',
  new.result.dir = 'example_subtyping',
  max.num.subtypes = 6,
  clustering.reps = 50,
  consensus.cluster.write.table = FALSE
  );	

## End(Not run)

iSubGen documentation built on April 22, 2021, 5:11 p.m.