I am trying to extract the mapped reads from a bam file for a specific region.
samtools view -h in.bam "chr1:regionstart-regionend" > out.bam
this gives me all the reads falling into that region. (which contains read that mapped into that region plus reads unmapped into that region)
I am looking for reads that mapped to that specific region. Which options can I include?
Or samtools in unable to do it?
Thank you in advance.