Commit 714cfafb authored by Midoux Cedric's avatar Midoux Cedric
Browse files

faa for catalogue

parent a8729799
......@@ -40,10 +40,13 @@ rule prodigal:
# "sed --in-place 's/*/N/' {output.faa} "
def faa_input(wildcards):
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
return {"faa": "work/FGS/{wildcards.sample}/{wildcards.sample}_FGS.faa".format(wildcards=wildcards)}
elif config["PROTEINS-PREDICTOR"] == "prodigal":
return {"faa": "work/prodigal/{wildcards.sample}/{wildcards.sample}_prodigal.faa".format(wildcards=wildcards)}
if wildcards.sample == "catalogue":
return ["work/cdhit/catalogue.faa"]
else :
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
return {"faa": "work/FGS/{wildcards.sample}/{wildcards.sample}_FGS.faa".format(wildcards=wildcards)}
elif config["PROTEINS-PREDICTOR"] == "prodigal":
return {"faa": "work/prodigal/{wildcards.sample}/{wildcards.sample}_prodigal.faa".format(wildcards=wildcards)}
def ffn_input(wildcards):
if config["PROTEINS-PREDICTOR"] == "FragGeneScan":
......
......@@ -80,3 +80,29 @@ rule cd_hit_2D:
"-d 0 "
"-M 0 "
"-T {threads} "
rule faa_catalogue:
input:
ffn = "work/cdhit/catalogue.ffn"
faa = expand("work/prodigal/{sample}/{sample}.faa", sample=config["SAMPLES"])
output:
list = temp("work/cdhit/catalogue.list")
faa = "work/cdhit/catalogue.faa"
threads:
2
shell:
"grep '>' {input.ffn} > {output.list} "
" ; "
"sed --in-place 's/>//' {output.list} "
" ; "
"source activate seqkit-0.10.1 "
" ; "
"seqkit "
"grep "
"--by-name "
"--pattern-file {output.list} "
"--threads {threads} "
"--out-file {output.faa} "
"{input.faa} "
" ; "
"conda deactivate"
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