I am addressing WES data with GATK for mutation calling.
I selected two samples to have a test. One is tumor sample, one is matched normal sample.
I used bowtie2 to do the alignment (hg19). and then use Picard to do the sort, and remove duplicates.
and then used GATK to do the Base Recalibration. and then Mutect2.
I met an error in the step of filtering.
When I use CollectSequencingArtifactMetrics, two parameters are needed: a bam file, and a GATK reference.
gatk CollectSequencingArtifactMetrics \
-I tumor.bam \
-R ref.fasta \
-O tumor_artifact \
--FILE_EXTENSION ".txt"
The command line is:
gatk CollectSequencingArtifactMetrics
-I ../MySam/SRR5038441_Pst_MD_BQSR.bam
-R ucsc.hg19.fasta (from GATK ftp site)
-O tumor_artifact
--FILE_EXTENSION ".txt"
The error is: Sequence dictionaries are not the same size (84, 93).
The reason is that, there are 84 lines in the sequence dictionary in bam file and 93 line dictionary in reference.
The sequence dictionary in bam was generated by bowtie2. I selected all the reference files with hg19.
The reference that used by bowtie2 might be different from the reference downloaded from GATK resource (your ftp site).
and then, I printed the head of bam file, and checked with the "ucsc.hg19.dict", and tried to remove the extra 9 lines.
such as
SN:chr4_ctg9_hap1
SN:chr6_apd_hap1
SN:chr6_cox_hap2
SN:chr6_dbb_hap3
SN:chr6_mann_hap4
SN:chr6_mcf_hap5
SN:chr6_qbl_hap6
SN:chr6_ssto_hap7
SN:chr17_ctg5_hap1
and I also address in the same way in the ucsc.hg19.fasta.fai.
but still got the error:
Sequences at index 0 don't match: 0/249250621/chr1 0/16571/chrM/UR=file:/humgen/gsa-hpprojects/GATK/bundle/ucsc.hg19/ucsc.hg19.fasta/M5=d2ed829b8a1628d16cbeee88e88e39eb
but I think the updated file "ucsc.hg19.fasta.fai" is consistent with "ucsc.hg19.dict". (I checked each line)
Finally, I test this question with hg38.
I downloaded the index files of bowtie2 with hg38, and re-alignment the original file and get a new bam file.
and then I re-download the GATK reference with hg38 from GATK resource bundle(ftp://ftp.broadinstitute.org/bundle/hg38/).
gatk CollectSequencingArtifactMetrics
-I ../MySam/441.bam
-R Homo_sapiens_assembly38.fasta
-O tumor_artifact
--FILE_EXTENSION ".txt"
I still got the similar error.: Sequence dictionaries are not the same size (195, 3366).
This error means that there are 195 lines in the sequence dictionaries in bam file but 3366 lines in GATK reference.
In summary, although bowtie2 and gatk may follow the same standard for the same genome, but there are still some functions are not compatible. Many metrics calculated from picard can not address the bam files, if they have different size of dictionaries compare to that in reference.
However, there is an exception:
I called the function "CollectOxoGMetrics", no error.
gatk CollectOxoGMetrics -I ../MySam/SRR5038441_Pst_MD_BQSR.bam -R ucsc.hg19.fasta -O tumor_artifact.txt
Pls pay attention, this bam file has 84 lines of sequence dictionary, and the 93 lines of dictionary in ucsc.hg19.fasta.