view variant_recalibrator.xml @ 15:01ff8dd37d4d draft default tip

Uploaded
author lz_hust
date Sat, 01 Jun 2019 07:20:41 -0400
parents
children
line wrap: on
line source

<tool id="gatk2_variant_recalibrator" name="Variant Recalibrator" version="@VERSION@.1">
  <description></description>
  <macros>
    <import>gatk2_macros.xml</import>
  </macros>
  <expand macro="requirements">
    <requirement type="package" version="0.9.3">ggplot2</requirement>
  </expand>
  <expand macro="version_command" />
  <command interpreter="python">
    gatk2_wrapper.py
    --stdout "${output_log}"
    #for $var_count, $variant in enumerate( $reference_source.input_variants ):
        -d "--input:input_${var_count},%(file_type)s" "${variant}" "${variant.ext}" "input_variants_${var_count}"
    #end for
    -p '
    @JAR_PATH@
    -T "VariantRecalibrator"
    \$GATK2_SITE_OPTIONS

    @THREADS@

    #if $reference_source.reference_source_selector != "history":
        -R "${reference_source.ref_file.fields.path}"
    #end if
    --recal_file "${output_recal}"
    --tranches_file "${output_tranches}"
    --rscript_file "${output_rscript}"
   '

    #set $rod_binding_names = dict()
    #for $rod_binding in $rod_bind:
        #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'custom':
            #set $rod_bind_name = $rod_binding.rod_bind_type.custom_rod_name
        #elif str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'comp':
            #set $rod_bind_name = "comp" + $rod_binding.rod_bind_type.custom_rod_name
        #else
            #set $rod_bind_name = $rod_binding.rod_bind_type.rod_bind_type_selector
        #end if
        #set $rod_binding_names[$rod_bind_name] = $rod_binding_names.get( $rod_bind_name, -1 ) + 1
        #if $rod_binding.rod_bind_type.rod_training_type.rod_training_type_selector == "not_training_truth_known":
            -d "--resource:${rod_bind_name},%(file_type)s" "${rod_binding.rod_bind_type.input_rod}" "${rod_binding.rod_bind_type.input_rod.ext}" "input_${rod_bind_name}_${rod_binding_names[$rod_bind_name]}"
        #else:
            -d "--resource:${rod_bind_name},%(file_type)s,known=${rod_binding.rod_bind_type.rod_training_type.known},training=${rod_binding.rod_bind_type.rod_training_type.training},truth=${rod_binding.rod_bind_type.rod_training_type.truth},bad=${rod_binding.rod_bind_type.rod_training_type.bad},prior=${rod_binding.rod_bind_type.rod_training_type.prior}" "${rod_binding.rod_bind_type.input_rod}" "${rod_binding.rod_bind_type.input_rod.ext}" "input_${rod_bind_name}_${rod_binding_names[$rod_bind_name]}"
        #end if
    #end for

    #include source=$standard_gatk_options#

    ##start analysis specific options
    -p '
    #if str( $annotations ) != "None":
        #for $annotation in str( $annotations.fields.gatk_value ).split( ',' ):
            --use_annotation "${annotation}"
        #end for
    #end if
    #for $additional_annotation in $additional_annotations:
        --use_annotation "${additional_annotation.additional_annotation_name}"
    #end for
    --mode "${mode}"
    '

    #if $analysis_param_type.analysis_param_type_selector == "advanced":
        -p '
        --maxGaussians "${analysis_param_type.max_gaussians}"
        --maxIterations "${analysis_param_type.max_iterations}"
        --numKMeans "${analysis_param_type.num_k_means}"
        --stdThreshold "${analysis_param_type.std_threshold}"
        --shrinkage "${analysis_param_type.shrinkage}"
        --dirichlet "${analysis_param_type.dirichlet}"
        --priorCounts "${analysis_param_type.prior_counts}"

        --minNumBadVariants "${analysis_param_type.min_num_bad_variants}"

        --target_titv "${analysis_param_type.target_titv}"
        #for $tranche in [ $tranche.strip() for $tranche in str( $analysis_param_type.ts_tranche ).split( ',' ) if $tranche.strip() ]
            --TStranche "${tranche}"
        #end for
        #for $ignore_filter in $analysis_param_type.ignore_filters:
            #set $ignore_filter_name = str( $ignore_filter.ignore_filter_type.ignore_filter_type_selector )
            #if $ignore_filter_name == "custom":
              #set $ignore_filter_name = str( $ignore_filter.ignore_filter_type.filter_name )
            #end if
            --ignore_filter "${ignore_filter_name}"
        #end for
        '
    #end if

    &amp;&amp;
    mv "${output_rscript}.pdf" "${output_tranches_pdf}"

  </command>
  <inputs>
    <conditional name="reference_source">
      <expand macro="reference_source_selector_param" />
      <when value="cached">
        <expand macro="input_variants" />
        <param name="ref_file" type="select" label="Using reference genome" help="-R,--reference_sequence &amp;lt;reference_sequence&amp;gt;">
          <options from_data_table="gatk2_picard_indexes">
          <!--  <filter type="data_meta" key="dbkey" ref="variants[0].input_variants" column="dbkey"/> -->
          </options>
          <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
        </param>
      </when>
      <when value="history"> <!-- FIX ME!!!! -->
        <expand macro="input_variants" />
        <param name="ref_file" type="data" format="fasta" label="Using reference file" help="-R,--reference_sequence &amp;lt;reference_sequence&amp;gt;" />
      </when>
    </conditional>

    <repeat name="rod_bind" title="Binding for reference-ordered data" help="-resource,--resource &amp;lt;resource&amp;gt;" min="2">
        <conditional name="rod_bind_type">
          <param name="rod_bind_type_selector" type="select" label="Binding Type">
            <option value="dbsnp" selected="True">dbSNP</option>
            <option value="variant">Variants</option>
            <option value="snps">SNPs</option>
            <option value="indels">INDELs</option>
            <option value="hapmap">HapMap</option>
            <option value="omni">OMNI</option>
            <option value="mask">Mask</option>
            <option value="custom">Custom</option>
            <option value="comp">Comp</option>
          </param>
          <when value="variant">
              <param name="input_rod" type="data" format="vcf" label="Variant ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="comp">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <param name="custom_rod_name" type="text" value="Unnamed" label="ROD Name"/>
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="mask">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="dbsnp">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="snps">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="hapmap">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="omni">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="indels">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
          <when value="custom">
              <param name="custom_rod_name" type="text" value="Unknown" label="ROD Name"/>
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
              <conditional name="rod_training_type">
                  <param name="rod_training_type_selector" type="select" label="Use as training/truth/known sites">
                      <option value="is_training_truth_known">Set training/truth/known sites</option>
                      <option value="not_training_truth_known" selected="True">Don't Set options</option>
                  </param>
                  <when value="not_training_truth_known">
                      <!-- do nothing here -->
                  </when>
                  <when value="is_training_truth_known">
                      <param name="known" type="boolean" label="Is Known Site" truevalue="true" falsevalue="false"/>
                      <param name="training" type="boolean" label="Is Training Site" truevalue="true" falsevalue="false"/>
                      <param name="truth" type="boolean" label="Is Truth Site" truevalue="true" falsevalue="false"/>
                      <param name="bad" type="boolean" label="Is Bad Site" truevalue="true" falsevalue="false"/>
                      <param name="prior" type="float" label="prior probability of being true" value="12.0"/>
                  </when>
              </conditional>
          </when>
        </conditional>
    </repeat>

    <param name="annotations" type="select" multiple="True" display="checkboxes" label="annotations which should used for calculations" help="-an,--use_annotation &amp;lt;use_annotation&amp;gt;">
      <!-- load the available annotations from an external configuration file, since additional ones can be added to local installs -->
      <options from_data_table="gatk2_annotations">
        <filter type="multiple_splitter" column="tools_valid_for" separator=","/>
        <filter type="static_value" value="VariantRecalibrator" column="tools_valid_for"/>
      </options>
    </param>

    <repeat name="additional_annotations" title="Additional annotation" help="-an,--use_annotation &amp;lt;use_annotation&amp;gt;">
      <param name="additional_annotation_name" type="text" value="" label="Annotation name" />
    </repeat>

    <param name="mode" type="select" label="Recalibration mode" help="-mode,--mode &amp;lt;mode&amp;gt;">
        <option value="SNP" selected="True">SNP</option>
        <option value="INDEL">INDEL</option>
        <option value="BOTH">BOTH</option>
    </param>

    <expand macro="gatk_param_type_conditional" />

    <expand macro="analysis_type_conditional">
        <param name="max_gaussians" type="integer" label="maximum number of Gaussians to try during variational Bayes Algorithm" value="8" help="-mG,--maxGaussians &amp;lt;maxGaussians&amp;gt;"/>
        <param name="max_iterations" type="integer" label="maximum number of maximum number of VBEM iterations to be performed in variational Bayes Algorithm" value="150" help="-mI,--maxIterations &amp;lt;maxIterations&amp;gt;"/>
        <param name="num_k_means" type="integer" label="number of k-means iterations to perform in order to initialize the means of the Gaussians in the Gaussian mixture model" value="100" help="-nKM,--numKMeans &amp;lt;numKMeans&amp;gt;"/>
        <param name="std_threshold" type="float" label="If a variant has annotations more than -std standard deviations away from mean then don't use it for building the Gaussian mixture model." value="10.0" help="-std,--stdThreshold &amp;lt;stdThreshold&amp;gt;"/>
        <param name="shrinkage" type="float" label="shrinkage parameter in variational Bayes algorithm" value="1.0" help="-shrinkage,--shrinkage &amp;lt;shrinkage&amp;gt;"/>
        <param name="dirichlet" type="float" label="dirichlet parameter in variational Bayes algorithm" value="0.001" help="-dirichlet,--dirichlet &amp;lt;dirichlet&amp;gt;"/>
        <param name="prior_counts" type="float" label="number of prior counts to use in variational Bayes algorithm" value="20.0" help="-priorCounts,--priorCounts &amp;lt;priorCounts&amp;gt;"/>
        <!--<param name="trustAllPolymorphic" type="boolean" label="trustAllPolymorphic" truevalue="-/-trustAllPolymorphic=true" falsevalue="-/-trustAllPolymorphic=false"
            help="Trust that all the input training sets' unfiltered records contain only polymorphic sites to drastically speed up the computation. -trustAllPolymorphic" />-->
        <param name="min_num_bad_variants" type="integer" label="Minimum number of worst scoring variants to use when building the Gaussian mixture model of bad variants" value="1000" help="--minNumBadVariants &amp;lt;minNumBadVariants&amp;gt;"/>
        <param name="target_titv" type="float" label="expected novel Ti/Tv ratio to use when calculating FDR tranches and for display on optimization curve output figures. (approx 2.15 for whole genome experiments). ONLY USED FOR PLOTTING PURPOSES!" value="2.15" help="-titv,--target_titv &amp;lt;target_titv&amp;gt;"/>
        <param name="ts_tranche" type="text" label="levels of novel false discovery rate (FDR, implied by ti/tv) at which to slice the data. (in percent, that is 1.0 for 1 percent)" value="100.0, 99.9, 99.0, 90.0" help="-tranche,--TStranche &amp;lt;TStranche&amp;gt;"/>
        <repeat name="ignore_filters" title="Ignore Filter" help="-ignoreFilter,--ignore_filter &amp;lt;ignore_filter&amp;gt;">
          <conditional name="ignore_filter_type">
            <param name="ignore_filter_type_selector" type="select" label="Filter Type">
              <option value="HARD_TO_VALIDATE">HARD_TO_VALIDATE</option>
              <option value="LowQual" >LowQual</option>
              <option value="custom" selected="True">Other</option>
            </param>
            <when value="custom">
              <param name="filter_name" type="text" value="" label="Filter name"/>
            </when>
            <when value="HARD_TO_VALIDATE" />
            <when value="LowQual" />
          </conditional>
        </repeat>
    </expand>
  </inputs>
  <outputs>
    <data format="gatk_recal" name="output_recal" label="${tool.name} on ${on_string} (Recalibration File)" />
    <data format="gatk_tranche" name="output_tranches" label="${tool.name} on ${on_string} (Tranches File)" />
    <data format="txt" name="output_rscript" label="${tool.name} on ${on_string} (RScript File)" />
    <data format="pdf" name="output_tranches_pdf" label="${tool.name} on ${on_string} (PDF File)" />
    <data format="txt" name="output_log" label="${tool.name} on ${on_string} (log)" />
  </outputs>
  <tests>
      <!-- ADD TESTS -->
  </tests>
  <help>
