Hi, I am using bowtie + samtools pipeline to call snp. Split bam file and call snp by chromosome will save a lot of time.
But the reference genome have many scaffold, split bam by chromosome will produce a lot of scaffold_bam file. Now I want to split bam by scaffold, so the scaffold will split into one file.
Is there any way to do that?
I tried to use command:
samtools view in.bam scaffold1 scaffold2 -b > scaffold1_2.bam
but I don't know how to check if
scaffold1_2.bam contains scaffold1 and scaffold2.