How to check what software has been used to generate bam file?

I have several bam files from unknown origin. I'd like to know what software was used to obtain those bam files, e.g. bwa-mem. Is it possible to somehow check it?

1 Answer

If you're lucky the information is stored in the BAM header in the lines starting with @PG which stores the command lines run on the BAM, use samtools view -H your.bam to display the header.

• Indeed, there was the full command line, thanks! Mar 19 at 8:38