From 172123f575c3dbf99e340d7717499c42923498c2 Mon Sep 17 00:00:00 2001 From: Steven Sutcliffe Date: Tue, 11 Jun 2024 14:22:00 -0400 Subject: [PATCH 1/3] Draft: Add metadata in irida-output --- conf/iridanext.config | 24 +++++++++++++++++------- modules/local/staramr/main.nf | 5 ++++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/conf/iridanext.config b/conf/iridanext.config index 741ad04..f9d58d6 100644 --- a/conf/iridanext.config +++ b/conf/iridanext.config @@ -7,13 +7,23 @@ iridanext { global = [ ] samples = [ - "**/**/detailed_summary.tsv", - "**/**/mlst.tsv", - "**/**/plasmidfinder.tsv", - "**/**/resfinder.tsv", - "**/**/results.xlsx", - "**/**/settings.txt", - "**/**/summary.tsv"] + "**/detailed_summary.tsv", + "**/mlst.tsv", + "**/plasmidfinder.tsv", + "**/resfinder.tsv", + "**/results.xlsx", + "**/settings.txt", + "**/summary.tsv"] + } + metadata: { + samples { + csv { + path = "**/summary.tsv" + sep = "\t" + idcol = "Isolate ID" + } } } } + } + diff --git a/modules/local/staramr/main.nf b/modules/local/staramr/main.nf index b8a4614..83bd0c7 100644 --- a/modules/local/staramr/main.nf +++ b/modules/local/staramr/main.nf @@ -34,12 +34,15 @@ process STARAMR_SEARCH { gzip -c -d $contigs > $genome_uncompressed_name fi + #Change name of input genome to sample name to allow irida-next output of metadata + mv $genome_uncompressed_name ${meta.id} + staramr \\ search \\ $args \\ --nprocs $task.cpus \\ -o ${prefix}_results \\ - $genome_uncompressed_name + $meta.id cat <<-END_VERSIONS > versions.yml "${task.process}": From d7417cb7a4ad9d89cd2048e1e01609c8c39a90cd Mon Sep 17 00:00:00 2001 From: Steven Sutcliffe Date: Tue, 11 Jun 2024 20:03:45 -0400 Subject: [PATCH 2/3] Found a misplaced colon keeping meta from populating --- conf/iridanext.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/iridanext.config b/conf/iridanext.config index f9d58d6..5d98809 100644 --- a/conf/iridanext.config +++ b/conf/iridanext.config @@ -15,7 +15,7 @@ iridanext { "**/settings.txt", "**/summary.tsv"] } - metadata: { + metadata { samples { csv { path = "**/summary.tsv" From 7d107b74dea77c0873ffd11eb3531ce782644f87 Mon Sep 17 00:00:00 2001 From: Steven Sutcliffe Date: Wed, 12 Jun 2024 15:19:17 -0400 Subject: [PATCH 3/3] Added genome_filename variable for genome used by staramr --- modules/local/staramr/main.nf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/local/staramr/main.nf b/modules/local/staramr/main.nf index 83bd0c7..788591a 100644 --- a/modules/local/staramr/main.nf +++ b/modules/local/staramr/main.nf @@ -29,20 +29,21 @@ process STARAMR_SEARCH { def prefix = task.ext.prefix ?: "${meta.id}" def is_gzipped = contigs.getName().endsWith(".gz") ? true : false def genome_uncompressed_name = contigs.getName().replace(".gz", "") + def genome_filename = "${meta.id}.fasta" """ if [ "$is_gzipped" = "true" ]; then gzip -c -d $contigs > $genome_uncompressed_name fi - #Change name of input genome to sample name to allow irida-next output of metadata - mv $genome_uncompressed_name ${meta.id} + #Change name of input genome to allow irida-next output of metadata + mv $genome_uncompressed_name $genome_filename staramr \\ search \\ $args \\ --nprocs $task.cpus \\ -o ${prefix}_results \\ - $meta.id + $genome_filename cat <<-END_VERSIONS > versions.yml "${task.process}":