Commit 77af5890 authored by Shaman Narayanasamy's avatar Shaman Narayanasamy

Fix for issue #87

parent a52bd90e
Pipeline #1695 failed with stages
in 10 minutes and 36 seconds
...@@ -8,9 +8,17 @@ samtools merge -@ {THREADS} -u - \ ...@@ -8,9 +8,17 @@ samtools merge -@ {THREADS} -u - \
<(samtools view -@ {THREADS} -u -f 12 -F 256 $TMP_FILE) | \ <(samtools view -@ {THREADS} -u -f 12 -F 256 $TMP_FILE) | \
samtools view -@ {THREADS} -bF 0x800 - | samtools sort -o -@ {THREADS} -m {MEMCORE}G -n - $BUFFER | \ samtools view -@ {THREADS} -bF 0x800 - | samtools sort -o -@ {THREADS} -m {MEMCORE}G -n - $BUFFER | \
bamToFastq -i stdin -fq {output[0]} -fq2 {output[1]} bamToFastq -i stdin -fq {output[0]} -fq2 {output[1]}
bwa mem -v 1 -t {THREADS} {input[3]} {input[2]} | \
samtools view -@ {THREADS} -bS - | samtools view -@ {THREADS} -uf 4 - | \ if [[ -s {input[2]} ]]
bamToFastq -i stdin -fq {output[2]} then
bwa mem -v 1 -t {THREADS} {input[3]} {input[2]} | \
samtools view -@ {THREADS} -bS - | samtools view -@ {THREADS} -uf 4 - | \
bamToFastq -i stdin -fq {output[2]}
else
echo "There are no singletons reads. {input[2]} is empty. Generating empty {output[2]}"
touch {output[2]}
fi
rm -rf $BUFFER* $TMP_FILE rm -rf $BUFFER* $TMP_FILE
""" """
...@@ -32,26 +40,6 @@ rule extract_unmapped_from_megahit: ...@@ -32,26 +40,6 @@ rule extract_unmapped_from_megahit:
shell: shell:
EXTRACT_UNMAPPED_SHELL EXTRACT_UNMAPPED_SHELL
#
# rule extract_mg_unmapped_from_idba:
# input:
# 'Preprocessing/mg.r1.preprocessed.fq',
# 'Preprocessing/mg.r2.preprocessed.fq',
# 'Preprocessing/mg.se.preprocessed.fq',
# 'Assembly/mg.idba_preprocessed.1.fa',
# 'Assembly/mg.idba_preprocessed.1.fa.amb',
# 'Assembly/mg.idba_preprocessed.1.fa.bwt',
# 'Assembly/mg.idba_preprocessed.1.fa.pac',
# 'Assembly/mg.idba_preprocessed.1.fa.sa',
# 'Assembly/mg.idba_preprocessed.1.fa.ann'
# output:
# 'Assembly/mg.r1.unmapped.fq',
# 'Assembly/mg.r2.unmapped.fq',
# 'Assembly/mg.se.unmapped.fq'
# shell:
# EXTRACT_UNMAPPED_SHELL
rule extract_unmapped_from_hybrid_assembly: rule extract_unmapped_from_hybrid_assembly:
input: input:
'Preprocessing/{type}.r1.preprocessed.fq', 'Preprocessing/{type}.r1.preprocessed.fq',
......
...@@ -8,9 +8,17 @@ samtools merge -@ {THREADS} -u - \ ...@@ -8,9 +8,17 @@ samtools merge -@ {THREADS} -u - \
<(samtools view -@ {THREADS} -u -f 12 -F 256 $TMP_FILE) | \ <(samtools view -@ {THREADS} -u -f 12 -F 256 $TMP_FILE) | \
samtools view -@ {THREADS} -bF 0x800 - | samtools sort -o -@ {THREADS} -m {MEMCORE}G -n - $BUFFER | \ samtools view -@ {THREADS} -bF 0x800 - | samtools sort -o -@ {THREADS} -m {MEMCORE}G -n - $BUFFER | \
bamToFastq -i stdin -fq {output[0]} -fq2 {output[1]} bamToFastq -i stdin -fq {output[0]} -fq2 {output[1]}
bwa mem -v 1 -t {THREADS} {input[3]} {input[2]} | \
samtools view -@ {THREADS} -bS - | samtools view -@ {THREADS} -uf 4 - | \ if [[ -s {input[2]} ]]
bamToFastq -i stdin -fq {output[2]} then
bwa mem -v 1 -t {THREADS} {input[3]} {input[2]} | \
samtools view -@ {THREADS} -bS - | samtools view -@ {THREADS} -uf 4 - | \
bamToFastq -i stdin -fq {output[2]}
else
echo "There are no singletons reads. {input[2]} is empty. Generating empty {output[2]}"
touch {output[2]}
fi
rm -rf $BUFFER* $TMP_FILE rm -rf $BUFFER* $TMP_FILE
""" """
......
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