view picard_DownsampleSam.xml @ 3:3abc76f7fa12 draft

Uploaded
author devteam
date Thu, 23 Jan 2014 19:32:48 -0500
parents
children
line wrap: on
line source

<tool name="Downsample SAM" id="picard_DownsampleSam" version="1.106.0">
    <!-- found on https://bitbucket.org/bwlang/galaxy-dist/src/ca5ded2e18a9ef802c31429e3cb861e8775b24d0/tools/picard/picard_DownsampleSam.xml -->
   <requirements><requirement type="package" version="1.106.0">picard</requirement></requirements>
  <command interpreter="python">
    picard_wrapper.py
      --input=$inputFile
      --output=$outFile
      --probability=$probability
      --seed=$seed
      -j "\$JAVA_JAR_PATH/DownsampleSam.jar"
  </command>
  <inputs>
    <param format="sam" name="inputFile" type="data" label="SAM dataset to be downsampled"
           help="If empty, upload or import a SAM dataset." />
    <param name="probability" type="float" size="5" label="Probability (between 0 and 1) that any given read will be kept" help="specify 1 to keep all reads, 0.1 to keep 10% of the reads" value="1" />
    <param name="seed" type="integer" size="5" label="Random seed value" help="(same seed + same probability = same set of reads kept)" value="1" />

  </inputs>
  <outputs>
    <data name="outFile" format="sam" label="${tool.name} on ${on_string}">
    </data>
  </outputs>
  <tests>
    <test>
      <!-- Commands:
      cp test-data/phiX.fasta .
      samtools faidx phiX.fasta
      java -jar CreateSequenceDictionary.jar R=phiX.fasta O=phiX.dict URI=phiX.fasta TRUNCATE_NAMES_AT_WHITESPACE=false SPECIES=phiX174
      java -jar ReorderSam.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_RS_input1.bam O=picard_RS_output1.bam REFERENCE=phiX.fasta ALLOW_INCOMPLETE_DICT_CONCORDANCE=false ALLOW_CONTIG_LENGTH_DISCORDANCE=false
    -->
      <param name="inputFile" value="picard_RS_input1.sam" />
      <param name="probability" value="0.1" />
      <param name="seed" value="2" />
      <output name="outFile" file="picard_RS_output1.sam" ftype="sam" />
    </test>
  </tests>
  <help>

.. class:: infomark

**Purpose**

Randomly down-sample a SAM or BAM file to retain a random subset of the reads. Mate-pairs are either both kept or both discarded. Reads marked as not primary alignments are all discarded. Each read is given a probability P of being retained - results with the exact same input in the same order and with the same value for RANDOM_SEED will produce the same results.

**Picard documentation**

This is a Galaxy wrapper for DownsampleSam, a part of the external package Picard-tools_.

 .. _Picard-tools: http://www.google.com/search?q=picard+samtools

------

.. class:: warningmark

**Warning on SAM/BAM quality**

Many SAM/BAM files produced externally and uploaded to Galaxy do not fully conform to SAM/BAM specifications. Galaxy deals with this by using the **LENIENT**
flag when it runs Picard, which allows reads to be discarded if they're empty or don't map. This appears
to be the only way to deal with SAM/BAM that cannot be parsed.


  </help>
</tool>