Skip to content
Snippets Groups Projects
Commit 48189022 authored by Susheel Busi's avatar Susheel Busi
Browse files

updated rules for zymo download and prodigal runs

parent a6093fc4
No related branches found
No related tags found
1 merge request!78Add zymo workflow
This commit is part of merge request !78. Comments created here will be created in the context of that merge request.
No preview for this file type
No preview for this file type
......@@ -26,8 +26,8 @@ ref_genomes:
# Additional params
single_fast5_dir: "data_single_fast5"
multi_fast5_dir: "data_multi_fast5"
# single_fast5_dir: "data_single_fast5"
# multi_fast5_dir: "data_multi_fast5"
# Annotation tools
prodigal:
......
......@@ -26,7 +26,7 @@ ONTP_SMK="workflow_zymo/Snakefile"
# config file
ONTP_CONFIG="config/zymo/config.zymo.yaml"
# slurm config file
ONTP_SLURM="config/Zymo/slurm.zymo.yaml"
ONTP_SLURM="config/zymo/slurm.zymo.yaml"
# slurm cluster call
ONTP_CLUSTER="{cluster.call} -t {cluster.runtime} -n {cluster.threads} -p {cluster.partition} -N {cluster.nodes} -q {cluster.quality} --job-name={cluster.job-name}"
......
......@@ -7,20 +7,20 @@ __default__:
threads: 1
job-name: "ZYMO_REF.{rule}"
download_genomes:
zymo_download:
partition: "interactive"
quality: "normal"
runtime: "0-00:15:00"
concatenate:
zymo_concat:
partition: "batch"
quality: "normal"
runtime: "0-00:05:00"
runtime: "0-00:10:00"
zymo_prodigal:
partition: "batch"
qos: "normal"
runtime: "00-1:00:00"
runtime: "00-00:30:00"
diamond_db:
partition: "batch"
......@@ -49,4 +49,4 @@ sibeliaz:
zymo_sibeliaz:
partition: "batch"
quality: "normal"
runtime: "00-00:30:00"
\ No newline at end of file
runtime: "00-00:30:00"
......@@ -27,8 +27,8 @@ workdir:
# TARGETS
##################################################
SINGLE_FAST5_DIR = os.path.abspath(config["single_fast5_dir"])
MULTI_FAST5_DIR = os.path.abspath(config["multi_fast5_dir"])
# SINGLE_FAST5_DIR = os.path.abspath(config["single_fast5_dir"])
# MULTI_FAST5_DIR = os.path.abspath(config["multi_fast5_dir"])
REF_GENOMES_DIR = os.path.abspath(config["ref_genomes_dir"])
RESULTS_DIR = config["results_dir"]
DATA_DIR = config["data_dir"]
......@@ -54,11 +54,8 @@ READ_ASSEMBLER_PAIRS = assembler_pairs(READ_ASSEMBLERS)
##################################################
# RULES
##################################################
rule all:
input:
REF_GENOMES_DIR,
expand(os.path.join(RESULTS_DIR,"reference/mock_genomes.fasta")),
expand(os.path.join(RESULTS_DIR,"annotation/zymo_prodigal/proteins.faa")),
expand(os.path.join(RESULTS_DIR,"annotation/diamond/zymo.dmnd")),
expand(os.path.join(RESULTS_DIR, "analysis/diamond/{rtype_tool}.{ext}"),
......@@ -80,59 +77,50 @@ rule all:
rtype_tool=["%s_%s" % (rtype, tool) for rtype, tool in READ_ASSEMBLERS])
rule download_genomes:
rule zymo_download:
output:
directory(REF_GENOMES_DIR)
os.path.join(REF_GENOMES_DIR, "{wildcards.org}.fna")
log:
out="logs/ref_genomes.out.log",
err="logs/ref_genomes.err.log"
shell:
"(date && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/bsubtilis_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/efaecalis_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/ecoli_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/lmonocytogenes_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/paeruginosa_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/scerevisiae_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/senterica_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/saureus_pb.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/lfermentum_ontlumina.fasta -P {output} && "
"wget https://github.com/al-mcintyre/mCaller_analysis_scripts/raw/master/assemblies/cneoformans_ont.fasta -P {output} && "
"date) 2> {log.err} > {log.out}"
rule concatenate:
input:
rules.download_genomes.output
output:
os.path.join(RESULTS_DIR,"reference/mock_genomes.fasta")
log:
out="logs/concat.out.log",
err="logs/concat.err.log"
"logs/zymo.download.{wildcards.org}.log"
params:
url=lambda wildcards: config["ref_genomes"][wildcards.org]
shell:
"(date && "
"cat {input}/*.fasta > {output} && "
"date) 2> {log.err} > {log.out}"
"(date && wget {params.url} -P {output} && date) &> {log}"
rule zymo_prodigal:
input:
rules.concatenate.output
rules.zymo_download.output
output:
os.path.join(RESULTS_DIR,"annotation/zymo_prodigal/proteins.faa")
faa=os.path.join(RESULTS_DIR,"annotation/zymo_prodigal/{wildcards.org}.faa"),
gbk=os.path.join(RESULTS_DIR,"annotation/zymo_prodigal/{wildcards.org}.gbk")
log:
out="logs/zymo_prodigal.out.log",
err="logs/zymo_prodigal.err.log"
out="logs/zymo_prodigal.{wildcards.org}.out.log",
err="logs/zymo_prodigal.{wildcards.org}.err.log"
threads:
config["prodigal"]["threads"]
conda:
os.path.join(ENV_DIR, "prodigal.yaml")
shell:
"(date && "
"prodigal -a {output} -p meta -i {input} && "
"prodigal -i {input} -o {output.gbk} -a {output.faa} && "
"sed -i 's/^>/>{wildcards.org}__/' {output.faa} && "
"date) 2> {log.err} > {log.out}"
rule zymo_concat:
input:
expand(
os.path.join(RESULTS_DIR, "annotation/zymo_prodigal/{org}.faa"),
org=config["ref_genomes"].keys()
)
output:
os.path.join(RESULTS_DIR, "annotation/zymo_prodigal/proteins.faa")
shell:
"cat {input} > {output}"
rule diamond_db:
input:
rules.zymo_prodigal.output
rules.zymo_concat.output
output:
os.path.join(RESULTS_DIR,"annotation/diamond/zymo.dmnd")
log:
......@@ -285,6 +273,19 @@ rule sibeliaz:
"sibeliaz -n -t {threads} -k {params.kmers} -f {params.memory} -o $(dirname {output}) {input.asm1} {input.asm2} && "
"date) 2> {log.err} > {log.out}"
rule concatenate:
input:
rules.zymo_download.output
output:
os.path.join(RESULTS_DIR,"reference/mock_genomes.fasta")
log:
out="logs/concat.out.log",
err="logs/concat.err.log"
shell:
"(date && "
"cat {input}/*.fasta > {output} && "
"date) 2> {log.err} > {log.out}"
rule zymo_sibeliaz:
input:
zymo=rules.concatenate.output,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment