Newer
Older
unpack(snakemake_utils.get_inputs_bams)
stdout = "{batch}/logs/pindel/statfile.o",
stderr = "{batch}/logs/pindel/statfile.e"
threads:
1
from svrunner_utils import get_insert_size
cfg = open(output.statfile, "w")
for sample in samples[wildcards.batch]:
statfile = "{wildcards.batch}/pindel/%s.cfg" % sample
insert_size = get_insert_size(bamfile)
cfg.write("\t".join([bamfile, str(insert_size), sample]) + "\n")
cfg.close()
unpack(snakemake_utils.get_inputs_bams),
fai = REFERENCE + ".fai"
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_D.gz",
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_INV.gz",
"{batch}/pindel/{chrom}/{chrbatch}/pindel_{chrom}_TD.gz",
stdout = "{batch}/logs/pindel/{chrom}_{chrbatch}.o",
stderr = "{batch}/logs/pindel/{chrom}_{chrbatch}.e"
shell:
"pindel -f {input.genome} -i {input.statfile}"
" --number_of_threads {threads}"
" --report_interchromosomal_events false"
" --minimum_support_for_event 3 -c {wildcards.chrom}:{wildcards.chrbatch}"
" -o {wildcards.batch}/pindel/{wildcards.chrom}/{wildcards.chrbatch}/pindel_{wildcards.chrom}"
Thomas Faraut
committed
gzip -f {wildcards.batch}/pindel/{wildcards.chrom}/{wildcards.chrbatch}/*
rule mergepindelbatches:
input:
unpack(snakemake_utils.get_pindel_chr_batches)
output:
D="{batch}/pindel/pindel_{chrom}_D.gz",
INV="{batch}/pindel/pindel_{chrom}_INV.gz",
TD="{batch}/pindel/pindel_{chrom}_TD.gz"
stdout = "{batch}/logs/pindel/{chrom}.o",
stderr = "{batch}/logs/pindel/{chrom}.e",
"mergepindelbatches.py {output.D} {input.D} 1>{log.stdout} 2>{log.stderr};\n"
"mergepindelbatches.py {output.INV} {input.INV} 1>>{log.stdout} 2>>{log.stderr};\n"
"mergepindelbatches.py {output.TD} {input.TD} 1>>{log.stdout} 2>>{log.stderr};\n"
Thomas Faraut
committed
"rm -rf {wildcards.batch}/pindel/{wildcards.chrom}"