Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra

Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
We will be out of the office for a Broad Institute event from Dec 10th to Dec 11th 2019. We will be back to monitor the GATK forum on Dec 12th 2019. In the meantime we encourage you to help out other community members with their queries.
Thank you for your patience!

Multiples samples filter with DP < 10

crop_bioinfocrop_bioinfo knoxvilleMember
edited August 2016 in Ask the GATK team

I am trying to call SNP from two different samples and after that filter SNPs based on DP > 10 in each sample. If at a locus, any one sample doesn't meet the requirement then remove the locus. It means: all samples should meet the filter requirement. I am new to GATK and was not able to find a correct solution for this job. Appreciate for any suggestion. I tried the same code for a single sample and it seems working. Thanks

I called the SNPs with:
$java -jar $gatk -T UnifiedGenotyper -R /storage/sandesh/TargetSpot/genome/Corca1_AssemblyScaffolds.fa -I cotton3.bam.sorted.bam cotton4.bam.sorted.bam -o raw_snp_indel.vcf --sample_ploidy 1

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT cotton3.fastq_1.paired.trimmed cotton4.fastq_1.paired.trimmed scaffold_1 67369 . C T 124 . AC=1;AF=1.00;AN=1;DP=5;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=1;MLEAF=1.00;MQ=6 0.00;MQ0=0;QD=24.80;SOR=1.022 GT:AD:DP:GQ:PL . 1:0,5:5:99:154,0 scaffold_1 67384 . A G 161 . AC=1;AF=1.00;AN=1;DP=5;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=1;MLEAF=1.00;MQ=6 0.00;MQ0=0;QD=32.20;SOR=1.022 GT:AD:DP:GQ:PL . 1:0,5:5:99:191,0 scaffold_1 67396 . T C 253.77 . AC=2;AF=1.00;AN=2;DP=7;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=2;MLEAF=1.00;MQ=6 0.00;MQ0=0;QD=34.24;SOR=0.941 GT:AD:DP:GQ:PL 1:0,2:2:82:82,0 1:0,5:5:99:200,0

Filtering was done as:
$java -jar $gatk \ -T VariantFiltration \ -R /storage/sandesh/TargetSpot/genome/Corca1_AssemblyScaffolds.fa \ -o snpsDPlt10.vcf \ --variant snps.vcf \ --genotypeFilterExpression "DP < 10" \ --genotypeFilterName "DP-lt10" \ --setFilteredGtToNocall

$java -jar $gatk \ -T SelectVariants \ -R /storage/sandesh/TargetSpot/genome/Corca1_AssemblyScaffolds.fa \ -V snpsDPlt10.vcf \ -o snpsDPlt10-noCall.vcf \ --setFilteredGtToNocall

$java -jar $gatk \ -T SelectVariants \ -R /storage/sandesh/TargetSpot/genome/Corca1_AssemblyScaffolds.fa \ -V snpsDPlt10-noCall.vcf \ -o snpsDPlt10-final-lt10DP.vcf \ --excludeNonVariants

The final file still has annotation as:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT cotton3.fastq_1.paired.trimmed cotton4.fastq_1.paired.trimmed scaffold_1 67871 . G A 485.77 PASS AC=1;AF=1.00;AN=1;DP=13;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=2;MLEAF=1.00;MQ= 60.00;MQ0=0;QD=32.77;SOR=1.609 GT:AD:DP:FT:GQ:PL ./.:0,3:3:DP-lt10:99:118,0 1:0,10:10:PASS:99:396,0 scaffold_1 67878 . T A 485.77 PASS AC=1;AF=1.00;AN=1;DP=13;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=2;MLEAF=1.00;MQ= 60.00;MQ0=0;QD=30.77;SOR=1.609 GT:AD:DP:FT:GQ:PL ./.:0,3:3:DP-lt10:99:122,0 1:0,10:10:PASS:99:392,0 scaffold_1 67936 . T C 670.77 PASS AC=1;AF=1.00;AN=1;DP=21;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=2;MLEAF=1.00;MQ= 60.00;MQ0=0;QD=31.94;SOR=0.990 GT:AD:DP:FT:GQ:PL 1:0,12:12:PASS:99:355,0 ./.:0,9:9:DP-lt10:99:344,0

Best Answer


  • crop_bioinfocrop_bioinfo knoxvilleMember
    edited August 2016

    I will try those options. How can the PASS SNPs be extracted without the SNPs those didn't pass the filter? After annotating with filter, I want a vcf file with SNPs that only passed the filter.

    Post edited by crop_bioinfo on
  • crop_bioinfocrop_bioinfo knoxvilleMember
    edited August 2016

    I was wondering why the locus without any coverage in a sample is annotated as PASS, this one as two samples one with PASS and other DP<10

    scaffold_1 2517617 . A G 318 PASS AC=0;AF=1.00;AN=0;DP=9;Dels=0.00;FS=0.000;HaplotypeScore=0.0000;MLEAC=1;MLEAF=1.00;MQ=60.00;MQ0=0;QD=32.48;SOR=1.402 GT:AD:DP:FT:GQ:PL .:.:.:PASS ./.:0,9:9:DP-lt10:99:348,0

  • The first sample isn't a locus without coverage, it is a locus that hasn't been called at all. Since it has not been called, it makes no sense to filter it, so it is set to 'PASS'. Otherwise, you get strange effects, for example more filtered calls then actual existing calls, which would be weird.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin
    There's an argument for dropping sites based on how many samples (number or fraction) had a no-call there. You could use that here to filter out sites like this.
Sign In or Register to comment.