Skip to content

Commit

Permalink
Get basename of FILENAME awk
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Nov 28, 2023
1 parent 1d76884 commit d3f5963
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workflow/rules/paired-end.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d3f5963

Please sign in to comment.