knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(oncoPredict) #Apply idwas() function. #Determine the parameters of the idwas() function... #Set the drug_prediction parameter. #Make sure rownames() are samples, and colnames() are drugs. Also make sure this data is a data frame. drug_prediction<-as.data.frame(read.table('DrugPredictions.txt', header=TRUE, row.names=1)) #In this example, I had to replace the '.' in the names of these TCGA samples with '-' so that they are of the same form as samples in the mutation data (you may not have to do this). colnames(drug_prediction)<-gsub(".", "-", colnames(drug_prediction), fixed=T) #Make sure the sample identifiers in the 'drug prediction' data are of similar form as the sample identifiers in the 'data' parameter. cols=colnames(drug_prediction) colnames(drug_prediction)<-substring(cols, 3, nchar(cols)) drug_prediction<-as.data.frame(t(drug_prediction)) wd<-tempdir() savedir<-setwd(wd)
This script used to provide an example of how to download mutation data from the GDC database for GBM (glioblastoma) and how to apply idwas() to test the drugs in your drug response dataset to each mutation to identify biomarkers that #enrich for drug response.
However, GDC updated how to get the MAF dataset, so we will just provide information so the readers can hopefully get it to run if they need.
Download mutation data for your cancer of interest from GDC database.
https://bioconductor.org/packages/release/bioc/vignettes/TCGAbiolinks/inst/doc/mutation.html
https://rdrr.io/bioc/TCGAbiolinks/f/vignettes/mutation.Rmd
The code would look something like this:
library(TCGAbiolinks)
query_maf <- GDCquery(project = "TCGA-GBM",
data.category = "Simple Nucleotide Variation",
access = "open",
data.type = "Simple somatic mutation",
legacy = TRUE)
GDCdownload(query)
maf <- GDCprepare(query)
Then there is some light formatting to be done before running IDWAS.
data<-as.data.frame(maf) samps<-data$Tumor_Sample_Barcode data$Tumor_Sample_Barcode<-substr(samps,1,nchar(samps)-12) #Make sure these sample ids are of the same form as the sample ids in your prediction data.
n=10
cnv=FALSE
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.