This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract 'endpos' feature from bam file

Hello everyone,

I want to extract the position of the last mapped base from each alignment, i know that alignments can be filtered by expression with the command:

samtools view -e 'endpos>int' -O BAM in.bam

Is there a way to extract the only the endpos values? I don't want to filter alignments.

Thanks in advice!

alignment bam rna-seq samtools

1 answer

bedtools bamtobed is a conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records.

https://bedtools.readthedocs.io/en/latest/content/tools/bamtobed.html

Log in to answer this question.