This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting specific regions from bam file as FASTA format

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

0 answers

No answers yet.

Log in to answer this question.