From 565cbb58ab7ed88be6b528e2fec95b94e969485e Mon Sep 17 00:00:00 2001 From: tives82 Date: Tue, 9 Apr 2024 14:23:06 -0600 Subject: [PATCH] Update IRMA output settings and refine Abricate flu B classification --- modules/local/abricate_flu.nf | 14 ++++++++++---- modules/local/irma.nf | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/local/abricate_flu.nf b/modules/local/abricate_flu.nf index e12763b..d7819ff 100755 --- a/modules/local/abricate_flu.nf +++ b/modules/local/abricate_flu.nf @@ -75,9 +75,13 @@ process ABRICATE_FLU { # Find INSaFLU subtype if Type B if grep -q "Type_B" $abricate_type; then - if grep -q "Victoria" ${meta.id}_abricate_hits.tsv; then + # Check for Victoria with hemagglutinin or neuraminidase or both + if (grep -q "Victoria" ${meta.id}_abricate_hits.tsv && grep -q "hemagglutinin" ${meta.id}_abricate_hits.tsv) || \ + (grep -q "Victoria" ${meta.id}_abricate_hits.tsv && grep -q "neuraminidase" ${meta.id}_abricate_hits.tsv); then echo "Victoria" > $abricate_subtype - elif grep -q "Yamagata" ${meta.id}_abricate_hits.tsv; then + # Check for Yamagata with hemagglutinin or neuraminidase or both + elif (grep -q "Yamagata" ${meta.id}_abricate_hits.tsv && grep -q "hemagglutinin" ${meta.id}_abricate_hits.tsv) || \ + (grep -q "Yamagata" ${meta.id}_abricate_hits.tsv && grep -q "neuraminidase" ${meta.id}_abricate_hits.tsv); then echo "Yamagata" > $abricate_subtype else echo "No abricate subtype" > $abricate_subtype @@ -114,10 +118,12 @@ process ABRICATE_FLU { elif grep -q "H10" ${meta.id}_abricate_hits.tsv && grep -q "N8" ${meta.id}_abricate_hits.tsv; then echo "H10N8" > $abricate_subtype # Victoria - elif grep -q "Victoria" ${meta.id}_abricate_hits.tsv; then + elif (grep -q "Victoria" ${meta.id}_abricate_hits.tsv && grep -q "hemagglutinin" ${meta.id}_abricate_hits.tsv) || \ + (grep -q "Victoria" ${meta.id}_abricate_hits.tsv && grep -q "neuraminidase" ${meta.id}_abricate_hits.tsv); then echo "Victoria" > $abricate_subtype # Yamagata - elif grep -q "Yamagata" ${meta.id}_abricate_hits.tsv; then + elif (grep -q "Yamagata" ${meta.id}_abricate_hits.tsv && grep -q "hemagglutinin" ${meta.id}_abricate_hits.tsv) || \ + (grep -q "Yamagata" ${meta.id}_abricate_hits.tsv && grep -q "neuraminidase" ${meta.id}_abricate_hits.tsv); then echo "Yamagata" > $abricate_subtype else echo "No abricate subtype" > $abricate_subtype diff --git a/modules/local/irma.nf b/modules/local/irma.nf index 6afb89e..bcdd09f 100755 --- a/modules/local/irma.nf +++ b/modules/local/irma.nf @@ -10,8 +10,8 @@ process IRMA { output: tuple val(meta), path("${meta.id}/") , emit: irma - tuple val(meta), path("${meta.id}/*.bam") , emit: irma_bam - tuple val(meta), path("${meta.id}/*.fasta") , emit: irma_fasta + tuple val(meta), path("${meta.id}/*.bam") , optional:true, emit: irma_bam + tuple val(meta), path("${meta.id}/*.fasta") , optional:true, emit: irma_fasta tuple val(meta), path("*.irma.consensus.fasta") , optional:true, emit: assembly tuple val(meta), path("*_LOW_ABUNDANCE.txt") , optional:true, emit: failed_assembly tuple val(meta), path("*_HA.fasta") , optional:true, emit: HA