R/generateCodeHTMLs.R
generateCodeHTMLs.Rd
A function to extract the code used to generate differential expression results from saved compData
result objects (typically obtained by runDiffExp
), and to write the code to HTML files. This requires that the code was saved as a character string in R markdown format in the code
slot of the result object, which is done automatically by runDiffExp
. If the differential expression analysis was performed with functions outside compcodeR
, the code has to be added manually to the result object.
generateCodeHTMLs(input.files, output.directory)
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/tempcode21d061d952d2.Rmd
#> 1/2
#> 2/2 [unnamed-chunk-1]
#> output file: /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/RtmpDwlx4a/tempcode21d061d952d2.md
#> [1] TRUE
generateCodeHTMLs(file.path(tmpdir, "mydata_voom.limma.rds"), tmpdir)