## ----设置,包括= false -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- knitr::opts_chunk$set(echo = TRUE) ## ---- eval=FALSE----------------------------------------------------------------------------------#New S4函数(注意大写w)#?瀑布###旧建立的功能#?瀑布## ----消息= false,tidy = true -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#设置一个种子套装(426)#加载genvisr到r库(genvisr)##----消息= false,整理= true -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#获取MAF测试文件的磁盘位置testfiledir <-system.file(“ extdata”,package =“ genvisr”)testfile <-sys.glob(paste0(testfiledir,“/brca,”).maf“))#定义测试mafobject < - mutationAnnotationFormat(testfile)## ----消息= false,tidy = true --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------获取测试文件的磁盘位置testfiledir <-System.file(“ Extdata”,package = =“ genvisr”)testfile <-sys.glob(paste0(testfiledir,“/dep”))#定义E测试VEPOBJECT <-VEP(testfile)## -----------------------------------------------------------------------------------------------------------------------------------------------------#获取测试文件的磁盘位置testfiledir <-system.file(“ extdata)“,package =“ genvisr”)testfile <-sys.glob(paste0(testfiledir,“/fl.gms”))#定义用于测试gmsobject <-gms(testfile)## ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------评估= false ----------------------------------------------------------------------------------------------------------------------------##从VEP文件中查看样本#getpample(vepobject)## ---------------- true,parning = false ----------------------------------------------------------------------- waterfallPlot <- Waterfall(vepObject, recurrence=.40) ## ----eval=FALSE----------------------------------------------------------------------------------------------------##插槽名称提取数据#getData(WaterfallPlot,name =“ priendardata”)###################################,index = 1)## ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # # draw the plot # drawPlot(waterfallPlot) # # # draw the plot and save it to a pdf # pdf(file="waterfall.pdf", height=10, width=15) # drawPlot(waterfallPlot) # dev.off() ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE---- # draw a waterfall plot for the maf object drawPlot(Waterfall(vepObject, recurrence=.20)) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE---- # show those genes which recur in 50% of the cohort for these 4 samples drawPlot(Waterfall(vepObject, recurrence=.50, samples=c("FLX0040Naive", "FLX0070Naive", "FLX0050Naive", "FLX0030Naive"))) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE---- # define a coverage for each sample sampCov <- c("FLX0040Naive"=1.45e7, "FLX0070Naive"=1.39e7, "FLX0050Naive"=1.21e7, "FLX0030Naive"=1.3e7, "FLX0010Naive"=1.1e7) drawPlot(Waterfall(vepObject, recurrence=.50, coverage=sampCov, plotA="burden", plotATally="complex", drop=FALSE)) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE---- # find which mutations are in the input data mutations <- getMutation(vepObject)$Conse # define a new color and hierarchy for mutations library(data.table) newHierarchy <- data.table("mutation"=c("splice_region_variant", "splice_acceptor_variant", "splice_donor_variant", "missense_variant", "stop_gained"), "color"=c("tomato1", "tomato2", "tomato3", "purple", "cyan")) # draw the plot drawPlot(Waterfall(vepObject, recurrence=.50, mutationHierarchy = newHierarchy, plotATally="complex", drop=FALSE)) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE, message=FALSE---- # determine the appropriate BSgenome object to use from the vep header assembly <- getHeader(vepObject) assembly <- assembly[grepl("assembly", assembly$Info),] # load in the correct BSgenome object library(BSgenome.Hsapiens.UCSC.hg19) # create a MutSpectra plot drawPlot(MutSpectra(vepObject, BSgenome=BSgenome.Hsapiens.UCSC.hg19)) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE, message=FALSE---- # determine the appropriate BSgenome object to use from the vep header assembly <- getHeader(vepObject) assembly <- assembly[grepl("assembly", assembly$Info),] # load in the correct BSgenome object library(BSgenome.Hsapiens.UCSC.hg19) # create a Rainfall plot drawPlot(Rainfall(vepObject, BSgenome=BSgenome.Hsapiens.UCSC.hg19)) ## ---- fig.keep='last', fig.width=10, fig.height=6.5, tidy=TRUE, warning=FALSE, message=FALSE---- # create a Rainfall plot limiting the chromosomes and samples plotted drawPlot(Rainfall(vepObject, BSgenome=BSgenome.Hsapiens.UCSC.hg19, sample=c("FLX0010Naive"), chromosomes=c("chr1", "chr2", "chr3"))) ## ---- message=FALSE, tidy=TRUE------------------------------------------------ sessionInfo()