The analysis below can be reproduced by one of the following methods:
discoBatch()
with the parameters in section \@ref(parameter-settings).discoApp()
with the parameters in \@ref(parameter-settings).Note: This report is static and does not perform any reactive data processing.
To run commands directly in R, import the data and input parameters:
# Choose an appropriate command for importing the data # indata <- read.csv("path/to/input_data.csv") # From CSV file # indata <- readRDS("path/to/input_data.RDS") # From R data file # indata <- DiscoRhythm::discoGetSimu() # Import example dataset # Read input parameters and put them into the global environment # discorhythm_inputs <- readRDS('discorhythm_inputs.RDS') # list2env(discorhythm_inputs,envir=.GlobalEnv)
Below is a table of all parameters input to this report.
See ?discoBatch
R documentation for parameter descriptions.
knitr::kable(data.frame( "Parameter"=c("cor_threshold","cor_method","cor_threshType","pca_threshold", "pca_scale","pca_pcToCut","aov_method","aov_pcut","aov_Fcut", "avg_method","osc_method","timeType","main_per", "osc_period"), "Value"=c(cor_threshold,cor_method,cor_threshType,pca_threshold, pca_scale,paste(pca_pcToCut,collapse = " "), aov_method,aov_pcut,aov_Fcut,avg_method, paste(osc_method,collapse=" "), timeType,main_per,osc_period) ), format = "markdown")
batchscript=system.file("", "DiscoRhythm_batch.R", package = "DiscoRhythm", mustWork = TRUE)
Below is all R code necessary to generate the main DiscoRhythm results. These results will be used in section \@ref(visualizations) for generating the summary figures. Refer to the "Introduction to DiscoRhythm" document for a detailed description of the workflow steps.
# local=TRUE to run within the environment used to call this Rmd source(batchscript, local = TRUE)
Importing the DiscoRhythm plotting functions used by the web application
for use in this report. To reproduce these results, ensure you have all
necessary package versions (See \@ref(session-info)). Refer to the
r BiocStyle::Biocpkg('DiscoRhythm')
user's guide
or web application for details on each figure.
source(system.file("app/code/server", "plots.R", package = "DiscoRhythm", mustWork = TRUE))
knitr::kable(discoDesignSummary(SummarizedExperiment::colData(selectDataSE)), format = "markdown")
plotly::ggplotly(plotAvgCor(SummarizedExperiment::colData(selectDataSE),CorRes$meanCor, corCut = CorRes$threshold,tUnit = "hr"))
plotHeatMCor(CorRes$corMat,1)
plotly::ggplotly( plotPCAdists(PCAres,SDfactor = pca_threshold,pcToUse = pca_pcToCut) )
gridExtra::grid.arrange( plotPCAWithShape(PCAres$x,as.data.frame(SummarizedExperiment::colData(selectDataSE)), col = "None",1,2, PCAres$outliers)+ ggtitle("Before Outlier Removal"), plotPCAWithShape(PCAresAfter$x,as.data.frame(SummarizedExperiment::colData(selectDataSE)), col = "None",1,2)+ ggtitle("After Outlier Removal"), ncol=2)
plotPCAstats(PCAres$table,PCAresAfter$table,pcToUse = pca_pcToCut)
plotPCAPairs(PCAres$x,c("PC1","PC2","PC3","PC4"))
invisible(plotPCAPairsAfter(PCAresAfter$x,c("PC1","PC2","PC3","PC4"), PCAres$outliers))
DT::datatable(as.data.frame( SummarizedExperiment::colData(selectDataSE)[PCAres$outliers | CorRes$outliers,] ))
knitr::kable(discoDesignSummary(SummarizedExperiment::colData(FilteredSE)), format = "markdown")
if(aov_method!='None') plotPvalues(ANOVAres$aovP,50, aov_pcut, 'ANOVA')
if(aov_method!='None') ObsVsExpSNR(ANOVAres$allStats,aov_Fcut)
plotPeriodDetect(PeriodRes)
plotOVpcaScatter(OVpca = OVpca,colData(FinalSE),osc_period, PCsToUse = paste0("PC",1:4))
pcaSE <- discoDFtoSE(data.frame("PC"=1:ncol(OVpca$x),t(OVpca$x)), colData(FinalSE)) knitr::kable( discoODAs(pcaSE,method="CS")$CS, format = "markdown" )
plotPQValueHist(discoODAres,bg = seq_len(nrow(FinalSE)),50, cutoff = 0.05,discoODAid2name)
fg <- lapply(discoODAres,function(x) which(x$pvalue<0.05)) plotAllAcroHist(discoODAres,fg,50,osc_period,TRUE,discoODAid2name)
plotAmpliHist(discoODAres,bg = seq_len(nrow(FinalSE)), fg=fg[['CS']],50,'')
allIntersect(fg)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.