PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/new_operations/subtract.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 124 lines | 100 code | 22 blank | 2 comment | 0 complexity | 58038779ebe8754e4dc623e94b52f09d MD5 | raw file
  1<tool id="gops_subtract_1" name="Subtract">
  2  <description>the intervals of two datasets</description>
  3  <command interpreter="python">gops_subtract.py 
  4      $input1 $input2 $output
  5
  6      #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
  7        -1 1,4,5,7 --gff1
  8      #else:
  9        -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
 10      #end if
 11
 12      #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
 13        -2 1,4,5,7 --gff2
 14      #else:
 15          -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol} 
 16      #end if
 17
 18      -m $min $returntype
 19  </command>
 20  <inputs>
 21    <param format="interval,gff" name="input2" type="data" help="Second dataset">
 22      <label>Subtract</label>
 23    </param>
 24
 25    <param format="interval,gff" name="input1" type="data" help="First dataset">
 26      <label>from</label>
 27    </param>
 28
 29    <param name="returntype" type="select" label="Return" help="of the first dataset (see figure below)">
 30      <option value="">Intervals with no overlap</option>
 31      <option value="-p">Non-overlapping pieces of intervals</option>
 32    </param>
 33    
 34    <param name="min" size="4" type="integer" value="1" min="1" help="(bp)">
 35      <label>where minimal overlap is</label>
 36    </param>
 37   </inputs>
 38  <outputs>
 39    <data format="input" name="output" metadata_source="input1"/>
 40  </outputs>
 41  <code file="operation_filter.py"/>
 42  <trackster_conf/>
 43  <tests>
 44    <test>
 45      <param name="input1" value="1.bed" />
 46      <param name="input2" value="2.bed" />
 47      <param name="min" value="1" />
 48      <param name="returntype" value="" />
 49      <output name="output" file="gops-subtract.dat" />
 50    </test>
 51    <test>
 52      <param name="input1" value="1.bed" />
 53      <param name="input2" value="2_mod.bed" ftype="interval"/>
 54      <param name="min" value="1" />
 55      <param name="returntype" value="" />
 56      <output name="output" file="gops_subtract_diffCols.dat" />
 57    </test>
 58    <test>
 59      <param name="input1" value="gops_subtract_bigint.bed" />
 60      <param name="input2" value="2.bed" />
 61      <param name="min" value="1" />
 62      <param name="returntype" value="" />
 63      <output name="output" file="gops-subtract.dat" />
 64    </test>
 65    <test>
 66      <param name="input1" value="1.bed" />
 67      <param name="input2" value="2.bed" />
 68      <param name="min" value="10" />
 69      <param name="returntype" value="Non-overlapping pieces of intervals" />
 70      <output name="output" file="gops-subtract-p.dat" />     
 71    </test>
 72    <!-- Subtract two GFF files. -->
 73    <test>
 74        <param name="input1" value="gops_subtract_in1.gff" />
 75        <param name="input2" value="gops_subtract_in2.gff" />
 76        <param name="min" value="1" />
 77        <param name="returntype" value="" />
 78        <output name="output" file="gops_subtract_out1.gff" />
 79    </test>
 80    <!-- Subtract BED file from GFF file. -->
 81    <test>
 82        <param name="input1" value="gops_subtract_in1.gff" />
 83        <param name="input2" value="gops_subtract_in2.bed" />
 84        <param name="min" value="1" />
 85        <param name="returntype" value="" />
 86        <output name="output" file="gops_subtract_out1.gff" />
 87    </test>
 88  </tests>
 89  <help>
 90
 91.. class:: infomark
 92
 93**TIP:** If your dataset does not appear in the pulldown menu, it means that it is not in interval format. Use "edit attributes" to set chromosome, start, end, and strand columns.
 94
 95-----
 96
 97**Screencasts!**
 98
 99See Galaxy Interval Operation Screencasts_ (right click to open this link in another window).
100
101.. _Screencasts: http://wiki.g2.bx.psu.edu/Learn/Interval%20Operations
102
103-----
104
105**Syntax**
106
107- **Where overlap is at least** sets the minimum length (in base pairs) of overlap between elements of the two datasets.
108- **Intervals with no overlap** returns entire intervals from the first dataset that do not overlap the second dataset.  The returned intervals are completely unchanged, and this option only filters out intervals that overlap with the second dataset.
109- **Non-overlapping pieces of intervals** returns intervals from the first dataset that have the intervals from the second dataset removed.  Any overlapping base pairs are removed from the range of the interval.  All fields besides start and end are guaranteed to remain unchanged.
110
111-----
112
113**Example**
114
115Intervals with no overlap:
116
117.. image:: ${static_path}/operation_icons/gops_subtractOverlappingIntervals.gif
118
119Non-overlapping pieces of intervals:
120
121.. image:: ${static_path}/operation_icons/gops_subtractOverlappingPieces.gif
122
123</help>
124</tool>