Commit 6e480a47 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

kaiju.smk

parent 19f5a921
......@@ -3,13 +3,13 @@
{
"out" : "./.log/out/",
"err" : "./.log/err/",
"queue" : "maiage.q",
"queue" : "short.q,long.q,maiage.q",
"cluster" : ""
},
"kaiju" :
{
"queue" : "highmem.q,maiage.q",
"cluster" : "-l h_vmem={MEM}G"
"cluster" : "-l h_vmem=10G"
},
"khmer" :
{
......
......@@ -7,6 +7,8 @@ configfile: "./config.json"
rule all:
input:
"report/multiqc_report.html",
expand("report/reads_{sample}-krona.html", sample=config["SAMPLES"]),
include: "../workflow_metagenomics/quality.smk"
include: "../workflow_metagenomics/preprocess.smk"
include: "../workflow_metagenomics/kaiju.smk"
def kaiju_input(wildcards):
if wildcards.focus == "contigs":
return contigs_input(wildcards)
elif wildcards.focus == "genes":
return ffn_input(wildcards)
elif wildcards.focus == "reads":
return {"R1": "DATA/trim/{wildcards.sample}_R1.fastq.gz".format(wildcards=wildcards), "R2": "DATA/trim/{wildcards.sample}_R2.fastq.gz".format(wildcards=wildcards)}
rule kaiju:
input:
unpack(kaiju_input)
output:
"work/kaiju/{focus,[a-z]+}_{sample}.kaijuNR"
threads:
8
params:
input = lambda wildcards, input: "-i %s -j %s"%(input.R1, input.R2) if wildcards.focus == "reads" else "-i %s"%input
shell:
"kaiju "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-f /db/outils/kaiju/nr/kaiju_db_nr_euk.fmi "
"{params.input} "
"-o {output} "
"-z {threads}"
rule krona:
input:
"work/kaiju/{sample}.kaijuNR"
output:
temp("work/kaiju/{sample}.krona")
shell:
"kaiju2krona "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-n /db/outils/kaiju/nr/names.dmp "
"-i {input} "
"-o {output} "
"-u"
rule kronaHTML:
input:
"work/kaiju/{sample}.krona"
output:
"report/{sample}-krona.html"
shell:
"ktImportText "
"-o {output} "
"{input}"
rule kronaNames:
input:
"work/kaiju/{sample}.kaijuNR"
output:
"report/{sample}-taxNames.tsv"
shell:
"addTaxonNames "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-n /db/outils/kaiju/nr/names.dmp "
"-i {input} "
"-o {output} "
"-r superkingdom,phylum,order,class,family,genus,species"
\ No newline at end of file
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