samtools view, overlap with multiple regions
1
0
Entering edit mode
8.5 years ago
tonja.r ▴ 600

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 • 2.1k views
ADD COMMENT
1
Entering edit mode
8.5 years ago

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).

ADD COMMENT

Login before adding your answer.

Traffic: 1850 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6