Rsamtools: how to extract uniquely aligned single-end or paired-end by ScanbamParam
1
0
Entering edit mode
Jiping Wang ▴ 90
@jiping-wang-6687
Last seen 2.3 years ago
United States

A quick question: is there any way to extract uniquely aligned single-end or paired-end reads using Rsamtools? I read carefully about the documentation and did find a clear clue. IsSecondaryAlignment=T tag does not exclude a read which had aligned to multiple locations we designated as primary at other locations, correct? if so, then this won't serve for screening purpose.

Thanks for help

Rsamtools • 1.4k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

How would one do this with other tools? It seems like either the aligner inserts a unique tag (then use tagFilter = in ScanBamParam() or that one uses a heuristic based on properties of the aligner (mapqFilter =) or one sorts the bam file by qname (sortBam(..., byQname = TRUE) and eliminates duplicates (probably using filterBam() with a yieldSize to manage memory and a filter that looks for non-duplicate records).

If one were interested only in the primary alignment of possibly multiply aligned reads, then ScanBamParam(flag = scanBamFlag(isSecondaryAlignment = FALSE)) would do that, especially in conjunction with mapqFilter=.

ADD COMMENT

Login before adding your answer.

Traffic: 744 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