The SAM/BAM specification says that one can mention the genome assembly of a reference sequence, the species, etc. For this, one only has to use the tags belonging to the record type @SQ, such as AS for the genome assembly identifier.
Can BWA automatically fill these tags based on the names of the reference sequence, given that it is properly formatted?
If yes, how should the reference be formatted?
If no, I guess I should write the header myself and then use "samtools reheader", or do you have another idea?
Should the "record types" be in that order: @HD, @SQ, @RG, @PG and @CO ? The SAM specification only says "The header line. The first line if present." next to @HD, but nothing for the others.