Skip to content
Snippets Groups Projects
Commit 16f1c496 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fix: pindel detect all variants type grouped

parent ae98056b
No related branches found
No related tags found
1 merge request!12Split pindel detection in 20mb windows
......@@ -69,12 +69,15 @@ class SnakemakeUtils:
return inputs
def get_pindel_chr_batches(self, wildcards):
inputs = []
inputs = {"D": [],
"INV": [],
"TD": []}
for batch in self.chr_batches[wildcards.chrom]:
inputs.append("{batch}/pindel/{chrom}_{svtype}/{chrbatch}/pindel_{chrom}_{svtype}.gz".format(
batch=wildcards.batch, chrom=wildcards.chrom, chrbatch="-".join(map(str, batch)),
svtype=wildcards.svtype
))
for svtype in inputs:
inputs[svtype].append("{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_{svtype}.gz".format(
batch=wildcards.batch, chrom=wildcards.chrom, chrbatch="-".join(map(str, batch)),
svtype=svtype
))
return inputs
......
......@@ -30,9 +30,9 @@ rule pindel:
genome = REFERENCE,
fai = REFERENCE + ".fai"
output:
"{batch}/pindel/{chrom}_{svtype}/{chrbatch}/pindel_{chrom}_D.gz",
"{batch}/pindel/{chrom}_{svtype}/{chrbatch}/pindel_{chrom}_INV.gz",
"{batch}/pindel/{chrom}_{svtype}/{chrbatch}/pindel_{chrom}_TD.gz",
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_D.gz",
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_INV.gz",
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_TD.gz",
threads:
get_threads("pindel", 4)
log:
......@@ -50,7 +50,7 @@ rule pindel:
"""
for svtype in D TD INV RP SI LI BP CloseEndMapped INT_final;
do
gzip -f {wildcards.batch}/pindel/{wildcards.chrom}_{wildcards.svtype}/{wildcards.chrbatch}/pindel_{wildcards.chrom}_${{svtype}}
gzip -f {wildcards.batch}/pindel/{wildcards.chrom}/{wildcards.chrbatch}/pindel_{wildcards.chrom}_${{svtype}}
done
"""
......@@ -58,12 +58,16 @@ rule mergepindelbatches:
input:
unpack(snakemake_utils.get_pindel_chr_batches)
output:
"{batch}/pindel/pindel_{chrom}_{svtype}.gz"
D="{batch}/pindel/pindel_{chrom}_D.gz",
INV="{batch}/pindel/pindel_{chrom}_INV.gz",
TD="{batch}/pindel/pindel_{chrom}_TD.gz"
log:
stdout = "{batch}/logs/pindel/{chrom}_{svtype}.o",
stderr = "{batch}/logs/pindel/{chrom}_{svtype}.e",
threads:
1
shell:
"mergepindelbatches.py {output} {input} 1>{log.stdout} 2>{log.stderr}; "
"mergepindelbatches.py {output.D} {input.D} 1>{log.stdout} 2>{log.stderr}; "
"mergepindelbatches.py {output.INV} {input.INV} 1>>{log.stdout} 2>>{log.stderr}; "
"mergepindelbatches.py {output.TD} {input.TD} 1>>{log.stdout} 2>>{log.stderr}; "
"rm -rf {wildcards.batch}/pindel/{wildcards.chrom}_{wildcards.svtype}"
\ No newline at end of file
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