Mercurial > repos > iuc > liana_plot
comparison macros.xml @ 0:8b9b8d358883 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/liana commit 8dc656081d3147b402485bd25affe05a22e5194e
| author | iuc |
|---|---|
| date | Tue, 10 Mar 2026 13:41:01 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8b9b8d358883 |
|---|---|
| 1 <macros> | |
| 2 <token name="@TOOL_VERSION@">1.7.1</token> | |
| 3 <token name="@VERSION_SUFFIX@">0</token> | |
| 4 <token name="@PROFILE@">25.0</token> | |
| 5 <xml name="requirements"> | |
| 6 <requirements> | |
| 7 <!-- Pin the version of anndata and pandas to avoid breaks in saving the h5ad macros --> | |
| 8 <requirement type="package" version="@TOOL_VERSION@">liana</requirement> | |
| 9 <requirement type="package" version="0.10.7">anndata</requirement> | |
| 10 <requirement type="package" version="1.9.6">scanpy</requirement> | |
| 11 <requirement type="package" version="2.1.4">pandas</requirement> | |
| 12 </requirements> | |
| 13 </xml> | |
| 14 <xml name="bio_tools"> | |
| 15 <xrefs> | |
| 16 <xref type="bio.tools">liana</xref> | |
| 17 </xrefs> | |
| 18 </xml> | |
| 19 <xml name="creators"> | |
| 20 <creator> | |
| 21 <person givenName="Khaled" familyName="Jum'ah" url="https://github.com/khaled196" /> | |
| 22 <person givenName="Katarzyna" familyName="Kamieniecka" url="https://github.com/kkamieniecka" /> | |
| 23 <person givenName="Pavankumar" familyName="Videm" url="https://github.com/pavanvidem" /> | |
| 24 <person givenName="Krzysztof" familyName="Poterlowicz" url="https://github.com/poterlowicz-lab" /> | |
| 25 <organization name="poterlowicz-lab" url="https://github.com/poterlowicz-lab" /> | |
| 26 </creator> | |
| 27 </xml> | |
| 28 <xml name="citations"> | |
| 29 <citations> | |
| 30 <citation type="doi">10.1038/s41556-024-01469-w</citation> | |
| 31 </citations> | |
| 32 </xml> | |
| 33 | |
| 34 <!-- param macros --> | |
| 35 <xml name="sanitize_query" token_validinitial="string.printable"> | |
| 36 <sanitizer> | |
| 37 <valid initial="@VALIDINITIAL@"> | |
| 38 <remove value="'"/> | |
| 39 </valid> | |
| 40 </sanitizer> | |
| 41 </xml> | |
| 42 <xml name="inputs_anndata"> | |
| 43 <param name="adata" type="data" format="h5ad" label="Annotated data matrix"/> | |
| 44 </xml> | |
| 45 <xml name="inputs_common_advanced"> | |
| 46 <section name="advanced_common" title="Advanced Options" expanded="false"> | |
| 47 <param name="show_log" type="boolean" checked="false" label="Output Log?"/> | |
| 48 </section> | |
| 49 </xml> | |
| 50 <xml name="anndata_outputs"> | |
| 51 <data name="anndata_out" format="h5ad" from_work_dir="anndata.h5ad" label="${tool.name} (${method.method}) on ${on_string}: Annotated data matrix"> | |
| 52 </data> | |
| 53 <data name="hidden_output" format="txt" label="Log file" > | |
| 54 <filter>advanced_common['show_log']</filter> | |
| 55 </data> | |
| 56 </xml> | |
| 57 | |
| 58 <!-- Liana-specific parameter macros --> | |
| 59 <xml name="param_groupby"> | |
| 60 <param argument="groupby" type="text" value="" optional="false" label="Group By" help="Key to be used for grouping"> | |
| 61 <expand macro="sanitize_query"/> | |
| 62 <validator type="empty_field" message="Please provide a valid groupby key (required)"/> | |
| 63 </param> | |
| 64 </xml> | |
| 65 <!-- Simple resource name parameter --> | |
| 66 <xml name="param_resource_name"> | |
| 67 <param argument="resource_name" type="select" label="Ligand-receptor database" help="Built-in database of ligand-receptor pair annotations"> | |
| 68 <option value="consensus" selected="true">consensus - Combined databases (recommended)</option> | |
| 69 <option value="cellchatdb">CellChat database</option> | |
| 70 <option value="cellphonedb">CellPhoneDB database</option> | |
| 71 <option value="connectomedb2020">Connectome database</option> | |
| 72 <option value="baccin2019">Baccin et al. 2019</option> | |
| 73 <option value="cellcall">CellCall</option> | |
| 74 <option value="cellinker">CellInker</option> | |
| 75 <option value="celltalkdb">CellTalkDB</option> | |
| 76 <option value="embrace">EMBRACE</option> | |
| 77 <option value="guide2pharma">Guide to Pharmacology</option> | |
| 78 <option value="hpmr">Human Protein-Protein Interactions</option> | |
| 79 <option value="icellnet">iCellNet</option> | |
| 80 <option value="italk">iTALK</option> | |
| 81 <option value="kirouac2010">Kirouac et al. 2010</option> | |
| 82 <option value="lrdb">LRDB</option> | |
| 83 <option value="mouseconsensus">mouseconsensus - Mouse data</option> | |
| 84 <option value="ramilowski2015">Ramilowski et al. 2015</option> | |
| 85 </param> | |
| 86 </xml> | |
| 87 <!-- Resource selection with hierarchy: interactions > resource > resource_name --> | |
| 88 <xml name="param_return_all_lrs"> | |
| 89 <param argument="return_all_lrs" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Return all interactions" help="If enabled: include all L-R pairs from database even if they fail expression filter. If disabled: return only pairs meeting expr_prop threshold."/> | |
| 90 </xml> | |
| 91 <xml name="param_key_added"> | |
| 92 <param argument="key_added" type="text" value="liana_res" label="Results key in adata.uns" help="Key in adata.uns where results will be stored. Default: 'liana_res'."> | |
| 93 <expand macro="sanitize_query"/> | |
| 94 </param> | |
| 95 </xml> | |
| 96 <xml name="param_use_raw"> | |
| 97 <param argument="use_raw" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Use raw counts" help="If enabled: use adata.raw.X (raw/unprocessed counts). If disabled: use adata.X (processed/normalized expression). Default: enabled."/> | |
| 98 </xml> | |
| 99 <xml name="param_layer"> | |
| 100 <param argument="layer" type="text" value="" optional="true" label="Layer in adata" help="Specific layer in adata.layers to use (e.g., 'log1p', 'scaled', 'raw'). If empty: uses adata.X."> | |
| 101 <expand macro="sanitize_query"/> | |
| 102 </param> | |
| 103 </xml> | |
| 104 <xml name="param_de_method"> | |
| 105 <param argument="de_method" type="select" label="Differential expression test" help="Statistical method for rank_genes_groups (1-vs-Rest). t-test: parametric; wilcoxon: non-parametric, robust; logreg: logistic regression. Default: t-test."> | |
| 106 <option value="t-test" selected="true">t-test (default)</option> | |
| 107 <option value="t-test_overestim_var">t-test with variance correction</option> | |
| 108 <option value="wilcoxon">Wilcoxon rank-sum (non-parametric)</option> | |
| 109 <option value="logreg">Logistic regression</option> | |
| 110 </param> | |
| 111 </xml> | |
| 112 <xml name="param_n_perms"> | |
| 113 <param argument="n_perms" type="integer" value="1000" min="0" optional="true" label="Permutation test iterations" help="Number of random permutations for statistical significance (CellPhoneDB, etc.). Default: 1000. Set to 0 to skip permutation testing."/> | |
| 114 </xml> | |
| 115 <xml name="param_seed"> | |
| 116 <param argument="seed" type="integer" value="1337" label="Random seed for reproducibility" help=""/> | |
| 117 </xml> | |
| 118 <xml name="param_base"> | |
| 119 <param argument="base" type="float" value="2.718281828459045" optional="true" label="Log transformation base" help="Base for reversing log-transformation of expression values. Default: e (2.718). Use 2 for log2 or 10 for log10 data."/> | |
| 120 </xml> | |
| 121 <xml name="param_supp_columns"> | |
| 122 <param argument="supp_columns" type="text" value="" optional="true" label="Additional columns to be added" help="From any of the methods implemented in liana , or any of the columns returned by scanpy, each starting with ligand_* or receptor_*. For example, ['ligand_pvals', 'receptor_pvals']"/> | |
| 123 </xml> | |
| 124 | |
| 125 <!-- Grouped parameter macros for cleaner code --> | |
| 126 <xml name="params_common_basic"> | |
| 127 <expand macro="param_groupby"/> | |
| 128 <expand macro="param_resource_selection"/> | |
| 129 <param argument="expr_prop" type="float" value="0.1" min="0" max="1" label="Minimum expression proportion" help="Minimum expression proportion for the ligands and receptors (+ their subunits) in the corresponding cell identities. Set to 0 to return unfiltered results"/> | |
| 130 <param argument="min_cells" type="integer" value="5" min="1" label="Minimum cells" help="Minimum number of cells per cell identity to be considered for downstream analysis. Default: 5."/> | |
| 131 </xml> | |
| 132 <xml name="params_common_output"> | |
| 133 <expand macro="param_return_all_lrs"/> | |
| 134 <expand macro="param_key_added"/> | |
| 135 <expand macro="param_layer"/> | |
| 136 </xml> | |
| 137 <!-- Combined common params for methods without permutations --> | |
| 138 <xml name="params_lr_method_basic"> | |
| 139 <expand macro="params_common_basic"/> | |
| 140 <expand macro="params_common_output"/> | |
| 141 <expand macro="param_supp_columns"/> | |
| 142 <expand macro="param_de_method"/> | |
| 143 <expand macro="param_seed"/> | |
| 144 </xml> | |
| 145 <!-- Combined common params for methods with permutations --> | |
| 146 <xml name="params_lr_method_with_perms"> | |
| 147 <expand macro="params_common_basic"/> | |
| 148 <expand macro="params_common_output"/> | |
| 149 <expand macro="param_supp_columns"/> | |
| 150 <expand macro="param_de_method"/> | |
| 151 <expand macro="param_n_perms"/> | |
| 152 <expand macro="param_seed"/> | |
| 153 </xml> | |
| 154 | |
| 155 <!-- Spatial-specific parameter macros --> | |
| 156 <xml name="param_spatial_key"> | |
| 157 <param argument="spatial_key" type="text" value="spatial" label="Spatial coordinates key" help="The key in adata.obsm where the spatial coordinates are stored"> | |
| 158 <expand macro="sanitize_query"/> | |
| 159 </param> | |
| 160 </xml> | |
| 161 <xml name="param_nz_threshold"> | |
| 162 <param argument="nz_threshold" type="float" value="0.1" min="0" max="1" label="Non-zero threshold for views" help=""/> | |
| 163 </xml> | |
| 164 <xml name="param_set_diag"> | |
| 165 <param argument="set_diag" type="boolean" truevalue="True" falsevalue="False" checked="true" label=" Set the diagonal of the connectivity matrix to 1" help=""/> | |
| 166 </xml> | |
| 167 <xml name="param_kernel"> | |
| 168 <param argument="kernel" type="select" label="Radial basis function kernel" value="@DEFAULT_KERNEL@" help="Used for the generation of the connectivity matrix for the paraview"> | |
| 169 <option value="misty_rbf">misty_rbf - MISTy RBF (default)</option> | |
| 170 <option value="gaussian">gaussian - Gaussian kernel</option> | |
| 171 <option value="exponential">exponential - Exponential decay</option> | |
| 172 <option value="linear">linear - Inverse distance</option> | |
| 173 </param> | |
| 174 </xml> | |
| 175 <xml name="param_bandwidth"> | |
| 176 <param argument="bandwidth" type="float" value="100" min="0" label="Kernel bandwidth" help=""/> | |
| 177 </xml> | |
| 178 <xml name="param_zoi"> | |
| 179 <param argument="zoi" type="float" value="0" min="0" label="Kernel Zone of indifference" help=""/> | |
| 180 </xml> | |
| 181 <xml name="param_cutoff"> | |
| 182 <param argument="cutoff" type="float" value="0.1" min="0" max="1" label="Connectivity matrix cutoff" help=""/> | |
| 183 </xml> | |
| 184 <xml name="param_model"> | |
| 185 <param argument="model" type="select" label="MISTy prediction model" help="Statistical model for feature importance ranking"> | |
| 186 <option value="RandomForestModel" selected="true">RandomForestModel (default)</option> | |
| 187 <option value="LinearModel">LinearModel</option> | |
| 188 <option value="RobustLinearModel">RobustLinearModel</option> | |
| 189 </param> | |
| 190 </xml> | |
| 191 <xml name="param_bypass_intra"> | |
| 192 <param argument="bypass_intra" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Exclude intra-view from training" help=""/> | |
| 193 </xml> | |
| 194 <xml name="param_resource_selection"> | |
| 195 <conditional name="resource_selection"> | |
| 196 <param name="resource_type" type="select" label="Interaction source" help="Priority: interactions list > custom file > built-in database. Choose based on whether you have custom L-R pairs or want to use pre-defined resources."> | |
| 197 <option value="resource_name" selected="true">Use built-in database</option> | |
| 198 <option value="resource">Upload custom resource file</option> | |
| 199 <option value="interactions">Enter specific interaction pairs</option> | |
| 200 </param> | |
| 201 <when value="resource_name"> | |
| 202 <conditional name="resource_api_cached"> | |
| 203 <param name="resource_source_selector" type="select" label="Resource source" help="Use cached resources from this Galaxy server (installed via Data Manager) for fast offline access, or download from LIANA API."> | |
| 204 <option value="builtin">Download from LIANA API</option> | |
| 205 <option value="cached" selected="true">Cached on server (from Data Manager)</option> | |
| 206 </param> | |
| 207 <when value="cached"> | |
| 208 <param name="resource_cached" type="select" label="Ligand-receptor database (cached)" help="Select from resources installed by the LIANA Resources Data Manager."> | |
| 209 <options from_data_table="liana_resources"> | |
| 210 <validator type="no_options" message="No cached LIANA resources available. Install them via Admin → Data Managers → Download LIANA Resources."/> | |
| 211 </options> | |
| 212 </param> | |
| 213 </when> | |
| 214 <when value="builtin"> | |
| 215 <expand macro="param_resource_name"/> | |
| 216 </when> | |
| 217 </conditional> | |
| 218 </when> | |
| 219 <when value="resource"> | |
| 220 <param argument="resource" type="data" format="tabular" label="Custom resource file (TSV)" help="Tab-separated file with at least two columns named 'ligand' and 'receptor'. Each row represents one ligand-receptor interaction. This resource will override the built-in database selection."/> | |
| 221 </when> | |
| 222 <when value="interactions"> | |
| 223 <param argument="interactions" type="text" area="true" label="Ligand-receptor pairs (one per line)" help="Enter specific interactions to analyze in format: ligand,receptor (one pair per line, e.g., 'TGFB1,TGFBR1' or 'IL1A,IL1R1'). Use the same gene symbols as in your expression matrix. This list will override any built-in or custom resource file."> | |
| 224 <expand macro="sanitize_query"/> | |
| 225 </param> | |
| 226 </when> | |
| 227 </conditional> | |
| 228 </xml> | |
| 229 <!-- Multi-sample parameter macros --> | |
| 230 <xml name="param_sample_key"> | |
| 231 <param argument="sample_key" type="text" value="@VALUE@" label="Sample key" help="Key in adata.obs for grouping by sample or condition context. Default: 'sample'."> | |
| 232 <expand macro="sanitize_query"/> | |
| 233 </param> | |
| 234 </xml> | |
| 235 <xml name="param_score_key"> | |
| 236 <param argument="score_key" type="text" value="" optional="true" label="Score key" help="Column name of the score in liana_res. If empty, inferred from method."> | |
| 237 <expand macro="sanitize_query"/> | |
| 238 </param> | |
| 239 </xml> | |
| 240 <xml name="param_source_key"> | |
| 241 <param argument="source_key" type="text" value="source" label="Source key" help="Column name of sender/source cell types in LIANA results. Default: 'source'."> | |
| 242 <expand macro="sanitize_query"/> | |
| 243 </param> | |
| 244 </xml> | |
| 245 <xml name="param_target_key"> | |
| 246 <param argument="target_key" type="text" value="target" label="Target key" help="Column name of receiver/target cell types in LIANA results. Default: 'target'."> | |
| 247 <expand macro="sanitize_query"/> | |
| 248 </param> | |
| 249 </xml> | |
| 250 <xml name="param_ligand_key"> | |
| 251 <param argument="ligand_key" type="text" value="ligand_complex" label="Ligand key" help="Column name of ligand in LIANA results. Default: 'ligand_complex'."> | |
| 252 <expand macro="sanitize_query"/> | |
| 253 </param> | |
| 254 </xml> | |
| 255 <xml name="param_receptor_key"> | |
| 256 <param argument="receptor_key" type="text" value="receptor_complex" label="Receptor key" help="Column name of receptor in LIANA results. Default: 'receptor_complex'."> | |
| 257 <expand macro="sanitize_query"/> | |
| 258 </param> | |
| 259 </xml> | |
| 260 <xml name="params_multi_keys"> | |
| 261 <expand macro="param_score_key"/> | |
| 262 <expand macro="param_uns_key"/> | |
| 263 <expand macro="param_source_key"/> | |
| 264 <expand macro="param_target_key"/> | |
| 265 <expand macro="param_ligand_key"/> | |
| 266 <expand macro="param_receptor_key"/> | |
| 267 </xml> | |
| 268 | |
| 269 <!-- Plotting-specific parameter macros --> | |
| 270 <xml name="param_uns_key"> | |
| 271 <param argument="uns_key" type="text" value="liana_res" label="Results key in adata.uns" help="Must match key_added from inference method"> | |
| 272 <expand macro="sanitize_query"/> | |
| 273 </param> | |
| 274 </xml> | |
| 275 <xml name="param_plot_colour"> | |
| 276 <param argument="colour" type="text" value="" optional="true" label="Color by column" help="Column name in liana_res DataFrame to map to dot color. E.g., 'magnitude_rank', 'specificity_rank', 'lr_means', or pvalue columns."> | |
| 277 <expand macro="sanitize_query"/> | |
| 278 </param> | |
| 279 </xml> | |
| 280 <xml name="param_plot_size"> | |
| 281 <param argument="size" type="text" value="" optional="true" label="Size by column" help="Column name in liana_res DataFrame to map to dot size. Larger values = larger dots."> | |
| 282 <expand macro="sanitize_query"/> | |
| 283 </param> | |
| 284 </xml> | |
| 285 <xml name="param_misty_key"> | |
| 286 <param argument="key" type="text" value="" optional="true" label="Function to use to sort the dataframe" help=""> | |
| 287 <expand macro="sanitize_query"/> | |
| 288 </param> | |
| 289 </xml> | |
| 290 <xml name="param_source_labels"> | |
| 291 <param argument="source_labels" type="text" value="" optional="true" label="Source (sender) cell types" help="Comma-separated list of source cell type labels. Empty = show all. Useful for focusing on specific signaling populations."> | |
| 292 <expand macro="sanitize_query"/> | |
| 293 </param> | |
| 294 </xml> | |
| 295 <xml name="param_target_labels"> | |
| 296 <param argument="target_labels" type="text" value="" optional="true" label="Target (receiver) cell types" help="Comma-separated list of target cell type labels. Empty = show all. Useful for focusing on specific receiving populations."> | |
| 297 <expand macro="sanitize_query"/> | |
| 298 </param> | |
| 299 </xml> | |
| 300 <xml name="param_ligand_complex"> | |
| 301 <param argument="ligand_complex" type="text" value="" optional="true" label="Ligand genes" help="Comma-separated ligand gene symbols to include. Empty = all genes. Example: IL6,TNF,TGFB1."> | |
| 302 <expand macro="sanitize_query"/> | |
| 303 </param> | |
| 304 </xml> | |
| 305 <xml name="param_receptor_complex"> | |
| 306 <param argument="receptor_complex" type="text" value="" optional="true" label="Receptor genes" help="Comma-separated receptor gene symbols to include. Empty = all genes. Example: EGFR,FGFR1,PDGFRA."> | |
| 307 <expand macro="sanitize_query"/> | |
| 308 </param> | |
| 309 </xml> | |
| 310 <xml name="param_top_n"> | |
| 311 <param argument="top_n" type="integer" value="" optional="true" min="1" label="Top N interactions" help="Number of top-ranked interactions to display."/> | |
| 312 </xml> | |
| 313 <xml name="param_orderby"> | |
| 314 <param argument="orderby" type="text" value="" optional="true" label="Sort column" help="Column in LIANA results to sort by (used with top_n)."> | |
| 315 <expand macro="sanitize_query"/> | |
| 316 </param> | |
| 317 </xml> | |
| 318 <xml name="param_orderby_ascending"> | |
| 319 <param argument="orderby_ascending" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Sort ascending" help="Sort by increasing (smallest to largest) values."/> | |
| 320 </xml> | |
| 321 <xml name="param_orderby_absolute"> | |
| 322 <param argument="orderby_absolute" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Sort by absolute value" help="Sort by absolute value magnitude (ignoring sign)."/> | |
| 323 </xml> | |
| 324 <xml name="param_inverse_colour"> | |
| 325 <param argument="inverse_colour" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Apply -log10 transformation to color" help="If enabled: apply -log10 to color column (e.g., converts p-values to -log10(p)). Useful for p-value visualization."/> | |
| 326 </xml> | |
| 327 <xml name="param_inverse_size"> | |
| 328 <param argument="inverse_size" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Apply -log10 transformation to size" help="If enabled: apply -log10 to size column (useful for p-values where smaller p = larger dots)."/> | |
| 329 </xml> | |
| 330 <xml name="param_cmap"> | |
| 331 <param argument="cmap" type="select" label="Color scheme (matplotlib colormap)" help="Colormap for color column visualization. viridis/plasma: perceptually uniform; RdBu: diverging; sequential: Reds, Blues, etc. Default: viridis."> | |
| 332 <option value="viridis" selected="true">viridis - Perceptually uniform</option> | |
| 333 <option value="plasma">plasma</option> | |
| 334 <option value="inferno">inferno</option> | |
| 335 <option value="magma">magma</option> | |
| 336 <option value="cividis">cividis</option> | |
| 337 <option value="Greys">Greys</option> | |
| 338 <option value="Blues">Blues</option> | |
| 339 <option value="Greens">Greens</option> | |
| 340 <option value="Oranges">Oranges</option> | |
| 341 <option value="Reds">Reds</option> | |
| 342 <option value="YlOrBr">YlOrBr</option> | |
| 343 <option value="YlOrRd">YlOrRd</option> | |
| 344 <option value="OrRd">OrRd</option> | |
| 345 <option value="PuRd">PuRd</option> | |
| 346 <option value="RdPu">RdPu</option> | |
| 347 <option value="BuPu">BuPu</option> | |
| 348 <option value="GnBu">GnBu</option> | |
| 349 <option value="PuBu">PuBu</option> | |
| 350 <option value="YlGnBu">YlGnBu</option> | |
| 351 <option value="PuBuGn">PuBuGn</option> | |
| 352 <option value="BuGn">BuGn</option> | |
| 353 <option value="YlGn">YlGn</option> | |
| 354 <option value="PiYG">PiYG</option> | |
| 355 <option value="PRGn">PRGn</option> | |
| 356 <option value="BrBG">BrBG</option> | |
| 357 <option value="PuOr">PuOr</option> | |
| 358 <option value="RdGy">RdGy</option> | |
| 359 <option value="RdBu">RdBu</option> | |
| 360 <option value="RdBu_r">RdBu_r</option> | |
| 361 <option value="RdYlBu">RdYlBu</option> | |
| 362 <option value="RdYlGn">RdYlGn</option> | |
| 363 <option value="Spectral">Spectral</option> | |
| 364 <option value="coolwarm">coolwarm</option> | |
| 365 <option value="bwr">bwr</option> | |
| 366 <option value="seismic">seismic</option> | |
| 367 </param> | |
| 368 </xml> | |
| 369 <xml name="param_size_range"> | |
| 370 <param name="size_range_min" type="integer" value="2" min="1" label="Minimum dot size (pixels)" help="Smallest dot size for minimum values. Default: 2 pixels."/> | |
| 371 <param name="size_range_max" type="integer" value="9" min="1" label="Maximum dot size (pixels)" help="Largest dot size for maximum values. Default: 9 pixels. Adjust range to make size differences more/less prominent."/> | |
| 372 </xml> | |
| 373 <xml name="param_figure_size" token_width="8" token_height="6"> | |
| 374 <param name="figure_size_width" type="float" value="@WIDTH@" min="1" label="Figure width (inches)" help="Output plot width. Default: 8 inches."/> | |
| 375 <param name="figure_size_height" type="float" value="@HEIGHT@" min="1" label="Figure height (inches)" help="Output plot height. Default: 6 inches."/> | |
| 376 </xml> | |
| 377 | |
| 378 <!-- Plotting command tokens --> | |
| 379 <token name="@CMD_PLOT_SOURCE_TARGET_LABELS@"><![CDATA[ | |
| 380 #if str($method.source_labels) != '': | |
| 381 source_labels=[x.strip() for x in '$method.source_labels'.split(',')], | |
| 382 #end if | |
| 383 #if str($method.target_labels) != '': | |
| 384 target_labels=[x.strip() for x in '$method.target_labels'.split(',')], | |
| 385 #end if | |
| 386 ]]> | |
| 387 </token> | |
| 388 <token name="@CMD_PLOT_LIGAND_RECEPTOR_COMPLEX@"><![CDATA[ | |
| 389 #if str($method.ligand_complex) != '': | |
| 390 ligand_complex=[x.strip() for x in '$method.ligand_complex'.split(',')], | |
| 391 #end if | |
| 392 #if str($method.receptor_complex) != '': | |
| 393 receptor_complex=[x.strip() for x in '$method.receptor_complex'.split(',')], | |
| 394 #end if | |
| 395 ]]> | |
| 396 </token> | |
| 397 <token name="@CMD_PLOT_TOP_N_ORDERBY@"><![CDATA[ | |
| 398 #if str($method.top_n) != '': | |
| 399 top_n=$method.top_n, | |
| 400 #end if | |
| 401 #if str($method.orderby) != '': | |
| 402 orderby='$method.orderby', | |
| 403 #end if | |
| 404 orderby_ascending=$method.orderby_ascending, | |
| 405 orderby_absolute=$method.orderby_absolute, | |
| 406 ]]> | |
| 407 </token> | |
| 408 | |
| 409 <!-- command macros --> | |
| 410 <xml name="version_command"> | |
| 411 <version_command><![CDATA[python -c "import liana as li;print('liana version: %s' % li.__version__)"]]></version_command> | |
| 412 </xml> | |
| 413 <token name="@CMD_PRETTIFY_STDOUT@"><![CDATA[ | |
| 414 | sed -r '1 s|AnnData object with (.+) = (.*)\\s*|\\1: \\2|g' | sed "s|'||g" | sed -r 's|^\\s*(.*):\\s(.*)|[\\1]\\n- \\2|g' | sed 's|, |\\n- |g' | |
| 415 ]]> | |
| 416 </token> | |
| 417 <token name="@CMD_READ_INPUTS@"><![CDATA[ | |
| 418 adata = sc.read_h5ad('anndata.h5ad') | |
| 419 ]]> | |
| 420 </token> | |
| 421 <!-- Resource param block for L-R methods: interactions | resource (file) | resource (cached from DM) | resource_name (API) --> | |
| 422 <token name="@CMD_RESOURCE_FOR_METHODS@"><![CDATA[ | |
| 423 #if str($method.resource_selection.resource_type) == 'interactions': | |
| 424 interactions=[tuple(x.strip().split(',')) for x in '''$method.resource_selection.interactions'''.strip().split('\n') if x.strip()], | |
| 425 #else if str($method.resource_selection.resource_type) == 'resource': | |
| 426 resource=pd.read_csv('$method.resource_selection.resource', sep='\t'), | |
| 427 #else: | |
| 428 #if str($method.resource_selection.resource_api_cached.resource_source_selector) == 'cached': | |
| 429 resource=pd.read_csv(os.path.join('$method.resource_selection.resource_api_cached.resource_cached.fields.path', '$method.resource_selection.resource_api_cached.resource_cached.fields.value' + '.tsv'), sep='\t'), | |
| 430 #else: | |
| 431 resource_name='$method.resource_selection.resource_api_cached.resource_name', | |
| 432 #end if | |
| 433 #end if | |
| 434 ]]> | |
| 435 </token> | |
| 436 <!-- ln -s doesn't work here because the output is overwritten to the same file --> | |
| 437 <token name="@CMD@"><![CDATA[ | |
| 438 cp '$adata' 'anndata.h5ad' && | |
| 439 cat '$script_file' > '$hidden_output' && | |
| 440 python '$script_file' >> '$hidden_output' && | |
| 441 ls . >> '$hidden_output' && | |
| 442 touch 'anndata_info.txt' && | |
| 443 cat 'anndata_info.txt' @CMD_PRETTIFY_STDOUT@ | |
| 444 ]]> | |
| 445 </token> | |
| 446 <token name="@CMD_IMPORTS@"><![CDATA[ | |
| 447 import liana as li | |
| 448 import scanpy as sc | |
| 449 import pandas as pd | |
| 450 import os | |
| 451 | |
| 452 ]]> | |
| 453 </token> | |
| 454 <token name="@CMD_ANNDATA_WRITE_OUTPUTS@"><![CDATA[ | |
| 455 adata.write_h5ad('anndata.h5ad', compression='gzip') | |
| 456 with open('anndata_info.txt','w', encoding='utf-8') as ainfo: | |
| 457 print(adata, file=ainfo) | |
| 458 ]]> | |
| 459 </token> | |
| 460 </macros> |
