# HG changeset patch # User mingchen0919 # Date 1520375938 18000 # Node ID cc33706a1d4b44d55227a51769231e1e638b1c64 # Parent 10a460f61ac2dd4c473c0f4f37e707ad398fb96e update diff -r 10a460f61ac2 -r cc33706a1d4b htseq_count.Rmd --- a/htseq_count.Rmd Tue Mar 06 15:16:40 2018 -0500 +++ b/htseq_count.Rmd Tue Mar 06 17:38:58 2018 -0500 @@ -1,16 +1,11 @@ --- -title: 'HTML report title' -output: - html_document: - number_sections: true - toc: true - theme: cosmo - highlight: tango +title: 'htseq-count analysis' +output: html_document --- ```{r setup, include=FALSE, warning=FALSE, message=FALSE} knitr::opts_chunk$set( - echo = as.logical(), + echo = as.logical(opt$X_e), error = TRUE ) ``` @@ -19,8 +14,9 @@ # Code for computational analysis ```{r 'step 1'} +opt +``` -``` ```{r 'ste[ 2'} diff -r 10a460f61ac2 -r cc33706a1d4b htseq_count.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/htseq_count.sh Tue Mar 06 17:38:58 2018 -0500 @@ -0,0 +1,16 @@ +Rscript '${__tool_directory__}/aurora_htseq_count.R' + + -e $echo + -o $report + -d $report.files_path + -s $sink_message + -t '${__tool_directory__}' + + -f $format + -r $order + -S $stranded + -a $minaqual + -T $feature_type + -i $idattr + -I $additional_attr + -m $mode \ No newline at end of file diff -r 10a460f61ac2 -r cc33706a1d4b htseq_count.xml --- a/htseq_count.xml Tue Mar 06 15:16:40 2018 -0500 +++ b/htseq_count.xml Tue Mar 06 17:38:58 2018 -0500 @@ -1,28 +1,77 @@ - - Counting reads in features. - - pandocr-getoptr-rmarkdownhtseq - - - + Counting reads in features. + + pandoc + r-getopt + r-rmarkdown + htseq + + + + + - - - - - + + -f $format + -r $order + -S $stranded + -a $minaqual + -T $feature_type + -i $idattr + -I $additional_attr + -m $mode]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + diff -r 10a460f61ac2 -r cc33706a1d4b htseq_count_render.R --- a/htseq_count_render.R Tue Mar 06 15:16:40 2018 -0500 +++ b/htseq_count_render.R Tue Mar 06 17:38:58 2018 -0500 @@ -15,11 +15,23 @@ #------------get arguments into R-------------------- # library(dplyr) -# getopt_specification_matrix(extract_short_flags('')) %>% +# getopt_specification_matrix(extract_short_flags('htseq_count.xml')) %>% # write.table(file = 'spec.txt', sep = ',', row.names = FALSE, col.names = TRUE, quote = FALSE) -spec_matrix = as.matrix() +spec_matrix = as.matrix( + data.frame(stringsAsFactors=FALSE, + long_flags = c("X_e", "X_o", "X_d", "X_s", "X_t", "X_f", "X_r", + "X_S", "X_a", "X_T", "X_i", "X_I", "X_m"), + short_flags = c("e", "o", "d", "s", "t", "f", "r", "S", "a", "T", + "i", "I", "m"), + argument_mask_flags = c(1L, 1L, 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", + "character", "character") + ) +) opt = getopt(spec_matrix) #---------------------------------------------------- @@ -32,16 +44,16 @@ #---------- often used variables ---------------- # OUTPUT_DIR: path to the output associated directory, which stores all outputs # TOOL_DIR: path to the tool installation directory -OUTPUT_DIR = '' -TOOL_DIR = '' -RMD_NAME = '' +OUTPUT_DIR = opt$X_d +TOOL_DIR = opt$X_t +RMD_NAME = 'htseq_count.Rmd' OUTPUT_REPORT = opt$X_o # create the output associated directory to store all outputs dir.create(OUTPUT_DIR, recursive = TRUE) #-----------------render Rmd-------------- -render(paste0(TOOL_DIR, RMD_NAME, sep = '/'), output_file = OUTPUT_REPORT) +render(paste0(TOOL_DIR, '/', RMD_NAME), output_file = OUTPUT_REPORT) #------------------------------------------ #==============the end============== diff -r 10a460f61ac2 -r cc33706a1d4b spec.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec.txt Tue Mar 06 17:38:58 2018 -0500 @@ -0,0 +1,14 @@ +long_flags,short_flags,argument_mask_flags,data_type_flags +X_e,e,1,character +X_o,o,1,character +X_d,d,1,character +X_s,s,1,character +X_t,t,1,character +X_f,f,1,character +X_r,r,1,character +X_S,S,1,character +X_a,a,1,character +X_T,T,1,character +X_i,i,1,character +X_I,I,1,character +X_m,m,1,character