I have a thought that if exist 2 conserved reference sequence, even are the same sequence. I guess, the pair-end read should mapping to both of them, and with the same mapping status. So I made up a reference to test it. But in practice, it failed, only got one primary alignment, and the other is second alignment. The forward read and reverse read are mapping to the same reference in the primary alignment. But in the second alignment, cross-mate occurs, forward read and reverse read are mapping to different reference. Why would produce this strange result? If I wanna mapping to multiple conserved reference, if bwa-mem can overcome it? How does bwa-mem deal with this situation? Or there is other method can do that? Below are the reference and result.
1) Reference Sequence:
>2B
GTGCCAGTTTCGAATTATCACAACCCAGAGCTGGATGTGGCGGCCTTTGACCAGCAGGGCAGGAAGTTCGATAACTTCAGCTCTTTGAGTATGATCTGGGAGTCCTCCAAAGTTTCCCTGGCGAGCATCGAACCAACCATGCCCATGCAGCTACATGTACACGAGGATGACAACAAACAGAAAAAACT
>1A
GTGCCAGTTTCGAATTATCACAACCCAGAGCTGGATGTGGCGGCCTTTGACCAGCAGGGCAGGAAGTTCGATAACTTCAGCTCTTTGAGTATGATCTGGGAGTCCTCCAAAGTTTCCCTGGCGAGCATCGAACCAACCATGCCCATGCAGCTACATGTACACGAGGATGACAACAAACAGAAAAAACT
2) Mapping Result:
@SQ SN:2B LN:188
@SQ SN:1A LN:188
@PG ID:bwa PN:bwa VN:0.7.16a-r1181 CL:bwa mem -a -t 10 same_ref.fas 1_R1.fq 1_R2.fq
E00477:505:H3F5MCCX2:1:1102:4970:41849 97 **1A** 1 0 1S143M **=** 152 188 GGTGCCGGTTTC... ...
E00477:505:H3F5MCCX2:1:1102:4970:41849 353 **2B** 1 0 1H143M **1A** 152 0 * * NM:i:2 MD:Z:5A35G101 MC:Z:37M107H AS:i:133
E00477:505:H3F5MCCX2:1:1102:4970:41849 145 **1A** 152 0 37M107S **=** 1 -188 TACATGTACACGAGGATGACAA... ...
E00477:505:H3F5MCCX2:1:1102:4970:41849 401 **2B** 152 0 37M107H **1A** 1 0 * * NM:i:0 MD:Z:37 MC:Z:1H143M AS:i:37
Please use the formatting bar (especially the

codeoption) to present your post better. I've done it for you this time.Thank you!
Thanks. But I still don't know how to do that. Is it correct now?
If you use a numbered list like that then the
codeoption does not work. I think we can go with what you have for now.While this question is about
bwa memlet me post an alternative. If you usebbmap.shfrom BBMap suite you can choose to align multi-mapping reads to all positions that they align to equally well usingambig=alloption. A guide for BBMap is available.Thank you! You give a good alternative. As for formatting, I am appreciate that you give me a lot of tips.