I would like to use Snakemake for iterative mapping of my samples. I don't know beforehand how many times the samples have to be remapped. For certain samples it will probably be 2-3 times, for others 10 times. If I understand correctly, Snakemake cannot use while loops, but maybe some kind of checkpoint is possible?
Basically what I want to do in this loop is calling the fasta sequence for my Illumina reads each time until it doesn't change anymore. (this is done using bowtie2 > samtools view > samtools mpileup > bcftools call > bcftools view > bcftools index > bcftools consensus)
I wrote previously a bash script to do this, but a Snakemake could really speed up this process. In the bash script, I used a R-script I wrote that counts the number of differences between the new and old fasta file. If this number is = 0, then it can stop the loop, if it is not the same then it has to rerun the steps above. Ideally, it should have a minimum of 3 loops and a max of 15 loops.
If someone could help, that would be fantastic! Thanks in advance