runComparison
R/runComparison.R
checkTableConsistency.Rd
Check that the dataset
, nbr.samples
, repl
and de.methods
columns of a data frame are consistent with the information provided in the input files (given in the input.files
column of the data frame). If there are inconsistencies or missing information in any of the columns, replace the given information with the information in the input files.
checkTableConsistency(file.table)
Returns a consistent file table defining the result files that will be used as the basis for a method comparison.
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")
#>
#>
#> processing file: /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/tempcode21d01a6c33e5.Rmd
#> 1/2
#> 2/2 [unnamed-chunk-1]
#> output file: /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/tempcode21d01a6c33e5.md
#> [1] TRUE
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")
#>
#>
#> processing file: /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/tempcode21d018867c23.Rmd
#> 1/2
#> 2/2 [unnamed-chunk-1]
#> output file: /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/tempcode21d018867c23.md
#> [1] TRUE
## A correct table
file.table <- data.frame(input.files = file.path(tmpdir,
c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")),
datasets = c("mydata", "mydata"),
nbr.samples = c(5, 5),
repl = c(1, 1),
stringsAsFactors = FALSE)
new.table <- checkTableConsistency(file.table)
new.table
#> input.files
#> 1 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_voom.limma.rds
#> 2 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_edgeR.exact.rds
#> datasets nbr.samples repl de.methods
#> 1 mydata 5 1 voom.3.61.2.limma.TMM
#> 2 mydata 5 1 edgeR.4.3.4.exact.TMM.movingave.tagwise
## An incorrect table
file.table <- data.frame(input.files = file.path(tmpdir,
c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")),
datasets = c("mydata", "mydata"),
nbr.samples = c(5, 3),
repl = c(2, 1),
stringsAsFactors = FALSE)
new.table <- checkTableConsistency(file.table)
#> Inconsistency between provided repl and information in file /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_voom.limma.rds . Replacing the given information with
#> the one given in the saved file.
#> Inconsistency between provided nbr.samples and information in file /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_edgeR.exact.rds . Replacing the given information with
#> the one given in the saved file.
new.table
#> input.files
#> 1 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_voom.limma.rds
#> 2 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_edgeR.exact.rds
#> datasets nbr.samples repl de.methods
#> 1 mydata 5 1 voom.3.61.2.limma.TMM
#> 2 mydata 5 1 edgeR.4.3.4.exact.TMM.movingave.tagwise
## A table with missing information
file.table <- data.frame(input.files = file.path(tmpdir,
c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")),
stringsAsFactors = FALSE)
new.table <- checkTableConsistency(file.table)
new.table
#> input.files
#> 1 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_voom.limma.rds
#> 2 /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/mydata_edgeR.exact.rds
#> datasets nbr.samples repl de.methods
#> 1 mydata 5 1 voom.3.61.2.limma.TMM
#> 2 mydata 5 1 edgeR.4.3.4.exact.TMM.movingave.tagwise