This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to not align reverse complementary reads?

My reference fasta file contains both sense and antisense sequence separately.

I use bwa mem as aligner, and it seems it will map the same read to both sense and antisense reference, and mapq will become 0 even if it's a perfect match.

So my questions is: is it possible to not align reverse compelmentary reads?

alignment bwa bowtie

2 answers

I don't think this is possible with BWA. Why don't you just remove the antisense sequence from your fasta? You can then map to the sense sequence, and the strand information will be stored as flag 16 in your output SAM, so you can always use that if this is relevant. For example, if you only want the reads from the sense strand, you can use: samtools view -f 16 your.sam.

Basically the same as @liorglic says, remove the RCs prior to building the index. The convention for fasta files for genomic references (as far as I know) is to write the top-strand sequence in 5'->3' orientation. The aligner will then take care of the reverse complementing if a read aligns better to it. If you leave the RCs in you will have every read being a multimapper.

Log in to answer this question.