Mercurial > repos > mingchen0919 > statonlab_fasta_splitter
comparison split_fasta.Rmd @ 0:3918528c19b4 draft
planemo upload
| author | mingchen0919 |
|---|---|
| date | Mon, 09 Apr 2018 11:51:32 -0400 |
| parents | |
| children | ecf34bd52987 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:3918528c19b4 |
|---|---|
| 1 --- | |
| 2 title: 'FASTA splitter' | |
| 3 output: | |
| 4 html_document: | |
| 5 highlight: pygments | |
| 6 --- | |
| 7 | |
| 8 ```{r setup, include=FALSE, warning=FALSE, message=FALSE} | |
| 9 knitr::opts_chunk$set(echo = TRUE, error = TRUE) | |
| 10 ``` | |
| 11 | |
| 12 | |
| 13 ```{bash} | |
| 14 # build job-script | |
| 15 mkdir -p ${WORKING_DIR}/fasta_files | |
| 16 | |
| 17 # single-end.sh | |
| 18 cat <<EOF >${X_d}/fasta_splitter.sh | |
| 19 ${WORKING_DIR}/fasta_files && \\ | |
| 20 ${X_t}/split.pl ${X_A} ${X_B} > ${X_d}/fasta_splitter-log.txt 2>&1 | |
| 21 EOF | |
| 22 ``` | |
| 23 | |
| 24 ```{bash, 'run jobs', echo=FALSE} | |
| 25 # run job script, always use absolute path. | |
| 26 # we want to run all jobs within the working path. | |
| 27 sh ${X_d}/fasta_splitter.sh | |
| 28 ``` | |
| 29 | |
| 30 ```{r, 'display output directory contents', results='asis', echo=FALSE} | |
| 31 ## after the job is done, we list all files from the output directory. | |
| 32 ## full relative path to the output directory needs to be displayed. | |
| 33 | |
| 34 cat('##All output files') | |
| 35 cat('\n\n') | |
| 36 all_files = list.files(path = Sys.getenv('REPORT_FILES_PATH'), | |
| 37 full.names = TRUE, | |
| 38 recursive = TRUE) | |
| 39 | |
| 40 for (f in sub(Sys.getenv('REPORT_FILES_PATH'), '.', all_files) ) { | |
| 41 cat('* [', f, '](', f, ')\n') | |
| 42 } | |
| 43 cat('\n') | |
| 44 ``` | |
| 45 |
