Skip to content

Commit

Permalink
Merge pull request #91 from theiagen/smw-quasitools-bug-fix-dev
Browse files Browse the repository at this point in the history
Quasitools Bug Discovery and Destruction
  • Loading branch information
kevinlibuit authored Jun 12, 2023
2 parents 87e8c43 + 5e07a1f commit c5d2f38
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
10 changes: 6 additions & 4 deletions tasks/quality_control/task_artic_guppyplex.wdl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version 1.0

task read_filtering { # in use
task read_filtering {
input {
File demultiplexed_reads
String samplename
String run_prefix = "artic_ncov2019"
String docker = "quay.io/staphb/artic-ncov2019:1.3.0-medaka-1.4.3"
Int min_length = 400
Int max_length = 700
Int cpu = 8
Expand All @@ -15,18 +16,19 @@ task read_filtering { # in use
mkdir ~{samplename}
cp ~{demultiplexed_reads} ~{samplename}/
echo "DIRNAME: $(dirname)"
artic guppyplex --min-length ~{min_length} --max-length ~{max_length} --directory ~{samplename} --prefix ~{run_prefix}

# run artic guppyplex
artic guppyplex --min-length ~{min_length} --max-length ~{max_length} --directory ~{samplename} --prefix ~{run_prefix}
>>>
output {
File filtered_reads = "~{run_prefix}_~{samplename}.fastq"
}
runtime {
docker: "quay.io/staphb/artic-ncov2019:1.3.0-medaka-1.4.3"
docker: docker
memory: "16 GB"
cpu: cpu
disks: "local-disk " + disk_size + " SSD"
disk: disk_size + " GB" # TES
disk: disk_size + " GB"
preemptible: 0
maxRetries: 3
}
Expand Down
23 changes: 15 additions & 8 deletions tasks/species_typing/task_quasitools.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ task quasitools {
input {
File read1
File? read2
File mutation_db = "gs://theiagen-public-files/terra/hivgc-files/mutation_db.tsv"
String samplename
String docker = "quay.io/biocontainers/quasitools:0.7.0--pyh864c0ab_1"
}
Expand All @@ -20,34 +19,42 @@ task quasitools {
fi
read1_unzip=r1.fastq

# do the same on read2
# unzip file if necessary
if ~ [ -z ~{read2} ]; then
# do the same on read2 if exists & unzip file if necessary
if [[ -e "~{read2}" ]]; then
if [[ "~{read2}" == *.gz ]]; then
gunzip -c ~{read2} > r2.fastq
else
mv ~{read2} r2.fastq
fi
read2_unzip=r2.fastq
else
ont="-rt 5"
ont="-rt 5" # set the minimum number of observations in the read data to 5 instead of the default of 1 if ONT data
fi


# Print and save version
quasitools --version > QUASITOOLS_VERSION && sed -i -e 's/^/quasitools /' QUASITOOLS_VERSION

# Run hydra
# -mf : the minimum frequency for observed variant to be included for processing
# -sc : reads that have a median/mean quality score less than this cutoff will be filtered out
# -lc : reads which fall short of this length will be filtered out
# -vq : minimum quality for an amino acid variant to be included
# -md : the minimum read depth for observed nucleotide variants to be included
# -ma : the minimum allele count for observed variants to be included
# -me : indicates that the median score will be used as a cutoff for read filtering

# the ${ont} needs to be on the same line as a different variable or it will fail
set -e
quasitools hydra \
-mf 0.05 \
"${ont}" \
-mf 0.05 ${ont} \
-sc 7 \
-lc 50 \
-vq 7 \
-md 10 \
-ma 1 \
-me ${read1_unzip} ${read2_unzip} \
-me \
${read1_unzip} ${read2_unzip} \
-o "~{samplename}"
>>>
runtime {
Expand Down
6 changes: 5 additions & 1 deletion workflows/theiacov/wf_theiacov_ont.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ workflow theiacov_ont {
# qc check parameters
File? qc_check_table
}
if (organism == "HIV") { # set HIV specific artic version
String run_prefix = "artic_hiv"
}
call screen.check_reads_se as raw_check_reads {
input:
read1 = demultiplexed_reads,
Expand All @@ -74,7 +77,8 @@ workflow theiacov_ont {
demultiplexed_reads = ncbi_scrub_se.read1_dehosted,
samplename = samplename,
min_length = min_length,
max_length = max_length
max_length = max_length,
run_prefix = run_prefix
}
call screen.check_reads_se as clean_check_reads {
input:
Expand Down

0 comments on commit c5d2f38

Please sign in to comment.