**What it does**

Takes variant calls as .vcf files, learns a Gaussian mixture model over the variant annotations and evaluates the variant -- assigning an informative lod score

For more information on using the VariantRecalibrator module, see this `tool specific page &lt;http://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_sting_gatk_walkers_variantrecalibration_VariantRecalibrator.html&gt;`_.

To learn about best practices for variant detection using GATK, see this `overview &lt;http://www.broadinstitute.org/gatk/guide/topic?name=best-practices&gt;`_.

If you encounter errors, please view the `GATK FAQ &lt;http://www.broadinstitute.org/gatk/guide/topic?name=faqs&gt;`_.

------

**Inputs**

GenomeAnalysisTK: VariantRecalibrator accepts a variant input file.


**Outputs**

The output is in VCF format.


Go `here &lt;http://www.broadinstitute.org/gatk/guide/topic?name=intro&gt;`_ for details on GATK file formats.

-------

**Settings**::


 tranches_file         The output tranches file used by ApplyRecalibration
 use_annotation        The names of the annotations which should used for calculations
 mode                  Recalibration mode to employ: 1.) SNP for recalibrating only snps (emitting indels untouched in the output VCF); 2.) INDEL for indels; and 3.) BOTH for recalibrating both snps and indels simultaneously. (SNP|INDEL|BOTH)
 maxGaussians          The maximum number of Gaussians to try during variational Bayes algorithm
 maxIterations         The maximum number of VBEM iterations to be performed in variational Bayes algorithm. Procedure will normally end when convergence is detected.
 numKMeans             The number of k-means iterations to perform in order to initialize the means of the Gaussians in the Gaussian mixture model.
 stdThreshold          If a variant has annotations more than -std standard deviations away from mean then don't use it for building the Gaussian mixture model.
 shrinkage             The shrinkage parameter in variational Bayes algorithm.
 dirichlet             The dirichlet parameter in variational Bayes algorithm.
 priorCounts           The number of prior counts to use in variational Bayes algorithm.
 minNumBadVariants     The minimum amount of worst scoring variants to use when building the Gaussian mixture model of bad variants.
 recal_file            The output recal file used by ApplyRecalibration
 target_titv           The expected novel Ti/Tv ratio to use when calculating FDR tranches and for display on optimization curve output figures. (approx 2.15 for whole genome experiments). ONLY USED FOR PLOTTING PURPOSES!
 TStranche             The levels of novel false discovery rate (FDR, implied by ti/tv) at which to slice the data. (in percent, that is 1.0 for 1 percent)
 ignore_filter         If specified the optimizer will use variants even if the specified filter name is marked in the input VCF file
 path_to_Rscript       The path to your implementation of Rscript. For Broad users this is maybe /broad/tools/apps/R-2.6.0/bin/Rscript
 rscript_file          The output rscript file generated by the VQSR to aid in visualization of the input data and learned model
 path_to_resources     Path to resources folder holding the Sting R scripts.

@CITATION_SECTION@
  </help>
  <expand macro="citations" />
</tool>