View source: R/runComparison.R
runComparison | R Documentation |
The main function for performing comparisons among differential expression methods and generating a report in HTML format. It is assumed that all differential expression results have been generated in advance (using e.g. the function runDiffExp
) and that the result compData
object for each data set and each differential expression method is saved separately in files with the extension .rds
. Note that the function can also be called via the runComparisonGUI
function, which lets the user set parameters and select input files using a graphical user interface.
runComparison(
file.table,
parameters,
output.directory,
check.table = TRUE,
out.width = NULL,
save.result.table = FALSE,
knit.results = TRUE
)
file.table |
A data frame with at least a column |
parameters |
A list containing parameters for the comparison study. The following entries are supported, and used by different comparison methods:
|
output.directory |
The directory where the results should be written. The subdirectory structure will be created automatically. If the directory already exists, it will be overwritten. |
check.table |
Logical, should the input table be checked for consistency. Default |
out.width |
The width of the figures in the final report. Will be passed on to |
save.result.table |
Logical, should the intermediate result table be saved for future use ? Default to |
knit.results |
Logical, should the Rmd be generated and knitted ? Default to |
The input to runComparison
is a data frame with at least a column named input.files
, containing paths to .rds
files containing result objects (of the class compData
), such as those generated by runDiffExp
. Other columns that can be included in the data frame are datasets
, nbr.samples
, repl
and de.methods
. They have to match the information contained in the corresponding result objects. If these columns are not present, they will be added to the data frame automatically.
If knit.results=TRUE
, the function will create a comparison report, named compcodeR_report<timestamp>.html, in the output.directory
. It will also create subfolders named compcodeR_code
and compcodeR_figure
, where the code used to perform the differential expression analysis and the figures contained in the report, respectively, will be stored. Note that if these directories already exists, they will be overwritten.
If save.result.table=TRUE
, the function will also create a comparison report, named compcodeR_result_table_<timestamp>.rds in the output.directory
, containing the result table.
Charlotte Soneson
tmpdir <- normalizePath(tempdir(), winslash = "/")
mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000,
samples.per.cond = 5, n.diffexp = 100,
output.file = file.path(tmpdir, "mydata.rds"))
runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma",
Rmdfunction = "voom.limma.createRmd", output.directory = tmpdir,
norm.method = "TMM")
runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "edgeR.exact",
Rmdfunction = "edgeR.exact.createRmd", output.directory = tmpdir,
norm.method = "TMM",
trend.method = "movingave", disp.type = "tagwise")
file.table <- data.frame(input.files = file.path(tmpdir,
c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")),
stringsAsFactors = FALSE)
parameters <- list(incl.nbr.samples = 5, incl.replicates = 1, incl.dataset = "mydata",
incl.de.methods = NULL,
fdr.threshold = 0.05, tpr.threshold = 0.05, typeI.threshold = 0.05,
ma.threshold = 0.05, fdc.maxvar = 1500, overlap.threshold = 0.05,
fracsign.threshold = 0.05, mcc.threshold = 0.05,
nbrtpfp.threshold = 0.05,
comparisons = c("auc", "fdr", "tpr", "ma", "correlation"))
if (interactive()) {
runComparison(file.table = file.table, parameters = parameters, output.directory = tmpdir)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.