Skip to content

Commit

Permalink
Add krona task to TheiaMeta_Illumina_PE (#213)
Browse files Browse the repository at this point in the history
* create krona task; add krona to raw and clean keaken reports in theiameta_illumina_pe

* fix bug

---------

Co-authored-by: Sage Wright <[email protected]>
  • Loading branch information
cimendes and sage-wright authored Nov 27, 2023
1 parent 358941a commit 203ec3b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tasks/taxon_id/task_krona.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version 1.0

task krona {
input {
File kraken2_report
String samplename
String docker = "us-docker.pkg.dev/general-theiagen/biocontainers/krona:2.7.1--pl526_5"
Int memory = 8
Int cpu = 4
}
command <<<
# Get VERSION
ktImportTaxonomy 2>&1 | sed -n '/KronaTools /p' | sed 's/^.*KronaTools //; s/ - ktImportTaxonomy.*//' | tee VERSION

# Get taxonomy file
ktUpdateTaxonomy.sh taxonomy

# Run krona with taxonomy on krakren report
ktImportTaxonomy -o ~{samplename}_krona.html ~{kraken2_report} -tax taxonomy
>>>
output {
String krona_version = read_string("VERSION")
String krona_docker = docker
File krona_html = "~{samplename}_krona.html"
}
runtime {
docker: "~{docker}"
memory: "~{memory} GB"
cpu: cpu
disks: "local-disk 100 SSD"
preemptible: 0
}
}
16 changes: 16 additions & 0 deletions workflows/metagenomics/wf_theiameta_illumina_pe.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version 1.0
import "../utilities/wf_read_QC_trim_pe.wdl" as read_qc_wf
import "../utilities/wf_metaspades_assembly.wdl" as metaspades_assembly_wf
import "../../tasks/taxon_id/task_kraken2.wdl" as kraken_task
import "../../tasks/taxon_id/task_krona.wdl" as krona_task
import "../../tasks/alignment/task_minimap2.wdl" as minimap2_task
import "../../tasks/utilities/task_parse_mapping.wdl" as parse_mapping_task
import "../../tasks/quality_control/task_quast.wdl" as quast_task
Expand Down Expand Up @@ -30,6 +31,11 @@ workflow theiameta_illumina_pe {
classified_out = "classified#.fastq",
unclassified_out = "unclassified#.fastq"
}
call krona_task.krona as krona_raw {
input:
kraken2_report = kraken2_raw.kraken2_report,
samplename = samplename
}
call read_qc_wf.read_QC_trim_pe as read_QC_trim {
input:
samplename = samplename,
Expand All @@ -47,6 +53,11 @@ workflow theiameta_illumina_pe {
classified_out = "classified#.fastq",
unclassified_out = "unclassified#.fastq"
}
call krona_task.krona as krona_clean {
input:
kraken2_report = kraken2_clean.kraken2_report,
samplename = samplename
}
call metaspades_assembly_wf.metaspades_assembly_pe as metaspades {
input:
read1 = read_QC_trim.read1_clean,
Expand Down Expand Up @@ -134,6 +145,11 @@ workflow theiameta_illumina_pe {
Float kraken2_percent_human_raw = kraken2_raw.kraken2_percent_human
File kraken2_report_clean = kraken2_clean.kraken2_report
Float kraken2_percent_human_clean = kraken2_clean.kraken2_percent_human
# Krona outputs
String krona_version = krona_raw.krona_version
String krona_docker = krona_raw.krona_docker
File krona_html_raw = krona_raw.krona_html
File krona_html_clean = krona_clean.krona_html
# Read QC - dehosting outputs
File? read1_dehosted = read_QC_trim.read1_dehosted
File? read2_dehosted = read_QC_trim.read2_dehosted
Expand Down

0 comments on commit 203ec3b

Please sign in to comment.