view picard_FilterSamReads.xml @ 10:777ccdd1d6e4 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/picard commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Sun, 11 Oct 2015 10:46:17 -0400
parents 3a3234d7a2e8
children 05087b27692a
line wrap: on
line source

<tool name="FilterSamReads" id="picard_FilterSamReads" version="@TOOL_VERSION@.0">
  <description>include or exclude aligned and unaligned reads and read lists</description>
  <macros>
    <import>picard_macros.xml</import>
  </macros>
  <expand macro="requirements" />
  <command>
    @java_options@
    
    ##Sam Sorting is performed here because FilterSamReads requires input to be in query-sorted order
    
    java -jar \$JAVA_JAR_PATH/picard.jar
    SortSam
    INPUT="${inputFile}"
    OUTPUT=query_sorted_bam.bam
    SORT_ORDER=queryname
    VALIDATION_STRINGENCY=LENIENT
    QUIET=true
    VERBOSITY=ERROR
    
    &amp;&amp;
    
    java -jar \$JAVA_JAR_PATH/picard.jar
    FilterSamReads
    INPUT=query_sorted_bam.bam
    FILTER="${filter_type.filter}"
    
    #if ( str( $filter_type.filter ) == "includeReadList" or str( $filter_type.filter ) == "excludeReadList" ):
      READ_LIST_FILE="${filter_type.read_list_file}"
    #end if
    
    OUTPUT="${outFile}"
    SORT_ORDER=coordinate
    VALIDATION_STRINGENCY="${validation_stringency}"
    QUIET=true
    VERBOSITY=ERROR
  
  </command>
  <inputs>
    <param name="inputFile" type="data" format="sam,bam" label="Select SAM/BAM dataset or dataset collection" help="If empty, upload or import a SAM/BAM dataset"/>
    <conditional name="filter_type">
      <param name="filter" type="select" label="Select filtering type" help="FILTER; see Help for deatiled info">
        <option value="includeAligned">Include aligned</option>
        <option value="excludeAligned">Exclude aligned</option>
        <option value="includeReadList">Include read list</option>
        <option value="excludeReadList">Exclude read list</option>
      </param>
      <when value="includeAligned"/> <!-- do nothing -->
      <when value="excludeAligned"/> <!-- do nothing -->
      <when value="includeReadList">
        <param name="read_list_file" type="data" format="tabular" label="Dataset containing read names that will be INCLUDED in the output" help="READ_LIST_FILE"/>
      </when>
      <when value="excludeReadList">
        <param name="read_list_file" type="data" format="tabular" label="Dataset containing read names that will be EXCLUDED in the output" help="READ_LIST_FILE"/>
      </when>
    </conditional>
    
    <expand macro="VS" />
    
  </inputs> 
  
  <outputs>
    <data format="bam" name="outFile" label="${tool.name} on ${on_string}: filtered BAM"/>
  </outputs>
  
  <tests>
    <test>
      <param name="inputFile" value="picard_FilterSamReads.bam" ftype="bam"/>
      <param name="filter" value="includeReadList"/>
      <param name="read_list_file" value="picard_FilterSamReads_read_list_file.tab" ftype="tabular"/>
      <param name="validation_stringency" value="LENIENT"/>
      <output name="outFile" file="picard_FilterSamReads_include_reads_test1.bam" ftype="bam" lines_diff="2"/>
    </test>
    <test>
      <param name="inputFile" value="picard_FilterSamReads.bam" ftype="bam"/>
      <param name="filter" value="excludeReadList"/>
      <param name="read_list_file" value="picard_FilterSamReads_read_list_file.tab" ftype="tabular"/>
      <param name="validation_stringency" value="LENIENT"/>
      <output name="outFile" file="picard_FilterSamReads_exclude_reads_test2.bam" ftype="bam" lines_diff="2"/>
    </test>
  </tests>
  
  <stdio>
    <exit_code range="1:"  level="fatal"/>
  </stdio>
  
  <help>

**Purpose**

Computes a number of metrics that are useful for evaluating coverage and performance of whole genome sequencing experiments.

------

.. class:: warningmark

**Warning on using this tool on BWA-MEM output**

This tool will likely fail on BAM datasets generated by BWA MEM as it generates partial read alignemnts. 

@dataset_collections@

@description@

  FILTER=Filter                 Filter.  Required. Possible values:
                                includeAligned [OUTPUT SAM/BAM will contain aligned 
                                reads only. (Note that *both* first and 
                                second of paired reads must be aligned to be included
                                in the OUTPUT SAM or BAM)], 
                                
                                excludeAligned [OUTPUT SAM/BAM will contain un-mapped reads only.
                                (Note that *both* first and second of pair must be aligned to be 
                                excluded from the OUTPUT SAM or BAM)]
                                
                                includeReadList [OUTPUT SAM/BAM will contain reads 
                                that are supplied in the READ_LIST_FILE file]
                                
                                excludeReadList [OUTPUT bam will contain 
                                reads that are *not* supplied in the READ_LIST_FILE file]} 

  READ_LIST_FILE=File
  RLF=File                      Read List File containing reads that will be included or excluded from the OUTPUT SAM or 
                                BAM file.  Default value: null. 
  
@more_info@

  </help>
</tool>