Hello,
I am running samtools mpileup multiple times simultaneously on the same .bam file, and I am wondering if reading the same .bam file simultaneously could cause any problems/corrupt my output? For example, if I ran these commands simultaneously:
samtools mpileup -v -u --region chr1:1-1000 --output region1_mileup_output.txt my_reads.bam
samtools mpileup -v -u --region chr2:1-1000 --output region2_mileup_output.txt my_reads.bam
samtools mpileup -v -u --region chr3:1-1000 --output region3_mileup_output.txt my_reads.bam
- I know I could list the specific regions in the .bed file and input that into mpileup, but for my purposes it is most convenient to have the reads for the regions outputted to separate output files.
- I know I could run the commands sequentially, but I would prefer to run them simultaneously to save time.
I am planning on scaling up and simultaneously reading a .bam file a few hundred times with different regions specified. Will this become a problem once I scale up?
Thanks!
Consider using samtools mpileup on the whole chromosome, then use BEDTools intersect to get the overlap between your vcf and a bedfile of locations.