filtering unmapped and multiple mapped reads
0
0
Entering edit mode
4.7 years ago
annaA ▴ 10

Hello,

I have a question about how is the best way to filter already mapped reads. I have single end reads which are already mapped with Hisat2. I want to filter for the unmapped reads and the multiple mapped reads( keep only the primary alignments)

There are several ways to do so. 1. samtools view -F 260 2. samtools fixmate -r 3. Also during the mapping I can set -k to 1 (default is 5 I think in order to take only the primary alignment/s

I would like to ask for the second way with the fixmate -r. I tried but I came out with empty bam files. So I sorted my mapped.bam files by read name samtools sort -n myfile.mapped.bam -o myfile.sorted.bam and then I executed the samtools -r command like this samtools -r myfile.sorted.bam myfile_filtered.mapped.bam . And then I need to sort again by coordinates my bam file for the downstream analysis I am doing . So the above steps do not really work

could someone give me same feedback or recommend an other way

Thanks, Anna

smatools filtering RNA-Seq • 2.1k views
ADD COMMENT
0
Entering edit mode

If you would consider doing the mapping step again I could recommend to use BBmap for the mapping, that one can write out all sort of different sets based on their mapping result (such as eg write out all unmapped, properly paired mappings ,.... )

ADD REPLY
0
Entering edit mode

I need to use Hisat2 for the mapping. What's your opinion about the post mapping filtering ?

ADD REPLY
0
Entering edit mode

not sure if that is even possible with samtools (I think is works mainly on single read basis)

ADD REPLY

Login before adding your answer.

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