Extract aligned reads from a bam file for only selected coordinates
Hi, I want to extract only the reads aligned to a given positions of a reference genome from an aligned bam file. E.g. chr1:1000-2000
samtools view chr1:1000-2000
gives me all the reads that align to the region and beyond. However I want to clip off the alignments at 1000 to 2000 positions of the genome. I do not want to grab the regions in aligned reads before 1000 and after 2000 positions of the genome. How can I do this?
• 1,117 views
•
link
0 answers
No answers yet.
Log in to answer this question.
see Limiting variant calls to amplicon target regions?
tool for bam soft clipping reads within bed file regions