Skip to content

Commit ea7bb76

Browse files
committed
Updates: 1) improved report generation; 2) unified outputs; 3) resolidified docker and WDL files
1 parent 08e47fe commit ea7bb76

6 files changed

Lines changed: 63 additions & 56 deletions

File tree

Dockerfile

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM continuumio/miniconda2:latest
1+
FROM continuumio/miniconda3:4.8.2
22
MAINTAINER po-e@lanl.gov
33

44
LABEL version="1.0.0"
@@ -7,21 +7,32 @@ LABEL tags="bioinformatics"
77

88
ENV container docker
99

10-
# prepare directories for inputs and databases
11-
RUN mkdir -p /data && mkdir -p /databases
12-
RUN conda config --add channels conda-forge && \
13-
conda config --add channels bioconda
10+
RUN apt-get update -y \
11+
&& apt-get install -y build-essential unzip wget curl gawk \
12+
&& apt-get clean
13+
14+
# add conda channels
15+
RUN conda config --add channels conda-forge \
16+
&& conda config --add channels bioconda
17+
1418
# install gottcha2
15-
RUN conda install -y unzip && \
16-
wget https://github.com/poeli/GOTTCHA2/archive/master.zip && \
17-
unzip master.zip && cp GOTTCHA2-master/*.py /opt/conda/bin && \
18-
conda install -y minimap2 && \
19-
conda install -y pandas
19+
RUN conda install minimap2 pandas
20+
RUN wget https://github.com/poeli/GOTTCHA2/archive/2.1.7.tar.gz \
21+
&& tar -xzf 2.1.7.tar.gz \
22+
&& cp GOTTCHA2-2.1.7/*.py /usr/local/bin \
23+
&& rm -rf GOTTCHA2-2.1.7/ 2.1.7.zip
24+
2025
# install kraken2
21-
RUN conda install -c bioconda -y kraken2
26+
RUN conda install kraken2=2.1.0
27+
2228
# install centrifuge
23-
RUN conda install -c bioconda -y centrifuge
29+
RUN wget https://github.com/DaehwanKimLab/centrifuge/archive/v1.0.4-beta.tar.gz \
30+
&& tar -xzf v1.0.4-beta.tar.gz \
31+
&& cd centrifuge-1.0.4-beta \
32+
&& make install prefix=/usr/local
2433

25-
WORKDIR /data
34+
# install krona
35+
RUN conda install krona \
36+
&& ktUpdateTaxonomy.sh
2637

2738
CMD ["/bin/bash"]

README.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The input is a json file:
9090
"ReadbasedAnalysis.paired": true,
9191
"ReadbasedAnalysis.prefix": "SRR7877884",
9292
"ReadbasedAnalysis.outdir": "/path/to/ReadbasedAnalysis",
93-
"ReadbasedAnalysis.cpu": 4
93+
"ReadbasedAnalysis.cpu": 8
9494
}
9595
9696
@@ -102,32 +102,29 @@ The workflow creates individual output directories for each tool, including clas
102102
ReadbasedAnalysis/
103103
|-- centrifuge
104104
| |-- SRR7877884.classification.csv
105-
| |-- SRR7877884.kreport.csv
106105
| |-- SRR7877884.krona.html
107-
| `-- SRR7877884.tsv
106+
| `-- SRR7877884.report.tsv
108107
|-- gottcha2
109108
| |-- SRR7877884.full.tsv
110109
| |-- SRR7877884.krona.html
111-
| |-- SRR7877884.summary.tsv
112110
| `-- SRR7877884.tsv
113111
`-- kraken2
114112
|-- SRR7877884.classification.csv
115113
|-- SRR7877884.krona.html
116-
|-- SRR7877884.report.csv
117-
`-- SRR7877884.tsv
114+
`-- SRR7877884.report.csv
118115

119116

120117
Requirements for Execution
121118
--------------------------
122119

123120
- Docker or other Container Runtime
124121
- Cromwell or other WDL-capable Workflow Execution Tool
125-
- 60 GB RAM
122+
- 50 GB RAM
126123

127124
Version History
128125
---------------
129126

130-
- 1.0.0
127+
- 0.0.1
131128

132129
Point of contact
133130
----------------

ReadbasedAnalysis.job

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
#!/bin/bash
22
#SBATCH --qos=regular
3-
#SBATCH --time=1800:00
3+
#SBATCH --time=12:00:00
44
#SBATCH --output=/global/cfs/projectdirs/m3408/aim2/metagenome/ReadbasedAnalysis/ReadbasedAnalysis.log
55
#SBATCH --nodes=1
6-
#SBATCH --ntasks=1
6+
#SBATCH --ntasks=3
77
#SBATCH --cpus-per-task 8
88
#SBATCH --mail-type=END,FAIL
9-
#SBATCH --mail-user=poe.paul.li@gmail.com
9+
#SBATCH --mail-user=your@email
1010
#SBATCH --constraint=haswell
1111
#SBATCH --account=m3408
12-
#SBATCH --job-name=
13-
14-
#OpenMP settings:
15-
#export OMP_NUM_THREADS=8
16-
#export OMP_PLACES=threads
17-
#export OMP_PROC_BIND=spread
12+
#SBATCH --job-name=ReadbasedAnalysis
1813

1914
cd /global/cfs/projectdirs/m3408/aim2/metagenome/ReadbasedAnalysis
2015

21-
java -XX:ParallelGCThreads=4 \
22-
-Dconfig.file=ReadbasedAnalysis_cromwell.conf \
16+
java -Dconfig.file=ReadbasedAnalysis_cromwell.conf \
2317
-jar /global/common/software/m3408/cromwell-45.jar \
24-
run -i ReadbasedAnalysis_inputs.json ReadbasedAnalysis.wdl
25-
18+
run \
19+
-i ReadbasedAnalysis_inputs.json \
20+
-o options.json \
21+
-m cromwell_metadata.json \
22+
ReadbasedAnalysis.wdl

ReadbasedAnalysis.wdl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ workflow ReadbasedAnalysis {
88
String prefix
99
String outdir
1010
Boolean? paired = false
11+
String? docker = "microbiomedata/nmdc_taxa_profilers:1.0.0"
1112

1213
if (enabled_tools["gottcha2"] == true) {
1314
call tp.profilerGottcha2 {
1415
input: READS = reads,
1516
DB = db["gottcha2"],
1617
PREFIX = prefix,
1718
OUTPATH = outdir+"/gottcha2",
18-
CPU = cpu
19+
CPU = cpu,
20+
DOCKER = docker
1921
}
2022
}
2123
if (enabled_tools["kraken2"] == true) {
@@ -25,7 +27,8 @@ workflow ReadbasedAnalysis {
2527
DB = db["kraken2"],
2628
PREFIX = prefix,
2729
OUTPATH = outdir+"/kraken2",
28-
CPU = cpu
30+
CPU = cpu,
31+
DOCKER = docker
2932
}
3033
}
3134
if (enabled_tools["centrifuge"] == true) {
@@ -34,7 +37,8 @@ workflow ReadbasedAnalysis {
3437
DB = db["centrifuge"],
3538
PREFIX = prefix,
3639
OUTPATH = outdir+"/centrifuge",
37-
CPU = cpu
40+
CPU = cpu,
41+
DOCKER = docker
3842
}
3943
}
4044
meta {

ReadbasedAnalysisTasks.wdl

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ task profilerGottcha2 {
44
String OUTPATH
55
String PREFIX
66
String? RELABD_COL = "ROLLUP_DOC"
7+
String DOCKER
78
Int? CPU = 4
89

910
command <<<
@@ -16,20 +17,16 @@ task profilerGottcha2 {
1617
-p ${PREFIX} \
1718
--database ${DB}
1819
19-
awk -F"\t" '{if($NF=="" || $NF=="NOTE"){print $_}}' ${OUTPATH}/${PREFIX}.full.tsv | cut -f -10 > ${OUTPATH}/${PREFIX}.summary.tsv
20-
awk -F"\t" '{if(NR==1){out=$1"\t"$2"\tROLLUP\tASSIGNED"; { for(i=3;i<=NF;i++){out=out"\t"$i}}; print out;}}' ${OUTPATH}/${PREFIX}.summary.tsv > ${OUTPATH}/${PREFIX}.out.list
21-
awk -F"\t" '{if(NR>1){out=$1"\t"$2"\t"$4"\t"; { for(i=3;i<=NF;i++){out=out"\t"$i}}; print out;}}' ${OUTPATH}/${PREFIX}.summary.tsv >> ${OUTPATH}/${PREFIX}.out.list
22-
ktImportText ${OUTPATH}/${PREFIX}.lineage.tsv -o ${OUTPATH}/${PREFIX}.krona.html
20+
grep "^species" ${OUTPATH}/${PREFIX}.tsv | ktImportTaxonomy -t 3 -m 9 -o ${OUTPATH}/${PREFIX}.krona.html -
2321
>>>
2422
output {
25-
File orig_out_tsv = "${OUTPATH}/${PREFIX}.summary.tsv"
26-
File orig_full_tsv = "${OUTPATH}/${PREFIX}.full.tsv"
27-
File orig_log = "${OUTPATH}/${PREFIX}.gottcha_species.log"
23+
File orig_out_tsv = "${OUTPATH}/${PREFIX}.full.tsv"
24+
File orig_rep_tsv = "${OUTPATH}/${PREFIX}.tsv"
2825
File krona_html = "${OUTPATH}/${PREFIX}.krona.html"
2926
}
3027
runtime {
31-
time: "1:30:00"
32-
memory: "50GB"
28+
docker: DOCKER
29+
memory: "50G"
3330
cpu: CPU
3431
}
3532
meta {
@@ -44,6 +41,7 @@ task profilerCentrifuge {
4441
String OUTPATH
4542
String PREFIX
4643
Int? CPU = 4
44+
String DOCKER
4745

4846
command <<<
4947
mkdir -p ${OUTPATH}
@@ -54,17 +52,16 @@ task profilerCentrifuge {
5452
-S ${OUTPATH}/${PREFIX}.classification.csv \
5553
--report-file ${OUTPATH}/${PREFIX}.report.csv
5654
57-
centrifuge-kreport -x ${DB} ${OUTPATH}/${PREFIX}.classification.csv > ${OUTPATH}/${PREFIX}.kreport.csv
58-
ktImportTaxonomy -m 3 -t 5 ${OUTPATH}/${PREFIX}.kreport.csv -o ${OUTPATH}/${PREFIX}.krona.html
55+
ktImportTaxonomy -m 4 -t 2 -o ${OUTPATH}/${PREFIX}.krona.html ${OUTPATH}/${PREFIX}.report.csv
5956
>>>
6057
output {
6158
File orig_out_tsv = "${OUTPATH}/${PREFIX}.classification.csv"
6259
File orig_rep_tsv = "${OUTPATH}/${PREFIX}.report.csv"
6360
File krona_html = "${OUTPATH}/${PREFIX}.krona.html"
6461
}
6562
runtime {
66-
time: "1:00:00"
67-
memory: "50GB"
63+
docker: DOCKER
64+
memory: "50G"
6865
cpu: CPU
6966
}
7067
meta {
@@ -80,6 +77,7 @@ task profilerKraken2 {
8077
String PREFIX
8178
Boolean? PAIRED = false
8279
Int? CPU = 4
80+
String DOCKER
8381

8482
command <<<
8583
mkdir -p ${OUTPATH}
@@ -91,20 +89,20 @@ task profilerKraken2 {
9189
--report ${OUTPATH}/${PREFIX}.report.csv \
9290
${sep=' ' READS}
9391
94-
ktImportTaxonomy -m 3 -t 5 ${OUTPATH}/${PREFIX}.report.csv -o ${OUTPATH}/${PREFIX}.krona.html
92+
ktImportTaxonomy -m 3 -t 5 -o ${OUTPATH}/${PREFIX}.krona.html ${OUTPATH}/${PREFIX}.report.csv
9593
>>>
9694
output {
9795
File orig_out_tsv = "${OUTPATH}/${PREFIX}.classification.csv"
9896
File orig_rep_tsv = "${OUTPATH}/${PREFIX}.report.csv"
9997
File krona_html = "${OUTPATH}/${PREFIX}.krona.html"
10098
}
10199
runtime {
102-
time: "1:00:00"
103-
memory: "50GB"
100+
docker: DOCKER
101+
memory: "50G"
104102
cpu: CPU
105103
}
106104
meta {
107105
author: "Po-E Li, B10, LANL"
108106
email: "po-e@lanl.gov"
109107
}
110-
}
108+
}

ReadbasedAnalysis_inputs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"ReadbasedAnalysis.paired": true,
1717
"ReadbasedAnalysis.prefix": "SRR7877884",
1818
"ReadbasedAnalysis.outdir": "/global/cfs/projectdirs/m3408/aim2/metagenome/ReadbasedAnalysis/SRR7877884",
19-
"ReadbasedAnalysis.cpu": 4
20-
}
19+
"ReadbasedAnalysis.cpu": 8
20+
}

0 commit comments

Comments
 (0)