Skip to content
Snippets Groups Projects

Add PlasFlow and RGI

Merged Valentina Galata requested to merge checkpoint_snakefile_VG into checkpoint_snakefile
1 file
+ 6
4
Compare changes
  • Side-by-side
  • Inline
@@ -233,6 +233,7 @@ rule plasflow:
# RGI #
#######
# RGI input: proteins
# NOTE: remove stop codon symbol "*"
# NOTE: one rule per assembly to have a workaround for the issue with file paths
# should be resolved properly later
rule rgi_input_flye:
@@ -247,7 +248,7 @@ rule rgi_input_metaspades_hybrid:
input:
os.path.abspath(os.path.join(RESULTS_DIR, "annotation/proteins/metaspades_hybrid/lr_no_barcode-sr_ONT3_MG_xx_Rashi_S11/contigs.faa"))
output:
os.path.join(RESULTS_DIR, "analysis/rgi/metaspades_hybrid.faa")
temp(os.path.join(RESULTS_DIR, "analysis/rgi/metaspades_hybrid.faa"))
shell:
"sed 's/\*$//' {input} > {output}"
@@ -255,7 +256,7 @@ rule rgi_input_metaspades:
input:
os.path.abspath(os.path.join(RESULTS_DIR, "annotation/proteins/metaspades/ONT3_MG_xx_Rashi_S11/final.contigs.faa"))
output:
os.path.join(RESULTS_DIR, "analysis/rgi/metaspades.faa")
temp(os.path.join(RESULTS_DIR, "analysis/rgi/metaspades.faa"))
shell:
"sed 's/\*$//' {input} > {output}"
@@ -263,7 +264,7 @@ rule rgi_input_megahit:
input:
os.path.abspath(os.path.join(RESULTS_DIR, "annotation/proteins/megahit/ONT3_MG_xx_Rashi_S11/final.contigs.faa"))
output:
os.path.join(RESULTS_DIR, "analysis/rgi/megahit.faa")
temp(os.path.join(RESULTS_DIR, "analysis/rgi/megahit.faa"))
shell:
"sed 's/\*$//' {input} > {output}"
@@ -300,10 +301,11 @@ rule rgi_prot:
message:
"AMR prediction w/ RGI: {input}"
shell:
# NOTE: to make sure that the correct DB is used
"rgi clean --local &> {log} && "
"rgi load --card_json {input.db} --local &>> {log} && "
"rgi database --version --local &>> {log} && "
# NOTE: https://github.com/arpcard/rgi/issues/93
# NOTE: https://github.com/arpcard/rgi/issues/93: KeyError: 'snp'
# need to run the CMD twice
"rgi main --input_sequence {input.faa} --output_file {params.obname} --input_type protein --local -a {params.alignment_tool} --clean -n {threads} &>> {log} || "
"rgi main --input_sequence {input.faa} --output_file {params.obname} --input_type protein --local -a {params.alignment_tool} --clean -n {threads} &>> {log}"
Loading