Reproducibility
I list below the R packages required to reproduce the analyses.
Except stated otherwise, all correlation matrices have been computed using Pearson Correlation, provided by the stats::cor
function.
Compute Drug-drug Similarities
Drug By Drug Heatmaps
- Heatmap in Figure 3.1 is generated at the replicate level:
- Heatmap in Figure 3.2 is generated by averaging normalised barcode counts over replicates:
- Heatmap at the compound by batch level in Figure 3.4 (aggregated over technical replicates):
Drug-Drug Networks
Code
filename_drug <- paste0("./figures/drug-drug networks/replicate-normalised-drug-drug_", today_date)
n_pairwise_comparisons <- (ncol(dge_normalised_replicate) * (ncol(dge_normalised_replicate) - 1))/2
igraph_normalised_replicates <- compute_drug_networks(dge_normalised_replicate,
filename_drug = filename_drug,
title_graph = "Drug by drug network, after normalisation",
graph_date = today_date,
pval_threshold = 0.05/n_pairwise_comparisons, # basic FWER approach
cor_threshold = 0.8,
export_graph = FALSE)
knitr::include_graphics(paste0(filename_drug, ".png"),
dpi = 200, auto_pdf = TRUE)
Code
filename_drug <- paste0("./figures/drug-drug networks/sample-normalised-drug-drug_", today_date)
n_pairwise_comparisons <- (ncol(dge_normalised_samples) * (ncol(dge_normalised_samples) - 1))/2
igraph_normalised_samples <- compute_drug_networks(dge_normalised_samples,
filename_drug = filename_drug,
title_graph = "Drug by drug network, after normalisation",
graph_date = today_date,
pval_threshold = 0.05/n_pairwise_comparisons, # basic FWER approach
cor_threshold = 0.8)
knitr::include_graphics(paste0(filename_drug, ".png"),
dpi = 200, auto_pdf = TRUE)
Code
filename_drug <- paste0("./figures/drug-drug networks/replicate-binarised-drug-drug_", today_date)
n_pairwise_comparisons <- (ncol(dge_binarised_replicate) * (ncol(dge_binarised_replicate) - 1))/2
igraph_binarised_replicates <- compute_drug_networks(dge_binarised_replicate,
filename_drug = filename_drug,
title_graph = "Drug by drug network, after binarisation",
graph_date = today_date,
pval_threshold = 0.05/n_pairwise_comparisons, # basic FWER approach
cor_threshold = 0.4,
export_graph = FALSE)
knitr::include_graphics(paste0(filename_drug, ".png"),
dpi = 200, auto_pdf = TRUE)
Code
filename_drug <- paste0("./figures/drug-drug networks/sample-binarised-drug-drug_", today_date)
n_pairwise_comparisons <- (ncol(dge_binarised_samples) * (ncol(dge_binarised_samples) - 1))/2
igraph_binarised_samples <- compute_drug_networks(dge_binarised_samples,
filename_drug = filename_drug,
title_graph = "Drug by drug network, after binarisation",
graph_date = today_date,
pval_threshold = 0.05/n_pairwise_comparisons, # basic FWER approach
cor_threshold = 0.4)
knitr::include_graphics(paste0(filename_drug, ".png"),
dpi = 200, auto_pdf = TRUE)
Find top hits for a given drug target
Code
# Returns all shared neighbours for Pemetrexed
binarised_graph <- igraph_binarised_samples$igraph_object
Pemetrexed_vertices <- igraph::V(binarised_graph)[grepl("Pemetre", name)]
neigh_list <- lapply(Pemetrexed_vertices, function(v)
igraph::neighbors(binarised_graph, v = Pemetrexed_vertices))
do.call(igraph::intersection, neigh_list)
## + 14/128 vertices, named, from 98b7c50:
## [1] 5-Fluorouracil_exp070222_Conc: 6 uM_Days: 9_
## [2] Bortezomib_exp200921_Conc: 20 nM_Days: 9_
## [3] Bortezomib_exp271221_Conc: 20 nM_Days: 9_
## [4] Cisplatin_exp181021_Conc: 500 nM_Days: 9_
## [5] L-755507_exp220322_Conc: 25 uM_Days: 9_
## [6] MG132_exp271221_Conc: 510 nM_Days: 9_
## [7] Pemetrexed_exp040821_Conc: 100 nM_Days: 9_
## [8] Pemetrexed_exp181021_Conc: 80 nM_Days: 9_
## [9] Pemetrexed_exp281022_time_course_Conc: 100 nM_Days: 19_
## [10] Pemetrexed_exp281022_time_course_Conc: 100 nM_Days: 30_
## + ... omitted several vertices
## Top hits normalised
cor_normalised_compound <- igraph_normalised_samples$cor_pearson
pval_normalised_compound <- igraph_normalised_samples$cor_pval
top_scores_X13271_normalised <- compute_top_hits(vertice_names = c("X13271_exp200921_Conc: 8 uM_Days: 9_",
"X13271_exp271221_Conc: 9 uM_Days: 9_"),
cor_mat = cor_normalised_compound,
pval_mat = pval_normalised_compound)
## Top hits binarised
cor_binarised_compound <- igraph_binarised_samples$cor_pearson
pval_binarised_compound <- igraph_binarised_samples$cor_pval
# grep("X13271", colnames(cor_binarised_compound), value = TRUE)
top_scores_X13271_binarised <- compute_top_hits(vertice_names = c("X13271_exp200921_Conc: 8 uM_Days: 9_",
"X13271_exp271221_Conc: 9 uM_Days: 9_"),
cor_mat = cor_binarised_compound,
pval_mat = pval_binarised_compound)
openxlsx::write.xlsx(list(normalised_X13271 = top_scores_X13271_normalised |>
dplyr::filter(!grepl("^Contro", top_hits)),
binarised_X13271 = top_scores_X13271_binarised),
file = paste0("./results/top_hits/X13271_", today_date, ".xlsx"),
asTable = TRUE)
Compute Cell Lines Similarities
Cell Line by Drug Heatmap
Cell Line By Cell Line Heatmap