|
0
|
1 ---
|
|
1
|
2 title: 'InterProScan analysis'
|
|
|
3 output: html_document
|
|
0
|
4 ---
|
|
|
5
|
|
|
6 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
|
|
|
7 knitr::opts_chunk$set(
|
|
|
8 echo = TRUE,
|
|
|
9 error = TRUE
|
|
|
10 )
|
|
|
11 ```
|
|
|
12
|
|
|
13
|
|
1
|
14 # InterProScan job script
|
|
0
|
15
|
|
|
16 ```{bash echo=FALSE}
|
|
2
|
17 # create two directorys: tempdir and output-dir
|
|
|
18 mkdir -p ${X_d}/temp_dir
|
|
|
19 mkdir -p ${X_d}/output_dir
|
|
|
20
|
|
0
|
21 #---- build job script ----
|
|
|
22 cat >temp.sh <<EOL
|
|
|
23 /opt/main/InterProScan/5.28-67.0/interproscan.sh \\
|
|
|
24 -i ${X_A} \\
|
|
|
25 -f ${X_B} \\
|
|
|
26 --disable-precalc ${X_C} \\
|
|
|
27 --iprlookup ${X_D} \\
|
|
|
28 --goterms ${X_E} \\
|
|
|
29 --pathways ${X_F} \\
|
|
2
|
30 --tempdir ${X_d}/temp_dir \\
|
|
5
|
31 --output-dir ${X_d}/output_dir > ${X_d}/interproscan.log.txt 2>&1
|
|
1
|
32
|
|
0
|
33 EOL
|
|
|
34
|
|
|
35 # remove empty input lines
|
|
1
|
36 grep -v 'None' temp.sh |\
|
|
|
37 grep -v 'NO_ARGUMENT_NO' |\
|
|
|
38 sed 's/NO_ARGUMENT_YES//g' > job-script.sh
|
|
0
|
39
|
|
|
40 # copy job-script.sh to OUTPUT_DIR
|
|
1
|
41 cp job-script.sh ${X_d}/job-script.sh
|
|
0
|
42 ```
|
|
|
43
|
|
|
44 ```{r echo=FALSE}
|
|
|
45 # display job script
|
|
|
46 job_script = paste0(opt$X_d, '/job-script.sh')
|
|
1
|
47 tags$code(tags$pre(readChar(job_script, file.info(job_script)$size )))
|
|
0
|
48 ```
|
|
|
49
|
|
|
50 ```{bash echo=FALSE}
|
|
|
51 #run job-script.sh
|
|
|
52 sh job-script.sh
|
|
|
53 ```
|
|
|
54
|
|
|
55
|
|
|
56 ```{r, 'display output directory contents', results='asis', echo=FALSE}
|
|
|
57 ## after the job is done, we list all files from the output directory.
|
|
|
58 ## full relative path to the output directory needs to be displayed.
|
|
|
59
|
|
|
60 cat('##All output files')
|
|
|
61 cat('\n\n')
|
|
1
|
62 all_files = list.files(path = OUTPUT_DIR,
|
|
0
|
63 full.names = TRUE,
|
|
|
64 recursive = TRUE)
|
|
|
65
|
|
1
|
66 for (f in sub(OUTPUT_DIR, '.', all_files) ) {
|
|
0
|
67 cat('* [', f, '](', f, ')\n')
|
|
|
68 }
|
|
|
69 cat('\n')
|
|
|
70 ``` |