PageRenderTime 25ms CodeModel.GetById 14ms RepoModel.GetById 0ms 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. #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
  6. -1 1,4,5,7 --gff1
  7. #else:
  8. -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
  9. #end if
  10. #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
  11. -2 1,4,5,7 --gff2
  12. #else:
  13. -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
  14. #end if
  15. -m $min $returntype
  16. </command>
  17. <inputs>
  18. <param format="interval,gff" name="input2" type="data" help="Second dataset">
  19. <label>Subtract</label>
  20. </param>
  21. <param format="interval,gff" name="input1" type="data" help="First dataset">
  22. <label>from</label>
  23. </param>
  24. <param name="returntype" type="select" label="Return" help="of the first dataset (see figure below)">
  25. <option value="">Intervals with no overlap</option>
  26. <option value="-p">Non-overlapping pieces of intervals</option>
  27. </param>
  28. <param name="min" size="4" type="integer" value="1" min="1" help="(bp)">
  29. <label>where minimal overlap is</label>
  30. </param>
  31. </inputs>
  32. <outputs>
  33. <data format="input" name="output" metadata_source="input1"/>
  34. </outputs>
  35. <code file="operation_filter.py"/>
  36. <trackster_conf/>
  37. <tests>
  38. <test>
  39. <param name="input1" value="1.bed" />
  40. <param name="input2" value="2.bed" />
  41. <param name="min" value="1" />
  42. <param name="returntype" value="" />
  43. <output name="output" file="gops-subtract.dat" />
  44. </test>
  45. <test>
  46. <param name="input1" value="1.bed" />
  47. <param name="input2" value="2_mod.bed" ftype="interval"/>
  48. <param name="min" value="1" />
  49. <param name="returntype" value="" />
  50. <output name="output" file="gops_subtract_diffCols.dat" />
  51. </test>
  52. <test>
  53. <param name="input1" value="gops_subtract_bigint.bed" />
  54. <param name="input2" value="2.bed" />
  55. <param name="min" value="1" />
  56. <param name="returntype" value="" />
  57. <output name="output" file="gops-subtract.dat" />
  58. </test>
  59. <test>
  60. <param name="input1" value="1.bed" />
  61. <param name="input2" value="2.bed" />
  62. <param name="min" value="10" />
  63. <param name="returntype" value="Non-overlapping pieces of intervals" />
  64. <output name="output" file="gops-subtract-p.dat" />
  65. </test>
  66. <!-- Subtract two GFF files. -->
  67. <test>
  68. <param name="input1" value="gops_subtract_in1.gff" />
  69. <param name="input2" value="gops_subtract_in2.gff" />
  70. <param name="min" value="1" />
  71. <param name="returntype" value="" />
  72. <output name="output" file="gops_subtract_out1.gff" />
  73. </test>
  74. <!-- Subtract BED file from GFF file. -->
  75. <test>
  76. <param name="input1" value="gops_subtract_in1.gff" />
  77. <param name="input2" value="gops_subtract_in2.bed" />
  78. <param name="min" value="1" />
  79. <param name="returntype" value="" />
  80. <output name="output" file="gops_subtract_out1.gff" />
  81. </test>
  82. </tests>
  83. <help>
  84. .. class:: infomark
  85. **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.
  86. -----
  87. **Screencasts!**
  88. See Galaxy Interval Operation Screencasts_ (right click to open this link in another window).
  89. .. _Screencasts: http://wiki.g2.bx.psu.edu/Learn/Interval%20Operations
  90. -----
  91. **Syntax**
  92. - **Where overlap is at least** sets the minimum length (in base pairs) of overlap between elements of the two datasets.
  93. - **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.
  94. - **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.
  95. -----
  96. **Example**
  97. Intervals with no overlap:
  98. .. image:: ${static_path}/operation_icons/gops_subtractOverlappingIntervals.gif
  99. Non-overlapping pieces of intervals:
  100. .. image:: ${static_path}/operation_icons/gops_subtractOverlappingPieces.gif
  101. </help>
  102. </tool>