Assuming that I have a BAM file with aligned reads, how can I extract the part of all reads that cover completely a specific region of a genome. (I tried with samtools view file.bam chr1:13974-22442 , but it reports all reads that intersect with this region, also it reports all the read sequence not only the intersection part...)
For example : (needed region to be extract between pipes)
=============|=====|========================= < Reference
---------|-----|--------------------------
-------------|-----|-----------
--------------------------------------------
--|-----|--------------------------
Thank you
why do you want only a part of the reads?
Hello Chadi Saad, I have the same request...I want to extract/trim the reads from bam file that exactly match with specific regions of a bed file...Did you get it?
Chiara