Skip to content
Snippets Groups Projects
Commit b6dfa4c7 authored by Valentina Galata's avatar Valentina Galata
Browse files

issue #72: added wtdbg2 (LR assembler)

parent 2b965a5d
No related branches found
No related tags found
No related merge requests found
name: perl
channels:
- anaconda
- conda-forge
- bioconda
- defaults
- r
- etetoolkit
- au-eoed
dependencies:
- java-jdk=7.0.91
- libgcc-ng=9.1.0
- perl=5.26.2
......@@ -7,7 +7,6 @@ rule assembly_lr_flye:
input:
os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz")
output:
# NOTE: NOT the name for "final" FASTA file which will be created AFTER polishing
os.path.join(RESULTS_DIR, "assembly/lr/flye/assembly.fasta")
threads:
config["flye"]["threads"]
......@@ -70,9 +69,9 @@ rule polishing_lr_medaka:
# "cd $(dirname {output}) && ln -sf consensus.fasta $(basename {output}) && " # NOTE: flye already creates this file
"date) &> {log}"
localrules: assembly_lr_flye_link
localrules: assembly_lr_link
rule assembly_lr_flye_link:
rule assembly_lr_link:
input:
os.path.join(RESULTS_DIR, "assembly/lr/{tool}/polishing/racon_medaka/consensus.fasta")
output:
......@@ -80,6 +79,37 @@ rule assembly_lr_flye_link:
shell:
"ipath=$(realpath {input}) && cd $(dirname {output}) && ln -sf $(realpath --relative-to=\".\" \"${{ipath}}\") $(basename {output})"
rule assembly_lr_wtdbg2:
input:
os.path.join(RESULTS_DIR, "preproc/metag/lr/lr.fastq.gz")
output:
os.path.join(RESULTS_DIR, "assembly/lr/wtdbg2/assembly.fasta")
threads:
config["wtdbg2"]["threads"]
log:
"logs/wtdbg2.log"
conda:
os.path.join(ENV_DIR, "wtdbg2.yaml")
message:
"Assembly: long reads: wtdbg2"
shell:
"(date && "
"export PATH=$PATH:{config[wtdbg2][bin]} && "
"wtdbg2 -x ont -g {config[wtdbg2][genome_size]} -t {threads} -i {input} -fo $(dirname {output})/assembly && "
"wtpoa-cns -t {threads} -i $(dirname {output})/assembly.ctg.lay.gz -fo {output} && "
"date) &> {log}"
# localrules: assembly_lr_wtdbg2_link
# NOTE: only for testing !!!
# rule assembly_lr_wtdbg2_link:
# input:
# os.path.join(RESULTS_DIR, "assembly/lr/wtdbg2/assembly.fasta")
# output:
# os.path.join(RESULTS_DIR, "assembly/lr/wtdbg2/ASSEMBLY.fasta")
# shell:
# "ipath=$(realpath {input}) && cd $(dirname {output}) && ln -sf $(realpath --relative-to=\".\" \"${{ipath}}\") $(basename {output})"
##################################################
# Short reads
......
......@@ -7,8 +7,10 @@ include:
rule ASSEMBLY:
input:
lr=expand(os.path.join(RESULTS_DIR, "assembly/lr/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["lr"]),
sr=expand(os.path.join(RESULTS_DIR, "assembly/sr/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["sr"]),
hy=expand(os.path.join(RESULTS_DIR, "assembly/hy/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["hy"]),
# lr=expand(os.path.join(RESULTS_DIR, "assembly/lr/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["lr"]),
lr=expand(os.path.join(RESULTS_DIR, "assembly/lr/{tool}/ASSEMBLY.FILTERED.fasta"), tool=["flye"]),
lr2=expand(os.path.join(RESULTS_DIR, "assembly/lr/{tool}/ASSEMBLY.fasta"), tool=["wtdbg2"]),
sr=expand(os.path.join(RESULTS_DIR, "assembly/sr/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["sr"]),
hy=expand(os.path.join(RESULTS_DIR, "assembly/hy/{tool}/ASSEMBLY.FILTERED.fasta"), tool=config["assemblers"]["hy"]),
output:
touch("status/assembly.done")
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