I want to realize an in-silico dilution of a bam file into another one. I have 2 bam file (bam1 , bam2), I want to create a bam file (bam3) with 10% of bam1 and 90% bam2 at each sequenced position. How can I do it ?
the samtools view -s commande will take a fraction of a bam file, but since we don't guaranty the same depth coverage at a same position, we cannot guaranty the final fraction at a certain position.
I realize that it will be difficult to have the exact wanted fraction, since a read cover multiples positions, but I can tolerate some variance (10% +- 2% for exp).
Maybe this can be do it by taking an absolute number of reads covering each position instead of taking a fraction like samtools view -s
thanks a lot :)