Skip to content

Commit

Permalink
modifying the rule to use /script/gfa_to_fasta
Browse files Browse the repository at this point in the history
  • Loading branch information
LiaOb21 committed Feb 27, 2024
1 parent 55d6a1d commit aa739d1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions workflow/rules/hifiasm.smk
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This rule uses hifiasm to assemble the genome from the hifi reads
# Following the instructions for obtaining primary/alternate assemblies: https://hifiasm.readthedocs.io/en/latest/pa-assembly.html#produce-primary-alternate-assemblies

GFA_TO_FASTA = r"""/^S/{print ">"$2;print $3}"""

rule run_hifiasm:
input:
"results/reads/hifi/hifi.fastq.gz",
Expand All @@ -23,6 +21,6 @@ rule run_hifiasm:
shell:
"""
hifiasm {input} -t {threads} -o results/hifiasm/hifiasm.asm --primary {params.optional_params} >> {log} 2>&1
awk {GFA_TO_FASTA:q} {output.gfa} > {output.fasta}
awk {GFA_TO_FASTA:q} {output.gfa_alt} > {output.fasta_alt}
awk -f scripts/gfa_to_fasta.awk < {output.gfa} > {output.fasta}
awk -f scripts/gfa_to_fasta.awk < {output.gfa_alt} > {output.fasta_alt}
"""

0 comments on commit aa739d1

Please sign in to comment.