/tools/filters/uniq.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 75 lines · 60 code · 15 blank · 0 comment · 0 complexity · 43305040d5cfb5822d42d4fa3addbb07 MD5 · raw file

  1. <tool id="Count1" name="Count">
  2. <description>occurrences of each record</description>
  3. <command interpreter="python">uniq.py -i $input -o $out_file1 -c "$column" -d $delim</command>
  4. <inputs>
  5. <param name="input" type="data" format="tabular" label="from dataset" help="Dataset missing? See TIP below"/>
  6. <param name="column" type="data_column" data_ref="input" multiple="True" numerical="False" label="Count occurrences of values in column(s)" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
  7. <param name="delim" type="select" label="Delimited by">
  8. <option value="T">Tab</option>
  9. <option value="Sp">Whitespace</option>
  10. <option value="Dt">Dot</option>
  11. <option value="C">Comma</option>
  12. <option value="D">Dash</option>
  13. <option value="U">Underscore</option>
  14. <option value="P">Pipe</option>
  15. </param>
  16. </inputs>
  17. <outputs>
  18. <data format="tabular" name="out_file1" />
  19. </outputs>
  20. <tests>
  21. <test>
  22. <param name="input" value="1.bed"/>
  23. <output name="out_file1" file="uniq_out.dat"/>
  24. <param name="column" value="1"/>
  25. <param name="delim" value="T"/>
  26. </test>
  27. </tests>
  28. <help>
  29. .. class:: infomark
  30. **TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*
  31. -----
  32. **Syntax**
  33. This tool counts occurrences of unique values in selected column(s).
  34. - If multiple columns are selected, counting is performed on each unique group of all values in the selected columns.
  35. - The first column of the resulting dataset will be the count of unique values in the selected column(s) and will be followed by each value.
  36. -----
  37. **Example**
  38. - Input file::
  39. chr1 10 100 gene1
  40. chr1 105 200 gene2
  41. chr1 205 300 gene3
  42. chr2 10 100 gene4
  43. chr2 1000 1900 gene5
  44. chr3 15 1656 gene6
  45. chr4 10 1765 gene7
  46. chr4 10 1765 gene8
  47. - Counting unique values in column c1 will result in::
  48. 3 chr1
  49. 2 chr2
  50. 1 chr3
  51. 2 chr4
  52. - Counting unique values in the grouping of columns c2 and c3 will result in::
  53. 2 10 100
  54. 2 10 1765
  55. 1 1000 1900
  56. 1 105 200
  57. 1 15 1656
  58. 1 205 300
  59. </help>
  60. </tool>