Bug Bulletin: The GenomeLocPArser error in SplitNCigarReads has been fixed; if you encounter it, use the latest nightly build.

Suppressing the legend on the tranches plot of the variantrecallibration step

modi2020modi2020 Posts: 15Member

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

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 6,414Administrator, GATK Developer admin

    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?

    Geraldine Van der Auwera, PhD

  • modi2020modi2020 Posts: 15Member

    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 Posts: 6,414Administrator, GATK Developer admin

    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)

    Geraldine Van der Auwera, PhD

  • modi2020modi2020 Posts: 15Member

    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)
    pdf
    pdf
    output.snp.tranches(using R code).pdf
    8K
    pdf
    pdf
    output.snp.tranches(original run).pdf
    9K
    txt
    txt
    output.snp.tranches.txt
    678B
  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 6,414Administrator, GATK Developer admin

    Hmm, that's surprising. Did you try running the R script directly with the same arguments except without suppressing the legend? This would tell us if the legend suppression is responsible for omitting the FP information or if something else is going wrong. Also, I'm not sure about this as I don't normally run this script directly, but I think you may want to pass in a single value for the target sensitivity, rather than the list of all the tranche cutoffs.

    Geraldine Van der Auwera, PhD

Sign In or Register to comment.