Hi, guys!
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)
Then:
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.
Thanks, guys!!!
Hi, did you check if there is reads on your
output.bam
?Now i am using -L option and a bed file and the output.bam is ok. There are a lot of reads.
Thanks
*.bam may pickup merged.bam as well. Try outputting some where outside the current directory @ silas008
I really didn't know why this was not working. I will try your suggestion.
Thanks