diff split_fasta.Rmd @ 1:ecf34bd52987 draft

update
author mingchen0919
date Mon, 09 Apr 2018 13:32:55 -0400
parents 3918528c19b4
children 38435c74e795
line wrap: on
line diff
--- a/split_fasta.Rmd	Mon Apr 09 11:51:32 2018 -0400
+++ b/split_fasta.Rmd	Mon Apr 09 13:32:55 2018 -0400
@@ -15,16 +15,17 @@
 mkdir -p ${WORKING_DIR}/fasta_files
 
 # single-end.sh
-cat <<EOF >${X_d}/fasta_splitter.sh
-${WORKING_DIR}/fasta_files && \\
-  ${X_t}/split.pl ${X_A} ${X_B} > ${X_d}/fasta_splitter-log.txt 2>&1
+cat <<EOF >${X_d}/job-script.sh
+cd ${WORKING_DIR}/fasta_files && ${X_t}/split.pl \\
+  --input_file=${X_A} \\
+  --seqs_per_file=${X_B} \\  > ${X_d}/fasta_splitter-log.txt 2>&1
 EOF
 ```
 
 ```{bash, 'run jobs', echo=FALSE}
 # run job script, always use absolute path. 
 # we want to run all jobs within the working path.
-sh ${X_d}/fasta_splitter.sh
+sh ${X_d}/job-script.sh
 ```
 
 ```{r, 'display output directory contents', results='asis', echo=FALSE}
@@ -33,11 +34,11 @@
 
 cat('##All output files')
 cat('\n\n')
-all_files = list.files(path = Sys.getenv('REPORT_FILES_PATH'), 
+all_files = list.files(path = opt$X_d, 
                        full.names = TRUE, 
                        recursive = TRUE)
 
-for (f in sub(Sys.getenv('REPORT_FILES_PATH'), '.', all_files) ) {
+for (f in sub(opt$X_d, '.', all_files) ) {
   cat('* [', f, '](', f, ')\n')
 }
 cat('\n')