Extracting specific regions from bam file as FASTA format

Extracting specific regions from bam file as FASTA format

0

Hello, first time asking, so sorry in advance for beginner’s mistakes.
I have an indexed bam file, and I want to extract the FASTA format of all the reads that appear within the defined region (or partially appear)

for example:

samtools view file.bam chr4:100-150

However, this command is returning the whole read that was aligned to this region, and not only the requested region. Until now I parsed manually each read with python/IGV, but it is strange that there is no other much simpler way.


samtools


fasta

• 30 views

Read more here: Source link