missing SAM header with minimap2 and samtools

When using minimap2 to map sequencing reads onto a reference, you can use this kind of command (be careful, this is wrong as you will see later):

The command is verbose and prints this kind of information. Note here the WARN%ING:

Then, if you try to convert or read this file, you will most problaby get an error. For instance, to convert this SAM file into a BAM format (using samtools), you will get this error message:

The solution took me a while but is very simple: if you check the help message of minimap2, you will see that the reference should be provided first. So the top command should be:

that is the reference comes first and then the data.

This entry was posted in bioinformatics and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.