view indel_realigner.xml @ 0:bb0beda6cf83 draft default tip

Imported from capsule None
author devteam
date Tue, 01 Apr 2014 10:48:26 -0400
parents
children
line wrap: on
line source

<tool id="gatk_indel_realigner" name="Indel Realigner" version="0.0.6">
  <description>- perform local realignment</description>
  <requirements>
      <requirement type="package" version="1.4">gatk</requirement>
      <requirement type="package" version="0.1.18">samtools</requirement>
  </requirements>
  <macros>
    <import>gatk_macros.xml</import>
  </macros>
  <command interpreter="python">gatk_wrapper.py
   --max_jvm_heap_fraction "1"
   --stdout "${output_log}"
   -d "-I" "${reference_source.input_bam}" "${reference_source.input_bam.ext}" "gatk_input"
   #if str( $reference_source.input_bam.metadata.bam_index ) != "None":
       -d "" "${reference_source.input_bam.metadata.bam_index}" "bam_index" "gatk_input" ##hardcode galaxy ext type as bam_index
   #end if
   -p 'java 
    -jar "\$JAVA_JAR_PATH/GenomeAnalysisTK.jar"
    -T "IndelRealigner"
    -o "${output_bam}"
    -et "NO_ET" ##ET no phone home
    ##--num_threads 4 ##hard coded, for now
    ##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
    #if $reference_source.reference_source_selector != "history":
        -R "${reference_source.ref_file.fields.path}"
    #end if
   -LOD "${lod_threshold}"
    ${knowns_only}
   '
   
    #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
        #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
        -d "-known:${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]}"
    #end for
   
    #include source=$standard_gatk_options#
    ##start analysis specific options
    -d "-targetIntervals" "${target_intervals}" "${target_intervals.ext}" "gatk_target_intervals"
    -p '
    --disable_bam_indexing
    '
    #if $analysis_param_type.analysis_param_type_selector == "advanced":
        -p '
        --entropyThreshold "${analysis_param_type.entropy_threshold}"
        ${analysis_param_type.simplify_bam}
        --consensusDeterminationModel "${analysis_param_type.consensus_determination_model}"
        --maxIsizeForMovement "${analysis_param_type.max_insert_size_for_movement}"
        --maxPositionalMoveAllowed "${analysis_param_type.max_positional_move_allowed}"
        --maxConsensuses "${analysis_param_type.max_consensuses}"
        --maxReadsForConsensuses "${analysis_param_type.max_reads_for_consensuses}"
        --maxReadsForRealignment "${analysis_param_type.max_reads_for_realignment}"
        ${analysis_param_type.no_original_alignment_tags}
        '
    #end if
  </command>
  <inputs>
    
    <conditional name="reference_source">
      <expand macro="reference_source_selector_param" />
      <when value="cached">
        <param name="input_bam" type="data" format="bam" label="BAM file" help="-I,--input_file &amp;lt;input_file&amp;gt;">
          <validator type="unspecified_build" />
          <validator type="dataset_metadata_in_data_table" table_name="gatk_picard_indexes" metadata_name="dbkey" metadata_column="dbkey" message="Sequences are not currently available for the specified build." /> <!-- fixme!!! this needs to be a select -->
        </param>
        <param name="ref_file" type="select" label="Using reference genome" help="-R,--reference_sequence &amp;lt;reference_sequence&amp;gt;" >
          <options from_data_table="gatk_picard_indexes">
            <filter type="data_meta" key="dbkey" ref="input_bam" 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">
        <param name="input_bam" type="data" format="bam" label="BAM file" help="-I,--input_file &amp;lt;input_file&amp;gt;" />
        <param name="ref_file" type="data" format="fasta" label="Using reference file" help="-R,--reference_sequence &amp;lt;reference_sequence&amp;gt;">
          <options>
            <filter type="data_meta" key="dbkey" ref="input_bam" />
          </options>
        </param>
      </when>
    </conditional>
    <param name="target_intervals" type="data" format="gatk_interval,bed,picard_interval_list" label="Restrict realignment to provided intervals" help="-targetIntervals,--targetIntervals &amp;lt;targetIntervals&amp;gt;" />
    <repeat name="rod_bind" title="Binding for reference-ordered data" help="-known,--knownAlleles &amp;lt;knownAlleles&amp;gt;">
        <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="snps">SNPs</option>
            <option value="indels">INDELs</option>
            <option value="custom">Custom</option>
          </param>
          <when value="dbsnp">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
          </when>
          <when value="snps">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
          </when>
          <when value="indels">
              <param name="input_rod" type="data" format="vcf" label="ROD file" />
          </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" />
          </when>
        </conditional>
    </repeat>
    <param name="lod_threshold" type="float" value="5.0" label="LOD threshold above which the realigner will proceed to realign" help="-LOD,--LODThresholdForCleaning &amp;lt;LODThresholdForCleaning&amp;gt;" />
    <param name="knowns_only" type="boolean" checked="False" truevalue="-knownsOnly" falsevalue="" label="Use only known indels provided as RODs" help="-knownsOnly"/>
    
    <expand macro="gatk_param_type_conditional" />
    
    <expand macro="analysis_type_conditional">
        
        <param name="entropy_threshold" type="float" value="0.15" label="percentage of mismatching base quality scores at a position to be considered having high entropy" help="-entropy,--entropyThreshold &amp;lt;entropyThreshold&amp;gt;" />
        <param name="simplify_bam" type="boolean" checked="False" truevalue="-simplifyBAM" falsevalue="" label="Simplify BAM" help="-simplifyBAM,--simplifyBAM"/>
        <param name="consensus_determination_model" type="select" label="Consensus Determination Model" help="-model,--consensusDeterminationModel &amp;lt;consensusDeterminationModel&amp;gt;">
          <option value="KNOWNS_ONLY">KNOWNS_ONLY</option>
          <option value="USE_READS" selected="True">USE_READS</option>
          <option value="USE_SW">USE_SW</option>
        </param>
        <param name="max_insert_size_for_movement" type="integer" value="3000" label="Maximum insert size of read pairs that we attempt to realign" help="-maxIsize,--maxIsizeForMovement &amp;lt;maxIsizeForMovement&amp;gt;" />
        <param name="max_positional_move_allowed" type="integer" value="200" label="Maximum positional move in basepairs that a read can be adjusted during realignment" help="-maxPosMove,--maxPositionalMoveAllowed &amp;lt;maxPositionalMoveAllowed&amp;gt;" />
        <param name="max_consensuses" type="integer" value="30" label="Max alternate consensuses to try" help="-maxConsensuses,--maxConsensuses &amp;lt;maxConsensuses&amp;gt;" />
        <param name="max_reads_for_consensuses" type="integer" value="120" label="Max reads (chosen randomly) used for finding the potential alternate consensuses" help="-greedy,--maxReadsForConsensuses &amp;lt;maxReadsForConsensuses&amp;gt;" />
        <param name="max_reads_for_realignment" type="integer" value="20000" label="Max reads allowed at an interval for realignment" help="-maxReads,--maxReadsForRealignment &amp;lt;maxReadsForRealignment&amp;gt;" />
        <param name="no_original_alignment_tags" type="boolean" checked="False" truevalue="--noOriginalAlignmentTags" falsevalue="" label="Don't output the original cigar or alignment start tags for each realigned read in the output bam" help="-noTags,--noOriginalAlignmentTags"/> 
    </expand>
  </inputs>
  <outputs>
    <data format="bam" name="output_bam" label="${tool.name} on ${on_string} (BAM)" />
    <data format="txt" name="output_log" label="${tool.name} on ${on_string} (log)" />
  </outputs>
  <tests>
      <test>
          <param name="reference_source_selector" value="history" />
          <param name="ref_file" value="phiX.fasta" ftype="fasta" />
          <param name="target_intervals" value="gatk/gatk_realigner_target_creator/gatk_realigner_target_creator_out_1.gatk_interval" ftype="gatk_interval" />
          <param name="input_bam" value="gatk/fake_phiX_reads_1.bam" ftype="bam" />
          <param name="rod_bind_type_selector" value="snps" />
          <param name="input_rod" value="gatk/fake_phiX_variant_locations.vcf" ftype="vcf" />
          <param name="lod_threshold" value="5.0" />
          <param name="knowns_only" />
          <param name="gatk_param_type_selector" value="basic" />
          <param name="analysis_param_type_selector" value="advanced" />
          <param name="entropy_threshold" value="0.15" />
          <param name="simplify_bam" />
          <param name="consensus_determination_model" value="USE_SW" />
          <param name="max_insert_size_for_movement" value="3000" />
          <param name="max_positional_move_allowed" value="200" />
          <param name="max_consensuses" value="30" />
          <param name="max_reads_for_consensuses" value="120" />
          <param name="max_reads_for_realignment" value="20000" />
          <param name="no_original_alignment_tags" />
          <output name="output_bam" file="gatk/gatk_indel_realigner/gatk_indel_realigner_out_1.bam" ftype="bam" lines_diff="2" /> 
          <output name="output_log" file="gatk/gatk_indel_realigner/gatk_indel_realigner_out_1.log.contains" compare="contains" />
      </test>
  </tests>
  <help>
