Simple question
Seems like the command:
samtools view -b -h <input.bam> -L <input.bed>
for subsetting the bam file to keep only those reads intersecting the seqnames and their regions in input.bed is retaining the original header in the output bam file, including those seqnames not present in input.bed.
Is there a samtools flag that can be used to tell samtools to also subset the header to keep only those seqnames in input.bed?