This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to remove specifically non aligned regions

Hi all,

I would like to select a specific region from a fastq file (all read matching this region) and if they exceed the reference, trim only the non matching regions. I've done a bwa alignment and generated sam file but I'm not sure how remove the regions that are not matching to the reference without removing all the read

Thanks for your help!

alignment sequencing genome

1 answer

You'll want to subset the BAM based on the region you want. This can be done easily with samtools.

Check out this Biostars post: Extract Reads From A Bam File That Fall Within A Given Region

Log in to answer this question.