/tools/new_operations/tables_arithmetic_operations.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 105 lines · 77 code · 28 blank · 0 comment · 0 complexity · 9f7206507262c7b46d28491813ee3141 MD5 · raw file

  1. <tool id="tables_arithmetic_operations" name="Arithmetic Operations " version="1.0.0">
  2. <description>on tables</description>
  3. <command interpreter="perl">
  4. tables_arithmetic_operations.pl $inputFile1 $inputFile2 $inputArithmeticOperation3 $outputFile1
  5. </command>
  6. <inputs>
  7. <param format="tabular" name="inputFile1" type="data" label="Select the first input tabular file"/>
  8. <param format="tabular" name="inputFile2" type="data" label="Select the second input tabular file"/>
  9. <param name="inputArithmeticOperation3" type="select" label="Choose the arithmetic operation:">
  10. <option value="Addition">Addition</option>
  11. <option value="Subtraction">Subtraction</option>
  12. <option value="Multiplication">Multiplication</option>
  13. <option value="Division">Division</option>
  14. </param>
  15. </inputs>
  16. <outputs>
  17. <data format="tabular" name="outputFile1"/>
  18. </outputs>
  19. <tests>
  20. <test>
  21. <param name="inputFile1" value="numericalTable1.tabular" />
  22. <param name="inputFile2" value="numericalTable1.tabular" />
  23. <param name="inputArithmeticOperation3" value="Addition" />
  24. <output name="outputFile1" file="table_addition_result.tabular" />
  25. </test>
  26. <test>
  27. <param name="inputFile1" value="numericalTable1.tabular" />
  28. <param name="inputFile2" value="numericalTable1.tabular" />
  29. <param name="inputArithmeticOperation3" value="Subtraction" />
  30. <output name="outputFile1" file="table_subtraction_result.tabular" />
  31. </test>
  32. <test>
  33. <param name="inputFile1" value="numericalTable1.tabular" />
  34. <param name="inputFile2" value="numericalTable1.tabular" />
  35. <param name="inputArithmeticOperation3" value="Multiplication" />
  36. <output name="outputFile1" file="table_multiplication_result.tabular" />
  37. </test>
  38. <test>
  39. <param name="inputFile1" value="numericalTable1.tabular" />
  40. <param name="inputFile2" value="numericalTable1.tabular" />
  41. <param name="inputArithmeticOperation3" value="Division" />
  42. <output name="outputFile1" file="table_division_result.tabular" />
  43. </test>
  44. </tests>
  45. <help>
  46. .. class:: infomark
  47. **What it does**
  48. This program implements arithmetic operations on tabular files data. The program takes three inputs:
  49. - The first input is a TABULAR format file containing numbers only.
  50. - The second input is a TABULAR format file containing numbers only.
  51. - The third input is an arithmetic operation: +, -, x, or / for addition, subtraction, multiplication, or division, respectively.
  52. - The output file is a TABULAR format file containing the result of implementing the arithmetic operation on both input files.
  53. Notes:
  54. - The two files must have the same number of columns and the same number of rows.
  55. - The output file has the same number of columns and the same number of rows as each of the two input files.
  56. - In case of division, none of the values in the second input file could be 0, otherwise the program will stop and report an error.
  57. **Example**
  58. Let us have the first input file as follows::
  59. 5 4 0
  60. 10 11 12
  61. 1 3 1
  62. 1 2 1
  63. 2 0 4
  64. And the second input file as follows::
  65. 5 4 4
  66. 2 5 8
  67. 1 2 1
  68. 3 2 5
  69. 2 4 4
  70. Running the program and choosing "Addition" as an arithmetic operation will give the following output::
  71. 10 8 4
  72. 12 16 20
  73. 2 5 2
  74. 4 4 6
  75. 4 4 8
  76. </help>
  77. </tool>