**What it does**

Performs local realignment of reads based on misalignments due to the presence of indels. Unlike most mappers, this walker uses the full alignment context to determine whether an appropriate alternate reference (i.e. indel) exists and updates SAMRecords accordingly.

For more information on local realignment around indels using the GATK, see this `tool specific page &lt;http://www.broadinstitute.org/gsa/wiki/index.php/Local_realignment_around_indels&gt;`_.

To learn about best practices for variant detection using GATK, see this `overview &lt;http://www.broadinstitute.org/gsa/wiki/index.php/Best_Practice_Variant_Detection_with_the_GATK_v3&gt;`_.

If you encounter errors, please view the `GATK FAQ &lt;http://www.broadinstitute.org/gsa/wiki/index.php/Frequently_Asked_Questions&gt;`_.

------

**Inputs**

GenomeAnalysisTK: IndelRealigner accepts an aligned BAM and a list of intervals to realign as input files.


**Outputs**

The output is in the BAM format.


Go `here &lt;http://www.broadinstitute.org/gsa/wiki/index.php/Input_files_for_the_GATK&gt;`_ for details on GATK file formats.

-------

**Settings**::

 targetIntervals              intervals file output from RealignerTargetCreator
 LODThresholdForCleaning      LOD threshold above which the cleaner will clean
 entropyThreshold             percentage of mismatches at a locus to be considered having high entropy
 out                          Output bam
 bam_compression              Compression level to use for writing BAM files
 disable_bam_indexing         Turn off on-the-fly creation of indices for output BAM files.
 simplifyBAM                  If provided, output BAM files will be simplified to include just key reads for downstream variation discovery analyses (removing duplicates, PF-, non-primary reads), as well stripping all extended tags from the kept reads except the read group identifier
 useOnlyKnownIndels           Don't run 'Smith-Waterman' to generate alternate consenses; use only known indels provided as RODs for constructing the alternate references.
 maxReadsInMemory             max reads allowed to be kept in memory at a time by the SAMFileWriter. Keep it low to minimize memory consumption (but the tool may skip realignment on regions with too much coverage.  If it is too low, it may generate errors during realignment); keep it high to maximize realignment (but make sure to give Java enough memory).
 maxIsizeForMovement          maximum insert size of read pairs that we attempt to realign
 maxPositionalMoveAllowed     maximum positional move in basepairs that a read can be adjusted during realignment
 maxConsensuses               max alternate consensuses to try (necessary to improve performance in deep coverage)
 maxReadsForConsensuses       max reads used for finding the alternate consensuses (necessary to improve performance in deep coverage)
 maxReadsForRealignment       max reads allowed at an interval for realignment; if this value is exceeded, realignment is not attempted and the reads are passed to the output file(s) as-is
 noOriginalAlignmentTags      Don't output the original cigar or alignment start tags for each realigned read in the output bam.

@CITATION_SECTION@
  </help>
</tool>