Entering edit mode
12.9 years ago
Kwame
▴
20
Hello,
I want to extract regions of multiple bamfiles kept as seperate files using the following samtools command:
samtools view -b a.bam refsequence :113111720-113112765 > aoutput.bam
How can I modify the above command so it works on multiple bamfiles example:a.bam b.bam c.bam d.bam simultaneously? I am currently doing this one bamfile at a time and it is taking forever. Thanks
Or far less complicated:
for f in *.bam ; do samtools view -b $f chr1:100-1000 > part-$f ; done