<p>I have five exomes(in bam format), each a different sample, that I would like to merge into one bam. None of the bam have @RG's in the headers, I am assuming I must add this information first? I also assume this is how I can pull apart the variant information after I processes it with GATK? The Picard documentation states you must pass in a value for UNMAPPED_BAM (definition Original SAM or BAM file of unmapped reads, which must be in queryname order. Required.) I don't undstand what this file is? When I did my alignment should I have dumped the unaligned reads to a file? If so can merge them in a way that does not require unaligned reads to be present.   </p>

<p>I've successfully used the following to merge multiple bam files:</p>
<pre><code>samtools merge merged.bam in.1.bam in.2.bam ...
</code></pre>
<p>Although they had @SQs, none had @RGs.  Do you have no headers or just no @RGs?</p>