Skip to content

Commit

Permalink
Merge pull request #213 from erikrikarddaniel/reorder-prokka-cols
Browse files Browse the repository at this point in the history
Reorder & rename prokka cols, save output to better named file
  • Loading branch information
danilodileo authored Nov 28, 2023
2 parents f7a3c45 + 2f5726e commit 601a673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ process {
publishDir = [
path: { "${params.outdir}/summary_tables" },
mode: 'copy',
pattern: "*.annotations.tsv.gz"
pattern: "*.prokka-annotations.tsv.gz"
]
}

Expand Down
7 changes: 5 additions & 2 deletions modules/local/prokkagff2tsv.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process PROKKAGFF2TSV {
tuple val(meta), path(gff)

output:
tuple val(meta), path("*.annotations.tsv.gz"), emit: tsv
tuple val(meta), path("*.prokka-annotations.tsv.gz"), emit: tsv
path "versions.yml" , emit: versions

when:
Expand All @@ -29,6 +29,7 @@ process PROKKAGFF2TSV {
library(dplyr)
library(tidyr)
library(readr)
library(stringr)
fread(
cmd = "zgrep -P '\\t' $gff",
Expand All @@ -39,9 +40,11 @@ process PROKKAGFF2TSV {
pivot_wider(names_from = k, values_from = v) %>%
select(-a, -b) %>%
rename(orf = ID) %>%
rename_all(str_to_lower) %>%
relocate(sort(colnames(.)[8:ncol(.)]), .after = 7) %>%
relocate(orf) %>%
as.data.table() %>%
write_tsv("${prefix}.annotations.tsv.gz")
write_tsv("${prefix}.prokka-annotations.tsv.gz")
writeLines(
c(
Expand Down

0 comments on commit 601a673

Please sign in to comment.