This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools view, overlap with multiple regions

According to samtools:

Important note: when multiple regions are given, some alignments may be output multiple times if they overlap more than one of the specified regions. However, if I have such a bed file:

chr1 3033215 3044215 ENSMUSG00000090025.1/Gm16088 0 +
chr1    3033216    3044416    ENSMUSG00000064842.1/U6    0    -

Samtools counts the read only once:

samtools view -c -q 1 -F 4 -L matrix_small_f.bed super_short.bam
1
samtools view -c -q 1 -F 4 -L matrix_small_f.bed super_short.bam
HWI-ST227:372:C3UVCACXX:3:1212:16462:69280    0    chr1    3044215    255    50M    *    0    0    TCCAAGATTGGTGCCGAGCCCTATTGGCCCAAGTTAGAAGTAGACATCTG    CCCFFFFFHHHHHJJJJJIJJJJJIGGJJJJJJHHIIJHIBFHIJJJIIG    XA:i:0    MD:Z:50    NM:i:0

If I split my bed file into two separate files containing the first and the second regions, samtools shows the same read for each file.

alignment

1 answer

The caveat doesn't apply to BED files, only to multiple regions specified from the command line (this should probably be clarified in the documentation).

Log in to answer this question.