# 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 integrative similarity between pairs of CNA, coding SNVs, methylation data
corr.matrix <- calculate.integrative.similarity.matrix(
data.types = names(molecular.data),
data.matrices = molecular.data,
dist.metrics = list(
cna = 'euclidean',
snv = 'euclidean',
methy = 'euclidean'
)
);
# Example 2: calculate the integrative similarity 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.integrative.similarity.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)
);
# Example 3: Calculate integrative similarity between CNA and methylation data
corr.matrix3 <- calculate.integrative.similarity.matrix(
data.types=names(molecular.data)[c(1,3)],
data.matrices=molecular.data[c(1,3)],
dist.metrics=list(
cna='euclidean',
snv='euclidean',
methy='euclidean'
)[c(1,3)],
patients.to.return=paste0('EP00',1:9),
patients.for.correlations=paste0('EP0',10:30)
);
Run the code above in your browser using DataLab