Commit 53c3d377 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

FragGeneScan prodigal

parent 29e6c257
rule FragGeneScan:
input:
unpack(contigs_input)
output:
faa = "work/FGS/{sample}_FGS.faa",
ffn = "work/FGS/{sample}_FGS.ffn",
gff = "work/FGS/{sample}_FGS.gff",
out = temp("work/FGS/{sample}_FGS.out")
threads:
4
params:
output = lambda wildcards, output: os.path.splittext(str(output))[0]
shell:
"run_FragGeneScan.pl "
"-genome={input} "
"-out={params.output} "
"-complete=0 " #negative values with complete=1
"-train=complete "
"-thread={threads} "
" ; "
"sed --in-place 's/*/N/' {output.faa} "
rule prodigal:
input:
unpack(contigs_input)
output:
faa = "work/prodigal/{sample}_prodigal.faa",
ffn = "work/prodigal/{sample}_prodigal.ffn",
gff = "work/prodigal/{sample}_prodigal.gff"
shell:
"prodigal "
"-f gff "
"-i {input} "
"-a {output.faa} "
"-d {output.ffn} "
"-o {output.gff} "
"-g 11 "
"-p meta "
# " ; "
# "sed --in-place 's/*/N/' {output.faa} "
def faa_input(wildcards):
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
return {"faa": "work/FGS/{wildcards.sample}_FGS.faa".format(wildcards=wildcards)}
elif config["PROTEINS-PREDICTOR"] == "prodigal":
return {"faa": "work/prodigal/{wildcards.sample}_prodigal.faa".format(wildcards=wildcards)}
def ffn_input(wildcards):
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
return {"fnn": "work/FGS/{wildcards.sample}_FGS.ffn".format(wildcards=wildcards)}
elif config["PROTEINS-PREDICTOR"] == "prodigal":
return {"fnn": "work/prodigal/{wildcards.sample}_prodigal.ffn".format(wildcards=wildcards)}
def gff_input(wildcards):
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
return {"gff": "work/FGS/{wildcards.sample}_FGS.gff".format(wildcards=wildcards)}
elif config["PROTEINS-PREDICTOR"] == "prodigal":
return {"gff": "work/prodigal/{wildcards.sample}_prodigal.gff".format(wildcards=wildcards)}
...@@ -79,7 +79,7 @@ rule metaspades: ...@@ -79,7 +79,7 @@ rule metaspades:
min_len = config["CONTIGS_LEN"], min_len = config["CONTIGS_LEN"],
mem_tot = 250, mem_tot = 250,
input = lambda wildcards, input: " --12 ".join(input), input = lambda wildcards, input: " --12 ".join(input),
output = lambda wildcards, output: os.path.dirname(str(output)) output = lambda wildcards, output: os.path.dirname(str(output.contigs))
shell: shell:
"spades.py " "spades.py "
"--threads {threads} " "--threads {threads} "
......
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
"NORMALIZATION": false, "NORMALIZATION": false,
"SORTMERNA": false, "SORTMERNA": false,
"ASSEMBLER": "metaspades", "ASSEMBLER": "metaspades",
"CONTIGS_LEN": 1000 "CONTIGS_LEN": 1000,
"PROTEINS-PREDICTOR": "prodigal"
} }
...@@ -15,3 +15,4 @@ include: "../workflow_metagenomics/quality.smk" ...@@ -15,3 +15,4 @@ include: "../workflow_metagenomics/quality.smk"
include: "../workflow_metagenomics/preprocess.smk" include: "../workflow_metagenomics/preprocess.smk"
include: "../workflow_metagenomics/kaiju.smk" include: "../workflow_metagenomics/kaiju.smk"
include: "../workflow_metagenomics/assembly.smk" include: "../workflow_metagenomics/assembly.smk"
include: "../workflow_metagenomics/annotation.smk"
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