comparison htseq_count_render.R @ 1:cc33706a1d4b draft

update
author mingchen0919
date Tue, 06 Mar 2018 17:38:58 -0500
parents 10a460f61ac2
children db9da9716914
comparison
equal deleted inserted replaced
0:10a460f61ac2 1:cc33706a1d4b
13 #------------------------------------------------ 13 #------------------------------------------------
14 14
15 15
16 #------------get arguments into R-------------------- 16 #------------get arguments into R--------------------
17 # library(dplyr) 17 # library(dplyr)
18 # getopt_specification_matrix(extract_short_flags('')) %>% 18 # getopt_specification_matrix(extract_short_flags('htseq_count.xml')) %>%
19 # write.table(file = 'spec.txt', sep = ',', row.names = FALSE, col.names = TRUE, quote = FALSE) 19 # write.table(file = 'spec.txt', sep = ',', row.names = FALSE, col.names = TRUE, quote = FALSE)
20 20
21 21
22 spec_matrix = as.matrix() 22 spec_matrix = as.matrix(
23 data.frame(stringsAsFactors=FALSE,
24 long_flags = c("X_e", "X_o", "X_d", "X_s", "X_t", "X_f", "X_r",
25 "X_S", "X_a", "X_T", "X_i", "X_I", "X_m"),
26 short_flags = c("e", "o", "d", "s", "t", "f", "r", "S", "a", "T",
27 "i", "I", "m"),
28 argument_mask_flags = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L),
29 data_type_flags = c("character", "character", "character", "character",
30 "character", "character", "character",
31 "character", "character", "character", "character",
32 "character", "character")
33 )
34 )
23 opt = getopt(spec_matrix) 35 opt = getopt(spec_matrix)
24 #---------------------------------------------------- 36 #----------------------------------------------------
25 37
26 38
27 #-----------using passed arguments in R 39 #-----------using passed arguments in R
30 #---------------------------------------------------- 42 #----------------------------------------------------
31 43
32 #---------- often used variables ---------------- 44 #---------- often used variables ----------------
33 # OUTPUT_DIR: path to the output associated directory, which stores all outputs 45 # OUTPUT_DIR: path to the output associated directory, which stores all outputs
34 # TOOL_DIR: path to the tool installation directory 46 # TOOL_DIR: path to the tool installation directory
35 OUTPUT_DIR = '' 47 OUTPUT_DIR = opt$X_d
36 TOOL_DIR = '' 48 TOOL_DIR = opt$X_t
37 RMD_NAME = '' 49 RMD_NAME = 'htseq_count.Rmd'
38 OUTPUT_REPORT = opt$X_o 50 OUTPUT_REPORT = opt$X_o
39 51
40 # create the output associated directory to store all outputs 52 # create the output associated directory to store all outputs
41 dir.create(OUTPUT_DIR, recursive = TRUE) 53 dir.create(OUTPUT_DIR, recursive = TRUE)
42 54
43 #-----------------render Rmd-------------- 55 #-----------------render Rmd--------------
44 render(paste0(TOOL_DIR, RMD_NAME, sep = '/'), output_file = OUTPUT_REPORT) 56 render(paste0(TOOL_DIR, '/', RMD_NAME), output_file = OUTPUT_REPORT)
45 #------------------------------------------ 57 #------------------------------------------
46 58
47 #==============the end============== 59 #==============the end==============
48 60
49 61