Mercurial > repos > mingchen0919 > aurora_fastqc_site
diff fastqc_site_render.R @ 0:f74fdae99053 draft
planemo upload
| author | mingchen0919 |
|---|---|
| date | Tue, 27 Feb 2018 00:39:56 -0500 |
| parents | |
| children | 645291efd2e7 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fastqc_site_render.R Tue Feb 27 00:39:56 2018 -0500 @@ -0,0 +1,46 @@ +##============ Sink warnings and errors to a file ============== +## use the sink() function to wrap all code within it. +##============================================================== +zz = file('warnings_and_errors.txt') +sink(zz) +sink(zz, type = 'message') + +library(getopt) +library(rmarkdown) +library(htmltools) +library(plyr) +library(dplyr) +library(stringr) +library(DT) +library(reshape2) +library(plotly) +options(stringsAsFactors = FALSE) + +# getopt_specification_matrix(extract_short_flags('fastqc_report.xml')) %>% +# write.table(file = 'spec.txt', sep = ',', row.names = FALSE, col.names = TRUE, quote = FALSE) + +spec_matrix = as.matrix( + data.frame(stringsAsFactors=FALSE, + long_flags = c("X_e", "X_r", "X_n", "X_R", "X_N", "X_c", "X_l", + "X_o", "X_d", "X_s", "X_p"), + short_flags = c("e", "r", "n", "R", "N", "c", "l", "o", "d", "s", + "p"), + argument_mask_flags = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), + data_type_flags = c("character", "character", "character", "character", + "character", "character", "character", + "character", "character", "character", "character") + ) +) +# get arguments into R +opt = getopt(spec_matrix) +# define system environment variables +do.call(Sys.setenv, opt[-1]) + +# render website +# render(input = opt$X_p, output_file = opt$X_o) +render_site() +file.copy(paste0(opt$X_d, '/index.html'), opt$X_o, recursive = TRUE) + +##--------end of code rendering .Rmd templates---------------- +sink() +##=========== End of sinking output============================= \ No newline at end of file
