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.
Notice:
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.
Attention:
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!

help with Variant Recalibrator in scala script

estif74estif74 Saint Paul, MN, USAMember

Hi there,

I'm trying to write a simple scala script to run Variant Recalibrator. However, I'm having trouble setting the Variant Recalibrator "mode" properly in scala. The relevant portion of my script is:

def script() { 
    val VR = new VariantRecalibrator with CommonArguments
            VR.resource = qscript.resourceSNPFile
    VR.input :+= qscript.vcfFile
    VR.use_annotation :+= "DP"
    VR.use_annotation :+= "QD"
    VR.use_annotation :+= "FS"
    VR.use_annotation :+= "MQRankSum"
    VR.use_annotation :+= "ReadPosRankSum"
    VR.mode = "SNP"
    VR.nt = 4
    VR.TStranche :+= "100.0"
    VR.TStranche :+= "99.9"
    VR.TStranche :+= "99.0"
    VR.TStranche :+= "90.0"
    VR.recalFile = qscript.snpRecal
    VR.tranchesFile = qscript.snpTranches
    VR.rscriptFile = qscript.snpPlots
    add(VR)                     
} 

The problem is with the VR.mode line. If I say VR.mode = "SNP" I get a "type mismatch" error; if I say VR.mode = SNP (i.e. without the quotes) I get an error that says "not found: value SNP". How do I code this correctly so that scala can interpret that I'm running VariantRecalibrator in SNP mode. I've also tried VR.mode :+= "SNP" and VR.mode :+= SNP, but get error messages with this as well.

Thank you for any help!

Best Answers

Answers

  • estif74estif74 Saint Paul, MN, USAMember

    That's perfect! Mode.SNP worked like a charm. Thank you a ton!

  • estif74estif74 Saint Paul, MN, USAMember

    I actually had one other question that just arose when I took this scala script out of test mode. It relates to the VR.resource section of my script. It was running fine in test mode, but when I add the -run flag, it turns out that VR.resource will not pass the "options" associated with the resource file, i.e. the stuff after the colon below

    -resource:illumina,known=true,training=true,truth=false,prior=15.0

    Any scala gurus know how to get this to work?

  • estif74estif74 Saint Paul, MN, USAMember

    Perfect that worked great. Thank you for your quick response!!

Sign In or Register to comment.