Skip to content

Commit

Permalink
remove type Object which is not support by miniwdl. and use BBTools 3…
Browse files Browse the repository at this point in the history
…9.03
  • Loading branch information
Chienchi Lo committed Nov 5, 2024
1 parent c02c8ea commit 00e92c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Docker/BBtools_Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM ubuntu:20.04
LABEL base.image="ubuntu:20.04"
LABEL dockerfile.version="1"
LABEL software="BBTools"
LABEL software.version="39.10"
LABEL software.version="39.03"
LABEL description="A set of tools labeled as \"Bestus Bioinformaticus\""
LABEL website="https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/"
LABEL license="https://jgi.doe.gov/disclaimer/"
LABEL maintainer="Chienchi Lo"
LABEL maintainer.email="[email protected]"

ENV DEBIAN_FRONTEND=noninteractive
ENV BBMap_ver=39.10
ENV BBMap_ver=39.03
ENV LANG=en_US.UTF-8
ENV JAVA_HOME=/usr/java/openjdk-13
ENV PATH=/usr/java/openjdk-13/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Expand Down
38 changes: 18 additions & 20 deletions longReadsqc.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workflow LongReadsQC {
Boolean overwrite = true
File? reference
String pbmarkdup_container="microbiomedata/pbmarkdup:1.1"
String bbtools_container="microbiomedata/bbtools:39.10"
String bbtools_container="microbiomedata/bbtools:39.03"
# String outdir
# String prefix = basename(file)
}
Expand Down Expand Up @@ -58,7 +58,6 @@ workflow LongReadsQC {
call make_info_file {
input:
prefix = prefix,
pbmarkdup_container=pbmarkdup_container,
bbtools_container=bbtools_container,
pbmarkdup_log = pbmarkdup.outlog
}
Expand All @@ -72,8 +71,8 @@ workflow LongReadsQC {
icecream_stats = icecreamfilter.stats,
bbdukEnds_stats = bbdukEnds.stats,
bbdukReads_stats = bbdukReads.stats,
input_stats = pbmarkdup.input_stats,
output_stats = bbdukReads.output_stats
input_stats = flatten(pbmarkdup.input_stats),
output_stats = flatten(bbdukReads.output_stats)
}

output {
Expand Down Expand Up @@ -116,16 +115,16 @@ task pbmarkdup {

gzip ~{out_file}

echo -e "inputReads\tinputBases" > input_size.txt
seqtk size ~{in_file} >> input_size.txt
#echo -e "inputReads\tinputBases" > input_size.txt
seqtk size ~{in_file} > input_size.txt

>>>

output {
File out_fastq = "~{out_file}.gz"
File outlog = stdout()
File stats = stderr()
Object input_stats = read_object("input_size.txt")
Array[Array[String]] input_stats = read_tsv("input_size.txt")
}

runtime {
Expand Down Expand Up @@ -240,14 +239,14 @@ task bbdukReads {
~{"in=" + in_file} \
~{"out=" + out_file}

echo -e "outputReads\toutputBases" > output_size.txt
seqtk size ~{out_file} >> output_size.txt
#echo -e "outputReads\toutputBases" > output_size.txt
seqtk size ~{out_file} > output_size.txt
>>>

output {
File out_fastq = "~{out_file}"
File stats = "stderr"
Object output_stats = read_object("output_size.txt")
Array[Array[String]] output_stats = read_tsv("output_size.txt")
}

runtime {
Expand All @@ -259,7 +258,6 @@ task bbdukReads {
task make_info_file {
input {
String prefix
String pbmarkdup_container
String bbtools_container
File pbmarkdup_log
}
Expand All @@ -268,8 +266,8 @@ task make_info_file {

set -oeu pipefail

bbtools_version=`grep "Version" /bbmap/README.md | sed 's/#//'`
pbmarkdup_version=`grep "pbmarkdup" ~{pbmarkdup_log}`
bbtools_version=$(grep "Version" /bbmap/README.md | sed 's/#//')
pbmarkdup_version=$(grep "pbmarkdup" ~{pbmarkdup_log})

echo -e "Long Reads QC Workflow - Info File" > ~{prefix}_readsQC.info
echo -e "This workflow performs QC on PacBio metagenome sequencing files and produces filtered fastq files and statistics using the following tools and Docker containers" >> ~{prefix}_readsQC.info
Expand Down Expand Up @@ -299,24 +297,24 @@ task finish_rqc {
File icecream_stats
File bbdukEnds_stats
File bbdukReads_stats
Object input_stats
Object output_stats
Array[String] input_stats
Array[String] output_stats
File filtered
String container
String prefix
}
Map [String, Int] stats_map = {
"output_read_bases" : output_stats.outputBases,
"input_read_count" : input_stats.inputReads,
"input_read_bases" : input_stats.inputBases,
"output_read_count" : output_stats.outputReads
"input_read_count" : input_stats[0],
"input_read_bases" : input_stats[1],
"output_read_count" : output_stats[0],
"output_read_bases" : output_stats[1]
}
File stats_json = write_json(stats_map)

command<<<
set -oeu pipefail
end=`date --iso-8601=seconds`
#end=$(date --iso-8601=seconds)
# Generate QA objects
ln -s ~{filtered} ~{prefix}_filtered.fastq.gz
ln -s ~{pbmarkdup_stats} ~{prefix}_pbmarkdupStats.txt
Expand Down

0 comments on commit 00e92c9

Please sign in to comment.