Main information can be foud in this page: https://www.synapse.org/#!Synapse:syn20940518/wiki/600165
Example of a model created:
## [1] "list"
## [1] "17-AAG (Tanespimycin)" "A-674563"
## [3] "ABT-737" "Afatinib (BIBW-2992)"
## [5] "Alisertib (MLN8237)" "AT7519"
## [7] "Axitinib (AG-013736)" "AZD1480"
## [9] "Barasertib (AZD1152-HQPA)" "Bay 11-7085"
## [11] "BEZ235" "BI-2536"
## [13] "BMS-345541" "Bortezomib (Velcade)"
## [15] "Bosutinib (SKI-606)" "Cabozantinib"
## [17] "Canertinib (CI-1033)" "Cediranib (AZD2171)"
## [19] "CHIR-99021" "CI-1040 (PD184352)"
## [21] "Crenolanib" "Crizotinib (PF-2341066)"
## [23] "CYT387" "Dasatinib"
## [25] "DBZ" "Doramapimod (BIRB 796)"
## [27] "Dovitinib (CHIR-258)" "Elesclomol"
## [29] "Entospletinib (GS-9973)" "Entrectinib"
## [31] "Erlotinib" "Flavopiridol"
## [33] "Foretinib (XL880)" "GDC-0879"
## [35] "GDC-0941" "Gefitinib"
## [37] "Gilteritinib (ASP-2215)" "Go6976"
## [39] "GSK-1838705A" "GSK-1904529A"
## [41] "GSK690693" "GW-2580"
## [43] "Ibrutinib (PCI-32765)" "Idelalisib"
## [45] "Imatinib" "INK-128"
## [47] "JAK Inhibitor I" "JNJ-28312141"
## [49] "JNJ-38877605" "JNJ-7706621"
## [51] "JQ1" "KI20227"
## [53] "KU-55933" "KW-2449"
## [55] "Lapatinib" "Lenalidomide"
## [57] "Lenvatinib" "Lestaurtinib (CEP-701)"
## [59] "Linifanib (ABT-869)" "Lovastatin"
## [61] "LY-333531" "Masitinib (AB-1010)"
## [63] "MGCD-265" "Midostaurin"
## [65] "MK-2206" "MLN120B"
## [67] "MLN8054" "Motesanib (AMG-706)"
## [69] "Neratinib (HKI-272)" "NF-kB Activation Inhibitor"
## [71] "Nilotinib" "Nutlin 3a"
## [73] "NVP-ADW742" "NVP-TAE684"
## [75] "Palbociclib" "Panobinostat"
## [77] "Pazopanib (GW786034)" "PD173955"
## [79] "Pelitinib (EKB-569)" "PHA-665752"
## [81] "PHT-427" "PI-103"
## [83] "PLX-4720" "Ponatinib (AP24534)"
## [85] "PP242" "PRT062607"
## [87] "Quizartinib (AC220)" "RAF265 (CHIR-265)"
## [89] "Rapamycin" "Regorafenib (BAY 73-4506)"
## [91] "Roscovitine (CYC-202)" "Ruxolitinib (INCB018424)"
## [93] "S31-201" "Saracatinib (AZD0530)"
## [95] "SB-431542" "Selinexor"
## [97] "Selumetinib (AZD6244)" "SGX-523"
## [99] "SNS-032 (BMS-387032)" "Sorafenib"
## [101] "SR9011" "Staurosporine"
## [103] "STO609" "SU11274"
## [105] "Sunitinib" "Tandutinib (MLN518)"
## [107] "TG100-115" "TG101348"
## [109] "Tivozanib (AV-951)" "Tofacitinib (CP-690550)"
## [111] "Tozasertib (VX-680)" "Trametinib (GSK1120212)"
## [113] "Vandetanib (ZD6474)" "Vargetef"
## [115] "Vatalanib (PTK787)" "Vemurafenib (PLX-4032)"
## [117] "Venetoclax" "Vismodegib (GDC-0449)"
## [119] "Volasertib (BI-6727)" "VX-745"
## [121] "XAV-939" "YM-155"
## Random Forest
##
## 184 samples
## 1000 predictors
##
## No pre-processing
## Resampling: Cross-Validated (10 fold, repeated 3 times)
## Summary of sample sizes: 165, 165, 164, 165, 166, 167, ...
## Resampling results:
##
## RMSE Rsquared MAE
## 38.41165 0.3336447 31.06616
##
## Tuning parameter 'mtry' was held constant at a value of 31.63858
Subchallenge 1 (Source: https://www.synapse.org/#!Synapse:syn20940518/wiki/600161)
Predict ex-vivo drug sensitivity using clinical and genomic features of tumors. Drug sensitivity is measured as the area under the dose response curve (AUC).
Assessment Each drug will be evaluated using a Spearman correlation([0, 1]), and the Spearman correlations will be averaged to produce a final metric. (Davidson-Pilon et al. 2019)
Output The Docker container must write a csv at /output/predictions.csv
with one row per (specimen, inhibitor) pair and three columns:
The list of all inhibitors can be pulled from aucs.csv.
#------------------------------------------------
# Dream challange SC1 prediction Rscript
# - Drescription:
# Reads input files in /input/ folder
# Use models to predict drug score
# Output prediction scores in /output/ folder
# - Author: Tiago C. Silva
# - Date: 02/12/2020
#------------------------------------------------
#--------------------------------------
# Loading libraries
#--------------------------------------
library(readr, quietly = TRUE)
library(plyr, quietly = TRUE)
library(dplyr, quietly = TRUE)
library(caret, quietly = TRUE)
library(matrixStats, quietly = TRUE)
#--------------------------------------
# INPUT
#--------------------------------------
# Reading the data
input.dir <- "/input/"
input.files <- dir(input.dir,full.names = TRUE)
input.dfs <- lapply(input.files, function(f) read_csv(f,col_types = readr::cols()))
names(input.dfs) <- gsub(".csv","",basename(input.files))
# Treating input the same way input training data
rna <- input.dfs$rnaseq[,-c(1:2)] %>% t %>% as.data.frame()
colnames(rna) <- input.dfs$rnaseq$Symbol
rna.var.order.idx <- rna %>% as.matrix %>% colVars %>% order(decreasing = TRUE)
rna.zscore <- apply(rna, 2,scale) %>% as.data.frame()
rownames(rna.zscore) <- rownames(rna)
#--------------------------------------
# MODEL
#--------------------------------------
model <- readRDS("/usr/local/bin/modelsSC1_rna_seq_only.rds")
# Prediction
output_df <- plyr::adply(names(model),1,function(drug){
variables <- names(model[[1]]$trainingData)[-1]
auc <- predict(model[[drug]], rna.zscore)
data.frame("lab_id" = names(auc),
"inhibitor" = rep(drug,length(auc)),
"auc" = auc)
},.progress = "time",.inform = TRUE,.id = NULL)
#--------------------------------------
# Output
#--------------------------------------
output.dir <- "/output/"
write_csv(output_df, file.path(output.dir,"predictions.csv"))
Your docker file will create the enviroment you need to run the prediction model. You will need to install the required libraries, add the models into it, and create an Rscript to predict and output the data.
Observation: FROM r-base
will provide R 3.6.2.
## Start from this Docker image
FROM r-base
## Install R in Docker image
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y r-base
## Install R packages in Docker image
RUN Rscript -e "install.packages('BiocManager')"
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos = r);" > ~/.Rprofile
RUN Rscript -e "install.packages('readr')"
RUN Rscript -e "install.packages('caret')"
RUN Rscript -e "install.packages('matrixStats')"
RUN Rscript -e "install.packages('ranger')"
RUN Rscript -e "install.packages('randomForest')"
## Copy your files into Docker image
COPY run_model_SC1.R /usr/local/bin/
COPY models/modelsSC1_rna_seq_only.rds /usr/local/bin/
RUN chmod a+x /usr/local/bin/run_model_SC1.R
## Make Docker container executable
ENTRYPOINT ["Rscript", "/usr/local/bin/run_model_SC1.R"]
The script below is an example to make it easier to:
./submit.sh build
./submit.sh test
./submit.sh send
The SYNAPSE_PROJECT_ID
should be modified by each student. To make the bash script executable run chmod +x submit.sh
#!/bin/bash
SYNAPSE_PROJECT_ID="syn21557290"
echo $SYNAPSE_PROJECT_ID
if [ "$1" == "test" ]; then
echo "Testing docker"
docker run -v "$PWD/input/:/input/" -v "$PWD/output:/output/" docker.synapse.org/$SYNAPSE_PROJECT_ID/sc1_model
elif [ "$1" == "build" ]
then
echo "Building docker ...."
docker build -t docker.synapse.org/$SYNAPSE_PROJECT_ID/sc1_model .
elif [ "$1" == "send" ]
then
echo "Sending docker ...."
docker login docker.synapse.org
docker push docker.synapse.org/$SYNAPSE_PROJECT_ID/sc1_model
else
echo "Options available are: test or send"
fi
Select the docker submitted and click on Submit Docker Repository to Challenge
.
You will receive an email with the success or failure (with logs).
You should be able to check you results at: https://www.synapse.org/#!Synapse:syn20940518/wiki/600158
score