The current GATK version is 3.8-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Get notifications!


You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Got a problem?


1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?


Then follow instructions in Article#1894.

Formatting tip!


Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Download the latest Picard release at https://github.com/broadinstitute/picard/releases.
GATK version 4.beta.3 (i.e. the third beta release) is out. See the GATK4 beta page for download and details.

Suppressing the legend on the tranches plot of the variantrecallibration step

Hello GATK team,

Thank you for the excellent tool kit and continuous development.
I know this might be easy but I wanted to suppress the legend in the tranches plot of the Variantrecallibration step. I looked up the R code that generated the plot in the GATK directory and couldn't find it. Is there possibly a way to remove that legend or place it on top of the plot instead of in the left bottom corner.

Thank you

Best Answer

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    I looked up the R code that generated the plot in the GATK directory and couldn't find it

    Do you mean you couldn't find the R script or you did but couldn't find the relevant part within the script?

  • Hi Geraldine,

    I didn't actually find the R script to plot the tranches plot. I thought it was possibly in the GATK resources folder?!
    I know that GATK uses R to generate that plot but I don't know how to modify it. Now, that I searched further I guess I found a version of the R script online but I am not sure I can supply all the Args for it?
    I found it here: https://github.com/broadgsa/gatk/blob/master/public/R/scripts/org/broadinstitute/sting/gatk/walkers/variantrecalibration/plot_Tranches.R

    Thank you

    @Geraldine_VdAuwera said:
    Do you mean you couldn't find the R script or you did but couldn't find the relevant part within the script?

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Ah yes, that's the script you need. You can run it independently after running the recalibrator a first time. These are the arguments you need to give it:

    1. the tranches file produced by VariantRecalibrator
    2. the target TITV: this will depend on what kind of data you are analyzing (basically WGS or exome); you can look up the default value in the recalibrator documentation
    3. the target sensitivity is the tranche you specify as cutoff in the basic command line for recalibration
    4. this is what allows you to suppress the legend; pass any value you like and the legend will be suppressed (if the field is empty then the legend is produced)
  • Thank you Geraldine,

    I have used the R code and asked it to suppress the legend (using suppress legend =1). I also used the default TITV and target sensitivity values.
    It did suppress the legend, however, it also omitted the Tranch−specific FPs and Cumulative FPs from the plot.
    I have attached the resulting plots from original Variantrecallibration run and the one using the tranches file from the run (using the R code). I have also attached the actual tranches file. Upon looking at the R code, there didn't seem to me like there was something missing (unless of course if it was beyond my R scope of knowledge).

    Also, clarity here are the args I passed:
    tranchesFile = "output.snp.tranches"
    targetTITV = 1
    targetSensitivity = c(90.0, 99.0, 99.9, 100)
    suppressLegend = 1

    Thank you

    @Geraldine_VdAuwera said:
    Ah yes, that's the script you need. You can run it independently after running the recalibrator a first time. These are the arguments you need to give it:

    1. the tranches file produced by VariantRecalibrator
    2. the target TITV: this will depend on what kind of data you are analyzing (basically WGS or exome); you can look up the default value in the recalibrator documentation
    3. the target sensitivity is the tranche you specify as cutoff in the basic command line for recalibration
    4. this is what allows you to suppress the legend; pass any value you like and the legend will be suppressed (if the field is empty then the legend is produced)
  • Where can I find the R script to generate the tranche plot?

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    The R script is autogenerated by the java code when the program runs, but you can use the --rscript_file argument to save a copy.

  • It didn;t for me. Only for the Gaussian mixture model plots...

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Hmm, it's supposed to be all in the same script. If you run it by itself from R, do you get any errors?

  • Hello,

    I actually dont have ggplot2 in the cluster when I am running my analysis. Thus, GATK cannot print pdf with the plots for me. The output I am getting are to R scripts for the plots for SNPs and INDELS. I opened these with a text editor and changed the ouputpdf. Then I run these in R and obtained the Gaussian mixture plots but not the tranches ones. Thanks!

Sign In or Register to comment.