For each of the drugs and models of interest we would like to plot all of the dose response curves in the same cformat so that they can be combined.
knitr::opts_chunk$set(echo = TRUE) require(remotes) if(!require(mpnstXenoModeling)){ remotes::install_github('sgosline/mpnstXenoModeling') library(mpnstXenoModeling) } if(!require('DT')){ install.packages("DT") library(leapr) } library(dplyr) library(tidyr) library(ggrepel)
if(!exists("dataLoaded")){ dataLoaded=TRUE loadPDXData() mtDrugData <- loadMicrotissueDrugData() res<-loadPDXDrugData() pdxDrugStats<-res$summary drugData=res$dose }
We now want to plot drug performance across samples of interest, so we can do a side by side of drugs and their combinations.
##these are the drugs we want to evaluate!!! drug.list<-list(MirdaTrab=c('Mirdametinib','Mirdametinib;Trabectedin','Trabectedin'), OlaTrab=c('Olaparib','Olaparib;Trabectedin','Trabectedin'), ShpRibo=c('SHP099','Ribociclib;SHP099','Ribociclib'), ShpTram=c('SHP099','Trametinib','SHP099;Trametinib')) drug.list.inc<-lapply(drug.list,tolower) eval.drugs.pdx<-c('mirdametinib','mirdametinib+trabectedin','olaparib','trabectedin','ribociclib','trametinib','trametinib+ribociclib') eval.samps<-c('MN-2','WU-225','JH-2-079c','JH-2-031','MN-1','WU-368') eval.samps.inc <- c('MN-2', 'JH-2-079c') #other samples available: JHU 2-002, JHU 2-103
The first thing we need to do is establish good metrics for evaluating drug sensitivity. We experiment with a few here.
We are focusing on just 3 drugs and 2 combinations at this stage, across 4 PDX/MT/cell line combinations.
library(cowplot) mtd<-loadMicrotissueMetadata() mtDrugData<-getMicroTissueDrugData(mtd) ##commented this out as it doesn't work. lapply(names(drug.list), function(drugGroup) { mt.subs <- subset(mtDrugData, CellLine %in% eval.samps) %>% subset(DrugCol %in% drug.list[[drugGroup]]) samp.plots <- lapply(eval.samps, function(samp) plotMTTreatmentByDrug(mt.subs, samp)) ggsave( paste0('SampleMT', drugGroup, 'plots.png'), cowplot::plot_grid(plotlist = samp.plots, ncol = 2), height = 12, width = 12 ) drug.plots<-lapply(intersect(drug.list[[drugGroup]],mtDrugData$DrugCol), function(drug) plotMTTreatmentBySample(mt.subs,drug)) ggsave(paste0('DrugMT',drugGroup,'plots.png'), cowplot::plot_grid(plotlist = drug.plots,ncol=2),height=12,width=12) })
res=loadPDXDrugData() plots <- drugData %>% subset(Sample %in% eval.samps) %>% subset(drug %in% eval.drugs.pdx) %>% group_by(Sample, batch, .drop = F) %>% group_map( ~ plotPDXTreatmentBySample(.x), .keep = TRUE) ggsave('SamplePDXplots.png', cowplot::plot_grid(plotlist = plots, ncol = 2))
icyteData<-loadIncucyteData() lapply(names(drug.list.inc),function(drugGroup){ inc.subs<-subset(icyteData,model_system_name%in%eval.samps.inc)%>% subset(experimentalCondition%in%drug.list.inc[[drugGroup]]) inc.subs samp.plots<-lapply(eval.samps.inc,function(samp) plotIncTreatmentByDrug(inc.subs,samp)) ggsave(paste0('SampleInc',drugGroup,'plots.png'), cowplot::plot_grid(plotlist = samp.plots,ncol=2),height=6,width=12) # drug.plots<-lapply(intersect(drug.list[[drugGroup]],mtDrugData$DrugCol), # function(drug) plotMTTreatmentBySample(mt.subs,drug)) # ggsave(paste0('DrugMT',drugGroup,'plots.png'), # cowplot::plot_grid(plotlist = drug.plots,ncol=2),height=12,width=12) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.