Question: GATK quality recalibration to get recalibrated BAM files before SNP calling
0
gravatar for alicia.poppy
3 months ago by
alicia.poppy40
alicia.poppy40 wrote:

I'm having problems with quality score recalibration using GATK as most tutorials/examples use an old version of GATK which has different syntax and arguments to the current version.

I have run this to get a recalibration table, which I think I need to get the recalibrated BAM files:

gatk-4.1.2.0/gatk BaseRecalibrator \
-reference human_genome/hg38_masked.fa \
--known-sites human_genome/All_20180418.vcf.gz \
--input S01_BAM_file.bam \
--output recal.table

This works fine, and I could run this for all of my samples.

But when I then do the next step to get the recalibrated BAM files I can't work out what to do.

*The old way of doing it was:

 java –jar GenomeAnalysisTK.jar –T PrintReads \ 
–R human.fasta \
–I realigned.bam \ 
–BQSR recal.table \ 
–o recal.bam*

I wrote:

gatk-4.1.2.0/gatk PrintReads \
-R data_R3/human_genome/hg38_masked.fa \
--input S01_BAM_file.bam \
-**BQSR** recal.table \
 --output quality_score_recalibrated_S01.bam

But this makes an error that says: "A USER ERROR has occurred: B is not a recognized option". And I can't find an alternative argument for -BQSR when I look at the PrintReads help manual.

Does anyone know the current way to run this quality score recalibration to get recalibrated BAM files?

snp recalibration bqsr gatk • 285 views
ADD COMMENTlink modified 3 months ago by Nicolas Rosewick8.1k • written 3 months ago by alicia.poppy40
1

Haven't used v4, but from GATK site

https://gatkforums.broadinstitute.org/gatk/discussion/comment/43986#Comment_43986

ADD REPLYlink written 3 months ago by Santosh Anand4.9k
2
gravatar for Nicolas Rosewick
3 months ago by
Belgium, Brussels
Nicolas Rosewick8.1k wrote:

you should use ApplyBQSR :

https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_walkers_bqsr_ApplyBQSR.php

gatk BaseRecalibrator \
   -I input.bam \
   -R reference.fasta \
   --known-sites sites_of_variation.vcf \
   --known-sites another/optional/setOfSitesToMask.vcf \
   -O recal_data.table

then

 gatk ApplyBQSR \
   -R reference.fasta \
   -I input.bam \
   --bqsr-recal-file recal_data.table \
   -O output.bam
ADD COMMENTlink modified 3 months ago • written 3 months ago by Nicolas Rosewick8.1k

Hi! @Nicolas Rosewick.Your comment was helpful. However, when I tried, your command was giving me the following error: A USER ERROR has occurred: '--bqsr_recal_file' is not a valid command. I tried the below-mentioned command and it worked. gatk ApplyBQSR \ -R reference.fasta \ -I input.bam \ --bqsr recal_data.table \ -O output.bam

So I would point using bqsr in small case rather than the syntax in which mentioned on the GATK website.

ADD REPLYlink written 23 days ago by rohitsatyam1020
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 691 users visited in the last hour