knitr::opts_chunk$set(echo = TRUE,error=TRUE,warnings=FALSE) library(rdmdeconv)
if( !require(BiocInstaller) ){ # enable Bioconductor repositories # -> add Bioc-software setRepositories() source("https://bioconductor.org/biocLite.R") biocLite("BiocInstaller") #install.packages('BiocInstaller') library(BiocInstaller) } if (!require(RTCGA.rnaseq)){ #biocLite("RTCGA") biocLite("RTCGA.rnaseq") library(RTCGA.rnaseq) }
proportions <- read.delim('raw/all_proportions_breast_other.txt', sep = '\t',row.names=1) nmul = 1000000 #Make signatures and normalize to 0..1 nsignatures <- normalize_data_by_columns(make_signatures(proportions)) #Make mix data from BRCA and normaize to 0..1 mix <-map_genes_brca(BRCA.rnaseq[1:10,],nsignatures) nmix <- normalize_data_by_columns(mix) #Multiply by val and round because deconvolution performs values >1 nmix = round(nmix * nmul); nsignatures = round(nsignatures * nmul); #Clear data nsignatures <- filter_data(nsignatures,nmix) #Order by rownames nmix <- nmix[order(rownames(nmix)),] nsignatures <- nsignatures[order(rownames(nsignatures)),] #Extract markers xmarkers <- extract_markers(nsignatures) sel_xmarkers <- xmarkers[xmarkers$padj<=10^-2& xmarkers$max>=0.95,] #Show selected markers for breast breastMarkers = sel_xmarkers[sel_xmarkers$sig=='Breast',] ref <- data.frame( breastMarkers$id, apply(nmix[breastMarkers$id,],1,max), apply(nmix[breastMarkers$id,],1,min), apply(nmix[breastMarkers$id,],1,mean)) colnames(ref) <- c('Gene','Max','Min','Mean') ref nsignatures[breastMarkers$id,] #Perform deconvolution res <- deconv(nmix,nsignatures,markers=sel_xmarkers$id) plotRes(res,0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.