if (FALSE) {
# 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
);
}
Run the code above in your browser using DataLab