# Load molecular profiles for three data types from example files saved
# in the package as _profiles.txt
example.molecular.data.dir <- paste0(path.package('iSubGen'),'/exdata/');
molecular.data <- list();
for (i in c('cna','snv','methy')) {
molecular.data[[i]] <- load.molecular.aberration.data(
paste0(example.molecular.data.dir,i,'_profiles.txt'),
patients = c(paste0('EP00',1:9), paste0('EP0',10:30))
);
}
# Example 1: calculate the consensus integrative similarity (CIS) matrix
corr.matrix <- calculate.cis.matrix(
data.types = names(molecular.data),
data.matrices = molecular.data,
dist.metrics = list(
cna = 'euclidean',
snv = 'euclidean',
methy = 'euclidean'
),
print.intermediary.similarity.matrices.to.file = FALSE
);
# Example 2: calculate the CIS matrix for patients EP001 through EP009 in relation
# to patients EP010 through EP030 meaning the profile of EP001 is correlated to
# the profiles of EP010 through EP030 so when assessing new patients, they can be
# compared to the training profiles
corr.matrix2 <- calculate.cis.matrix(
data.types = names(molecular.data),
data.matrices = molecular.data,
dist.metrics = list(
cna = 'euclidean',
snv = 'euclidean',
methy = 'euclidean'
),
patients.to.return = paste0('EP00',1:9),
patients.for.correlations = paste0('EP0',10:30),
print.intermediary.similarity.matrices.to.file = FALSE
);
# Example 3: Adjusting the proportion of the features that will be used to correlate
# the patient profiles
corr.matrix3 <- calculate.cis.matrix(
data.types = names(molecular.data),
data.matrices = molecular.data,
dist.metrics = list(
cna = 'euclidean',
snv = 'euclidean',
methy = 'euclidean'
),
patients.to.return = paste0('EP00',1:9),
patients.for.correlations = paste0('EP0',10:30),
feature.proportion = 0.6,
print.intermediary.similarity.matrices.to.file = FALSE
);
Run the code above in your browser using DataLab