Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add krona task to TheiaMeta_Illumina_PE #213

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_raw.kraken2_report,
sage-wright marked this conversation as resolved.
Show resolved Hide resolved
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