Mercurial > repos > mingchen0919 > statonlab_fasta_splitter
comparison split_fasta.Rmd @ 2:38435c74e795 draft default tip
working version
| author | mingchen0919 |
|---|---|
| date | Mon, 09 Apr 2018 14:20:42 -0400 |
| parents | ecf34bd52987 |
| children |
comparison
equal
deleted
inserted
replaced
| 1:ecf34bd52987 | 2:38435c74e795 |
|---|---|
| 14 # build job-script | 14 # build job-script |
| 15 mkdir -p ${WORKING_DIR}/fasta_files | 15 mkdir -p ${WORKING_DIR}/fasta_files |
| 16 | 16 |
| 17 # single-end.sh | 17 # single-end.sh |
| 18 cat <<EOF >${X_d}/job-script.sh | 18 cat <<EOF >${X_d}/job-script.sh |
| 19 cd ${WORKING_DIR}/fasta_files && ${X_t}/split.pl \\ | 19 cd ${WORKING_DIR}/fasta_files && \\ |
| 20 --input_file=${X_A} \\ | 20 cp ${X_A} input.fasta && \\ |
| 21 --seqs_per_file=${X_B} \\ > ${X_d}/fasta_splitter-log.txt 2>&1 | 21 ${X_t}/split.pl input.fasta ${X_B} > ${X_d}/fasta_splitter-log.txt 2>&1 |
| 22 EOF | 22 EOF |
| 23 ``` | 23 ``` |
| 24 | 24 |
| 25 ```{bash, 'run jobs', echo=FALSE} | 25 ```{bash, 'run jobs', echo=FALSE} |
| 26 # run job script, always use absolute path. | 26 # run job script, always use absolute path. |
| 27 # we want to run all jobs within the working path. | 27 # we want to run all jobs within the working path. |
| 28 sh ${X_d}/job-script.sh | 28 sh ${X_d}/job-script.sh |
| 29 ``` | |
| 30 | |
| 31 ```{bash} | |
| 32 # remove original input fasta | |
| 33 rm ${WORKING_DIR}/fasta_files/input.fasta | |
| 34 mv ${WORKING_DIR}/fasta_files/out ${X_d}/split-out.txt | |
| 29 ``` | 35 ``` |
| 30 | 36 |
| 31 ```{r, 'display output directory contents', results='asis', echo=FALSE} | 37 ```{r, 'display output directory contents', results='asis', echo=FALSE} |
| 32 ## after the job is done, we list all files from the output directory. | 38 ## after the job is done, we list all files from the output directory. |
| 33 ## full relative path to the output directory needs to be displayed. | 39 ## full relative path to the output directory needs to be displayed. |
