Hi all,

I have been trying to use Mutect to compare results from Varscan and other tools. To run MuTect, pre-processing from GATK and Picard tools is necessary.

1\. **Mapped reads using BWA.**

2\. **Convert to sorted BAM using PICARD**

```
java -Xmx4g \
  -Djava.io.tmpdir=/tmp \
  -jar SortSam.jar \
  SO=coordinate \
  INPUT=Trimmed_ERR361938_trimmed_bwa.sam \
  OUTPUT=Test.bam \
  VALIDATION_STRINGENCY=LENIENT \
  CREATE_INDEX=true
```

3\. **Mark Duplicates using PICARD**

```
java -Xmx4g \
  -Djava.io.tmpdir=/tmp \
  -jarpicard-tools-1.119/SortSam.jar \
  SO=coordinate \
  INPUT=Trimmed_ERR361938_trimmed_bwa.sam \
  OUTPUT=Test.bam \
  VALIDATION_STRINGENCY=LENIENT \
  CREATE_INDEX=true
```

4\. **Realign along INDEL using GATK**

```
java -Xmx4g \
  -jar GenomeAnalysisTK.jar \
  -T RealignerTargetCreator \
  -R /steno-internal/chirag/data/indexGenome/hg19/bwa/hg19.fa \
  -o input.bam.list \
  -I input.marked.bam
```

**NOW I GET ERROR**

```
##### ERROR
##### ERROR MESSAGE: SAM/BAM file input.marked.bam is malformed: SAM file doesn't have any read groups defined in the header. The GATK no longer supports SAM files without read groups
##### ERROR
```
There is this script which should fix this, but I am not sure of some of the parameter used here,

java -jar ~/unixTools/picard-tools-1.119/AddOrReplaceReadGroups.jar

These parameters need to be used

 - RGLB=String
 - LB=String                     Read Group Library  Required.
 - RGPU=String
 - PU=String                     Read Group platform unit (eg. run barcode)  Required.
 - RGSM=String
 - SM=String                     Read Group sample name  Required.

How do I get information on these parameters, as I am analyzing many published reads.

Are there some other ways to fix this step.

Thanks in advance!
you have to specify the read group from the beginning using the option -R of bwa

> `-R STR`	Complete read group header line. '\t' can be used in STR and will be converted to a TAB in the output SAM. The read group ID will be attached to every read in the output. An example is '@RG\tID:foo\tSM:bar'. [null]

you can add a group to your current bams using picard AddOrReplaceReadGroups http://broadinstitute.github.io/picard/command-line-overview.html#AddOrReplaceReadGroups