Entering edit mode
3.1 years ago
zbidav
▴
30
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.
Reasonably certain @Pierre has written something for this. He may point out the exact tool but in meantime check his
javarkit
repo.Also this may help: tool for bam soft clipping reads within bed file regions