Commit 9b5550a4 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

vhm

parent 5efe1830
......@@ -28,6 +28,7 @@ rule all:
#expand("work/addon/catalogue.{sample}.unmapped.taxNames.tsv", sample=config["SAMPLES"]),
#virome
expand("report/viromeQC-{sample}.txt", sample=config["SAMPLES"]),
expand("work/virhostmatcher/{sample}/done", sample=config["SAMPLES"]),
include: "../workflow_metagenomics/quality.smk"
......
......@@ -19,3 +19,29 @@ rule viromeQC:
"--tempdir /projet/tmp/ "
"&& "
"conda deactivate "
rule virhostmatcher:
input:
unpack(contigs_input)
output:
done = "work/virhostmatcher/{sample}/done"
params:
splittedGenomes = "work/virhostmatcher/{sample}/splittedGenomes",
output = lambda wildcards, output: os.path.dirname(str(output))
shell:
"mkdir -p {params.splittedGenomes} "
"&& "
"awk '/^>/ {{if(x>0) {{close(outname); x=0}} match($0, \">([^| ]*)\", record);outname=sprintf(\"{params.splittedGenomes}/%s.fa\",record[1]); if (x>0) {{print >> outname}} else {{print > outname;}} x++; next;}} {{if(x>0) print >> outname;}}' {input} " # https://github.com/soedinglab/WIsH#tricks
"&& "
# "conda activate vhm "
# "&& "
"vhm.py "
"--virusFaDir {params.splittedGenomes} "
"--hostFaDir /projet/irstea/WIsH_2020/Host/ "
"--out {params.output} "
"--taxa /projet/irstea/WIsH_2020/Host.txt "
"--d2star 0 "
# "&& "
# "conda deactivate "
"&& "
"touch {output.done} "
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment