File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ rule call_variants:
5050 output :
5151 # touch("calling/called/{contig}.vcf.done"),
5252 pipe ("calling/called/{contig}.vcf" ),
53+ bamlist = temp ("calling/called/{contig}.bamlist" )
5354 params :
5455 # Optional extra parameters.
5556 extra = config ["params" ]["freebayes" ]["extra" ] + know_variants_extra (),
Original file line number Diff line number Diff line change 5656# Main Call
5757# =================================================================================================
5858
59+ # For large numbers of input bam files, we might run into a max length issue when trying to
60+ # call parallel. Hence, we write a temporary list of the bam files instead.
61+ # One BAM path per line, so freebayes-parallel only needs a single --bam-list arg.
62+ with open (snakemake .output .bamlist , "w" ) as fh :
63+ for bam in snakemake .input .samples :
64+ fh .write (f"{ bam } \n " )
65+
5966# Prepare the output and compression.
6067# We need to pipe through bcftools in each case, in order to ensure the correct output format.
6168pipe = ""
156163
157164shell (
158165 "({freebayes} {extra_params} -f {snakemake.input.ref}"
159- " {snakemake.input.samples } {pipe} > {snakemake.output[0]}) {log}"
166+ " --bam-list {snakemake.output.bamlist } {pipe} > {snakemake.output[0]}) {log}"
160167)
You can’t perform that action at this time.
0 commit comments