Mercurial > repos > workflow4metabolomics > kmd_hmdb_data_plot
comparison kmd_hmdb_data_plot.xml @ 0:59c8bad5f6bc draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/blob/master/tools/kmd_hmdb_data_plot/ commit 7fa454b6a4268b89fe18043e8dd10f30a7b4c7ca
| author | workflow4metabolomics |
|---|---|
| date | Tue, 29 Aug 2023 09:45:16 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:59c8bad5f6bc |
|---|---|
| 1 <tool id="kmd_hmdb_data_plot" name="KMD HMDB Data Plot" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09"> | |
| 2 <description> | |
| 3 retrieves data from KMD HMDB API and produce plot and tsv file | |
| 4 </description> | |
| 5 <macros> | |
| 6 <import>macro.xml</import> | |
| 7 <token name="@TOOL_VERSION@">1.0.0</token> | |
| 8 <token name="@VERSION_SUFFIX@">0</token> | |
| 9 </macros> | |
| 10 <edam_topics> | |
| 11 <edam_topic>topic_0091</edam_topic> | |
| 12 </edam_topics> | |
| 13 <edam_operations> | |
| 14 <edam_operation>operation_3803</edam_operation> | |
| 15 </edam_operations> | |
| 16 <requirements> | |
| 17 <requirement type="package" version="3.10">python</requirement> | |
| 18 <requirement type="package" version="2.0.3">pandas</requirement> | |
| 19 <requirement type="package" version="5.15.0">plotly</requirement> | |
| 20 <requirement type="package" version="1.0.1">kmd_hmdb_api_client</requirement> | |
| 21 </requirements> | |
| 22 <command detect_errors="exit_code"> | |
| 23 <![CDATA[ | |
| 24 #if "get_data" in str($what.to_do) | |
| 25 python3 '$__tool_directory__/kmd_hmdb_interrogator.py' compound | |
| 26 --mz-ratio '$what.mz_ratio' | |
| 27 --database '$what.database' | |
| 28 --mass-tolerance '$what.mass_tolerance' | |
| 29 #for adduct in $what.adducts | |
| 30 --adducts '$adduct' | |
| 31 #end for | |
| 32 --output-path '$output_path' | |
| 33 #end if | |
| 34 | |
| 35 #if $what.to_do == "get_data_and_produce_plot" | |
| 36 && | |
| 37 #end if | |
| 38 | |
| 39 #if "produce_plot" in str($what.to_do) | |
| 40 python3 '$__tool_directory__/kmd_hmdb_plot_generator.py' plot | |
| 41 | |
| 42 #if "get_data" in str($what.to_do) | |
| 43 --input '$output_path' | |
| 44 #else | |
| 45 --input '$what.tsv_input' | |
| 46 #end if | |
| 47 | |
| 48 #if $what.x_columns | |
| 49 #for x in $what.x_columns | |
| 50 --x-column '$x' | |
| 51 #end for | |
| 52 #end if | |
| 53 | |
| 54 #if $what.y_columns | |
| 55 #for y in $what.y_columns | |
| 56 --y-column '$y' | |
| 57 #end for | |
| 58 #end if | |
| 59 | |
| 60 #if $what.annotation_columns | |
| 61 #for annotation_column in $what.annotation_columns | |
| 62 --annotation-column '$annotation_column' | |
| 63 #end for | |
| 64 #end if | |
| 65 | |
| 66 --output 'out.html' | |
| 67 | |
| 68 && cat 'out.html' > '$output' | |
| 69 #end if | |
| 70 ]]> | |
| 71 </command> | |
| 72 | |
| 73 <inputs> | |
| 74 <conditional name="what"> | |
| 75 <param name="to_do" type="select" | |
| 76 label="What to do" | |
| 77 > | |
| 78 <option value="get_data">Only get data</option> | |
| 79 <option value="produce_plot">Only produce plot</option> | |
| 80 <option value="get_data_and_produce_plot" selected="true"> | |
| 81 Get data from database + Produce Plot | |
| 82 </option> | |
| 83 </param> | |
| 84 <when value="produce_plot"> | |
| 85 <expand macro="produce_plot_inputs" /> | |
| 86 <expand macro="not_get_data" /> | |
| 87 </when> | |
| 88 <when value="get_data"> | |
| 89 <expand macro="get_data_inputs" /> | |
| 90 <expand macro="not_produce_plot" /> | |
| 91 </when> | |
| 92 <when value="get_data_and_produce_plot"> | |
| 93 <expand macro="get_data_inputs" /> | |
| 94 <expand macro="not_produce_plot" /> | |
| 95 </when> | |
| 96 </conditional> | |
| 97 </inputs> | |
| 98 | |
| 99 <outputs> | |
| 100 <expand macro="get_data_outputs" /> | |
| 101 <expand macro="produce_plot_outputs" /> | |
| 102 </outputs> | |
| 103 | |
| 104 <tests> | |
| 105 <test> | |
| 106 <!-- #1 get_data with tolerance = 0.01 --> | |
| 107 <param name="to_do" value="get_data" /> | |
| 108 <param name="mass_tolerance" value="0.01" /> | |
| 109 <param name="mz_ratio" value="303.05" /> | |
| 110 <param name="database" value="hmdb" /> | |
| 111 <param name="adducts" value="M+H" /> | |
| 112 <output name="output_path" file="get_data_tol_0.01.tsv" /> | |
| 113 </test> | |
| 114 </tests> | |
| 115 | |
| 116 <help><![CDATA[ | |
| 117 | |
| 118 This tool includes two utilities. | |
| 119 One that retrieves data from the KMD HMDB API formated as a tsv file, | |
| 120 and the other plots those data in a plotly graph. | |
| 121 | |
| 122 The default behavior of the plot is to produce a plot of the kmd in | |
| 123 in function of the nominal mass of the compound. | |
| 124 | |
| 125 Compounds are retrieved using a query with default parameters: | |
| 126 - mz default to @DEFAULT_MZ@ | |
| 127 - mz tolerance defaults to @DEFAULT_TOLERENCE@ | |
| 128 - adduct list defaults to "@DEFAULT_ADDUCT@" | |
| 129 - database default to "@DEFAULT_DATABASE@", and possible values are one of: | |
| 130 | |
| 131 - KMD Metabolites | |
| 132 - HMDB | |
| 133 | |
| 134 Those two utilities are usable independently, or sequentially in galaxy. | |
| 135 | |
| 136 Multiple X / Y values in the X/Y column selection can be | |
| 137 selected to produce a lot of graphs at once. | |
| 138 | |
| 139 For example, imagine you have 5 columns in you tsv file, | |
| 140 and those columns are named: A, B, C, D and F. | |
| 141 | |
| 142 If you choose X = [A, C] and Y = [B], | |
| 143 then you will get two graphs (in one single HTML file) with: | |
| 144 | |
| 145 - f(A) = B | |
| 146 - f(C) = B | |
| 147 | |
| 148 But if you choose multiple values for both X and Y, you get | |
| 149 all combinations of columns X and Y. For example, if you | |
| 150 select X = [A, B] and Y = [C, D, E], then you will get six | |
| 151 graphs on the same plot: | |
| 152 | |
| 153 - f(A) = C | |
| 154 - f(A) = D | |
| 155 - f(A) = E | |
| 156 - f(B) = C | |
| 157 - f(B) = D | |
| 158 - f(B) = E | |
| 159 | |
| 160 All those graph's traces will be tooglable in the HTML page. | |
| 161 So don't hesitate to select a lot of parameters for X and Y! | |
| 162 | |
| 163 ]]> | |
| 164 </help> | |
| 165 <citations></citations> | |
| 166 <creator> | |
| 167 <person | |
| 168 honorificPrefix="Mx." | |
| 169 givenName="Lain" | |
| 170 familyName="Pavot" | |
| 171 email="lain.pavot@inrae.fr" | |
| 172 identifier="https://orcid.org/0009-0007-1841-4358" | |
| 173 /> | |
| 174 </creator> | |
| 175 | |
| 176 </tool> |
