From d3f59639fd0a30f82ca3d4721f477cf5f68b57e2 Mon Sep 17 00:00:00 2001 From: skchronicles Date: Tue, 28 Nov 2023 18:25:45 -0500 Subject: [PATCH] Get basename of FILENAME awk --- workflow/rules/paired-end.smk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow/rules/paired-end.smk b/workflow/rules/paired-end.smk index b416f4a..6992165 100644 --- a/workflow/rules/paired-end.smk +++ b/workflow/rules/paired-end.smk @@ -771,9 +771,9 @@ rule blast_metaspades_xlsx: # Adding a column to the output # that contains each sample name awk -F '\\t' -v OFS='\\t' \\ - 'FNR>1 {{sub("{params.extension}", "", FILENAME); print FILENAME, $0}}' \\ + 'FNR>1 {{sub(".*/", "", FILENAME); sub("{params.extension}", "", FILENAME); print FILENAME, $0}}' \\ {input.blasts} \\ - > {output.tsv} + >> {output.tsv} # Create an excel spreadsheet # containing the blast results @@ -879,9 +879,9 @@ rule blast_megahit_xlsx: # Adding a column to the output # that contains each sample name awk -F '\\t' -v OFS='\\t' \\ - 'FNR>1 {{sub("{params.extension}", "", FILENAME); print FILENAME, $0}}' \\ + 'FNR>1 {{sub(".*/", "", FILENAME); sub("{params.extension}", "", FILENAME); print FILENAME, $0}}' \\ {input.blasts} \\ - > {output.tsv} + >> {output.tsv} # Create an excel spreadsheet # containing the blast results