Skip to content

Commit

Permalink
Update long_read.smk
Browse files Browse the repository at this point in the history
add temp flags for different directories
  • Loading branch information
alethomas authored Feb 16, 2022
1 parent 5928e5a commit 35d0b56
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions workflow/rules/long_read.smk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ rule customize_primer_porechop:
input:
get_artic_primer,
output:
"results/.indicators/replacement_notice.txt",
temp("results/.indicators/replacement_notice.txt"),
conda:
"../envs/primechop.yaml"
log:
Expand Down Expand Up @@ -80,7 +80,7 @@ rule porechop_primer_trimming:
"logs/{date}/trimmed/porechop/primer_clipped/{sample}.log",
threads: 2
shell:
"(porechop -i {input.fastq_in} -o {output} --no_split --end_size 35 --extra_end_trim 0 -t {threads} -v 1) > {log} 2>&1"
"(porechop -i {input.fastq_in} -o {output} --no_split --end_size 35 --extra_end_trim 0 -t {threads} -v 1) 2> {log}"


rule nanofilt:
Expand All @@ -104,6 +104,8 @@ rule canu_correct:
"results/{date}/trimmed/nanofilt/{sample}.fastq",
output:
"results/{date}/corrected/{sample}/{sample}.correctedReads.fasta.gz",
temp(directory("results/{date}/corrected/{sample}/correction")),
temp(directory("results/{date}/corrected/{sample}/{sample}.seqStore")),
log:
"logs/{date}/canu/assemble/{sample}.log",
params:
Expand All @@ -113,25 +115,30 @@ rule canu_correct:
for_testing=lambda w, threads: get_if_testing(
f"corThreads={threads} redMemory=6 oeaMemory=6"
),
resources:
parallel_correction_processes=1,
conda:
"../envs/canu.yaml"
threads: 16
shell:
"( if [ -d {params.outdir} ]; then rm -Rf {params.outdir}; fi &&"
" canu -correct -nanopore {input} -p {wildcards.sample} -d {params.outdir} genomeSize=30k minOverlapLength=10 minReadLength=200"
" useGrid=false {params.for_testing}"
" corMMapMerSize=10 corOutCoverage=50000 corMinCoverage=0 maxInputCoverage=20000"
" corOverlapper=minimap utgOverlapper=minimap obtOverlapper=minimap"
" corConcurrency={params.concurrency}"
" cormhapConcurrency={params.concurrency} cormhapThreads={params.concurrency}"
" cormmapConcurrency={params.concurrency} cormmapThreads={params.concurrency}"
" obtmmapConcurrency={params.concurrency} obtmmapThreads={params.concurrency}"
" utgmmapConcurrency={params.concurrency} utgmmapThreads={params.concurrency}"
" redConcurrency={params.concurrency} redThreads={params.concurrency}"
" ovbConcurrency={params.concurrency}"
" ovsConcurrency={params.concurrency}"
" oeaConcurrency={params.concurrency})"
"> {log} 2>&1"
"""
( if [ -d {params.outdir} ]; then rm -Rf {params.outdir}; fi &&
canu -correct -nanopore {input} -p {wildcards.sample} -d {params.outdir} genomeSize=30k minOverlapLength=10 minReadLength=200 \
useGrid=false {params.for_testing} \
corMMapMerSize=10 corOutCoverage=50000 corMinCoverage=0 maxInputCoverage=20000 \
corOverlapper=minimap utgOverlapper=minimap obtOverlapper=minimap \
corConcurrency={params.concurrency} \
cormhapConcurrency={params.concurrency} cormhapThreads={params.concurrency} \
cormmapConcurrency={params.concurrency} cormmapThreads={params.concurrency} \
obtmmapConcurrency={params.concurrency} obtmmapThreads={params.concurrency} \
utgmmapConcurrency={params.concurrency} utgmmapThreads={params.concurrency} \
redConcurrency={params.concurrency} redThreads={params.concurrency} \
ovbConcurrency={params.concurrency} \
ovsConcurrency={params.concurrency} \
oeaConcurrency={params.concurrency}
)
> {log} 2>&1
"""


# rule medaka_consensus_reference:
Expand Down

0 comments on commit 35d0b56

Please sign in to comment.