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.

VariantsToTable question

estif74estif74 Saint Paul, MN, USAMember

Hi there,

When using the VariantsToTable function, is there a way to force the genotypes to be numeric, i.e. 0/1 or 0/0 rather than the actual bases like G/T, G/G, etc.? I can't seem to find anything in the tool documentation, but maybe there's another way.

Thanks,
Steve

Tagged:

Best Answer

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    If you are working with only biallelic sites you can use ­-F HET ­-F HOM­VAR to get the GT information in a more usable form, then use (dirty) tricks like the following:

    image

  • estif74estif74 Saint Paul, MN, USAMember

    Thanks! That's helpful :-) I was able to use some potentially less dirty tricks in Excel to get this working given that my (current) dataset is somewhat manageable in size.

  • Will_GilksWill_Gilks University of Sussex, UKMember ✭✭

    To get a genotypes table with 0, 1 and 2 representing genotypes, I used Plink to generate a binary dosage format. https://www.cog-genomics.org/plink2/data

    ## Biallelic only variants ___ (removes null alternates hated by plink)
    GenomeAnalysisTK -R ${refseq} \
    -T SelectVariants \
    -V ${vcf} \
    -restrictAllelesTo BIALLELIC \
    -o bi${vcf}
    
    ## Convert to plink binary
    plink --allow-extra-chr --allow-no-sex \
    --vcf bi.${vcf}  \
    --make-bed \
    --out bi.${vcf}
    
    ## Convert plink binary to basic dosage
    plink --allow-extra-chr --allow-no-sex \
    --bfile bi.${vcf} \
    --recode A-transpose \
    --out bi.${vcf}.recode
    

    Abracadabra ...

      CHR     SNP     (C)M    POS     COUNTED ALT     H001_H001       H002_H002       H003_H003       H004_H004       H005_H005
     4       hc_bmile        0       98759   T       A       0       1       0       0       0       0       0       0       0       0       0       0
     4       hc_pdczq        0       111755  T       C       0       1       0       0       0       0       0       0       0       0       0       0
     4       hc_zejfm        0       117647  G       T       1       1       1       1       1       1       1       1       1       1       1       1
     4       hc_owbmv        0       140186  ATTAT   A       1       0       1       1       1       1       1       1       1       1       1       1
     4       hc_bokmy        0       176624  A       G       1       0       1       1       1       1       1       1       1       1       1       1
     4       hc_dzujv        0       235194  C       T       0       0       0       0       0       
    
  • robertbrobertb torontoMember

    Hi,

    I can't figure out why the FT field is being represented as NA instead of PASS or lowGQ. Can someone explain this? thanks.

    -T VariantsToTable \
    -R /work/lianglab/bin/GATK/resources/hg19/ucsc.hg19.fasta \
    -V /work/lianglab/wgs/ASD/VCF/GATK/GATK.chr1.recalibratedVariants.filtered.vcf \
    -SMA \
    -F CHROM \
    -F POS \
    -F ID \
    -F REF \
    -F ALT \
    -GF GT \
    -GF FT \
    -o /work/lianglab/wgs/ASD/VCF/GATK/GATK_chr1_C1_results.table \

    RESULTS:

    chr1 10146 rs375931351 AC A AC/AC NA ./. NA AC/AC NA AC/AC NA AC/AC NA AC/AC NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA ./. NA AC/AC NA ./. NA ./. NA ./. NA ./. NA AC/AC NA ./. NA ./. NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA ./. NA AC/AC NA AC/AC NA AC/AC NA ./. NA ./. NA ./. NA ./. NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA ./. NA ./. NA AC/AC NA ./. NA AC/AC NA ./. NA ./. NA ./. NA AC/AC NA AC/AC NA ./. NA ./. NA ./. NA ./. NA ./. NA AC/AC NA ./. NA ./. NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA AC/AC NA ./. NA ./. NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA AC/AC NA ./. NA AC/AC NA ./. NA AC/AC NA AC/AC NA ./. NA ./. NA

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin
    @robertb what does the original record look like?
Sign In or Register to comment.