Friday, 10 June 2011

BWA to support multiple hits as separate lines in SAM with addon pl script

This is the reason why I love open source communities / software.
After a brief discussion and request for BWA to also report multiple hits as separate entries in sam/bam files. The author of BWA (Li Heng) promptly released a addon perl script to allow for this feature.

commercial providers: try to beat that for speed for new feature release!

Anyway if you are interested on the usage:

A new script is added to convert XA:Z tag to multiple lines.

  bwa samse ref.fa reads.sai reads.fq.gz | > out.sam

A related question was also posted on biostars

Question: How to force 'bwa samse' to output multiple hits in .sam format?


  1. the link is not valid. Where can we find the script? (thanks)

  2. Hi,
    So,this link doesn't never work...
    Has anyobody known where can we find it or similar?

  3. Terribly sorry the comments were in spam folder have updated the post

    link is at


Datanami, Woe be me