I am trying to extract some reads that aligned in specific regions of the mitochondrial genome. I want to know what is the length of these reads, so I need to extract them before to measure, to avoid the measurement of other reads the aligned in other regions.
I did it by different ways, the last one was:
samtools view -bh original_sorted.bam chrM:1-55 > output.bam
(many times for different regions)
samtools merge merged.bam *.bam samtools sort merged.bam > sorted.bam samtools index sorted.bam
But I can't open the sorted.bam file on genome browser and when I try to transform it into a fastq I see this message:
[M::bam2fq_mainloop] processed 0 reads
The original_sorted.bam is ok. I can visualize the data and there are a lot of reads in the regions that I want to do the measurement.