Skip to content

Commit

Permalink
Improve for rule 'prokka'
Browse files Browse the repository at this point in the history
  • Loading branch information
vinisalazar committed Mar 5, 2024
1 parent 05ecaf2 commit e8d772f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metaphor/workflow/rules/annotation.smk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ rule prokka:
outfile="output/annotation/prokka/{binning_group}/{bin}/{bin}.fna",
params:
outdir=lambda w, output: str(Path(output.outfile).parent),
kingdom_cmd=lambda w, input: f"grep '{w.bin}' {input.bin_evals}",
args=config["prokka"]["args"],
wildcard_constraints:
binning_group="|".join(binning_group_names),
Expand All @@ -94,8 +93,9 @@ rule prokka:
shell:
"""
# Get kingdom from bin eval file
kingdom=$({params.kingdom_cmd} | cut -f 5)
kingdom=$(echo $kingdom | head -c 1 | tr '[a-z]' '[A-Z]'; echo $kingdom | tail -c +2)
bin_clean=$(echo {wildcards.bin} | sed 's/_sub$//g') # Remove '_sub' from corrected bins
kingdom=$(grep $bin_clean {input.bin_evals})
kingdom=$(echo $kingdom | cut -f 5 | head -c 1 | tr '[a-z]' '[A-Z]'; echo $kingdom | tail -c +2)
prokka --outdir {params.outdir} \
--kingdom $kingdom \
Expand Down

0 comments on commit e8d772f

Please sign in to comment.