Feature request: Write @PG flag in SAM output
Only if it’s not too much trouble. With BWA it’s nice that you can see the BWA version and even the command that created the file from within the file.
It would be nice if KMA could do this also.
Comments (4)
-
-
reporter Yep, here is an extract from a BAM file. It’s tab-separated, but my terminal replaces it with spaces:
@PG ID:samtools PN:samtools VN:1.13 CL:samtools view -bS /tmp/jakobnissen/IRMAv1.0.2/0_25.rv. fq-cDVHy28nlJ18ffSlSyp2HpbDefm2qpos/A_MP.sam
Here is the description from the SAM specification - the asterisk means the ID subfield is required, the others are optional. But version and CL is particularly useful!
@PG
Program.
ID
* Program record identifier. Each@PG
line must have a uniqueID
. The value ofID
is used in the
alignmentPG
tag andPP
tags of other@PG
lines.PG
IDs may be modified when merging SAM
files in order to handle collisions.
PN
Program name
CL
Command line. UTF-8 encoding may be used.
PP
Previous@PG-ID
. Must match another@PG
header’sID
tag.@PG
records may be chained usingPP
tag, with the last record in the chain having noPP
tag. This chain defines the order of programs
that have been applied to the alignment.PP
values may be modified when merging SAM files
in order to handle collisions ofPG ID
s. The firstPG
record in a chain (i.e., the one referred to
by thePG
tag in a SAM record) describes the most recent program that operated on the SAM
record. The nextPG
record in the chain describes the next most recent program that operated
on the SAM record. ThePG ID
on a SAM record is not required to refer to the newestPG
record
in a chain. It may refer to anyPG
record in a chain, implying that the SAM record has been
operated on by the program in thatPG
record, and the program(s) referred to via thePP
tag.
DS
Description. UTF-8 encoding may be used.
VN
Program version
-
Hi Jakob
I have added the feature to the version on the nano-branch, if you can confirm the update works appropriately I will merge it with the main-branch.
Best,
Philip -
- changed status to resolved
- Log in to comment
Hi Jakob
That should be possible, we have added something similar in the map stat files. Do you have a snippet from BWA to see exactly how it should be formatted.
Best,
Philip