Mercurial > repos > goeckslab > cleaning_spatialge
comparison preprocessing.xml @ 0:c84663d92248 draft default tip
planemo upload for repository https://github.com/goeckslab/tools-st/tree/main/tools/spatialge commit 482b2e0e6ca7aaa789ba07b8cd689da9a01532ef
| author | goeckslab |
|---|---|
| date | Wed, 13 Aug 2025 19:32:05 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:c84663d92248 |
|---|---|
| 1 <tool id="cleaning_spatialGE" name="spatialGE Preprocessing" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.01"> | |
| 2 <description>Initial data preparation for downstream spatial transcriptomic analyses</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 | |
| 7 <expand macro="spatialge_requirements"/> | |
| 8 | |
| 9 <command detect_errors="aggressive"><![CDATA[ | |
| 10 | |
| 11 ##--------------------------------------------------------- | |
| 12 ## VISIUM INPUT HANDLING | |
| 13 ##--------------------------------------------------------- | |
| 14 | |
| 15 mkdir counts_dir && | |
| 16 | |
| 17 #if str($platform) == 'visium': | |
| 18 | |
| 19 ## symlinking metadata file | |
| 20 #if $visium_metadata | |
| 21 ln -s '$visium_metadata' '${visium_metadata.name}' && | |
| 22 #end if | |
| 23 | |
| 24 ## looping over each visium sample provided | |
| 25 #for $v in $visium_samples: | |
| 26 | |
| 27 ## create counts_dir with specific visium sample name | |
| 28 #set current_sample_dir = 'counts_dir/' + str($v.visium_sample_name) | |
| 29 | |
| 30 ## make directory to hold spatial subdir | |
| 31 mkdir -p '$current_sample_dir/spatial' && | |
| 32 | |
| 33 ## loop over each file in the visium file collection, if ends with .h5 separate from other files | |
| 34 #for $f in $v.visium_collection: | |
| 35 #if f.name.endswith('h5') | |
| 36 ln -s '$f' '$current_sample_dir/${f.name}' && | |
| 37 #end if | |
| 38 #end for | |
| 39 | |
| 40 ## other files in visium file collection added to spatial subdir | |
| 41 #for $f in $v.visium_collection: | |
| 42 #if f.name.endswith('png') or f.name.endswith('csv') or f.name.endswith('json') | |
| 43 ln -s '$f' '$current_sample_dir/spatial/${f.name}' && | |
| 44 #end if | |
| 45 #end for | |
| 46 | |
| 47 #end for | |
| 48 | |
| 49 Rscript '$__tool_directory__/spatialGE_multiple_input.R' | |
| 50 | |
| 51 ## counts will now maintain .h5 and spatial subdir structure | |
| 52 --counts counts_dir | |
| 53 | |
| 54 --meta '${visium_metadata.name}' | |
| 55 | |
| 56 #if str($distribution_plots.plot) == 'raw_plot': | |
| 57 --distplot | |
| 58 --plotmeta '${distribution_plots.plotmeta}' | |
| 59 #if $distribution_plots.samples | |
| 60 --samples '${distribution_plots.samples}' | |
| 61 #end if | |
| 62 #end if | |
| 63 | |
| 64 #if str($spot_filtering.filter) == 'filter': | |
| 65 --filter | |
| 66 #if $spot_filtering.spot_min_reads | |
| 67 --sminreads '${spot_filtering.spot_min_reads}' | |
| 68 #end if | |
| 69 #if $spot_filtering.spot_max_reads | |
| 70 --smaxreads '${spot_filtering.spot_max_reads}' | |
| 71 #end if | |
| 72 #if $spot_filtering.spot_min_genes | |
| 73 --smingenes '${spot_filtering.spot_min_genes}' | |
| 74 #end if | |
| 75 #if $spot_filtering.spot_max_genes | |
| 76 --smaxgenes '${spot_filtering.spot_max_genes}' | |
| 77 #end if | |
| 78 #if $spot_filtering.gene_min_reads | |
| 79 --gminreads '${spot_filtering.gene_min_reads}' | |
| 80 #end if | |
| 81 #if $spot_filtering.gene_max_reads | |
| 82 --gmaxreads '${spot_filtering.gene_max_reads}' | |
| 83 #end if | |
| 84 #if $spot_filtering.gene_min_spots | |
| 85 --gminspots '${spot_filtering.gene_min_spots}' | |
| 86 #end if | |
| 87 #if $spot_filtering.gene_max_spots | |
| 88 --gmaxspots '${spot_filtering.gene_max_spots}' | |
| 89 #end if | |
| 90 #end if | |
| 91 | |
| 92 #if str($filtered_distribution_plots.plot) == 'filtered_plot': | |
| 93 --filterplot | |
| 94 --plotmeta '${filtered_distribution_plots.plotmeta}' | |
| 95 #if $filtered_distribution_plots.samples | |
| 96 --samples '${filtered_distribution_plots.samples}' | |
| 97 #end if | |
| 98 #end if | |
| 99 | |
| 100 --type '$transformation'; | |
| 101 | |
| 102 #end if | |
| 103 | |
| 104 ##------------------------------------------- | |
| 105 ## SINGLE COSMX INPUT HANDLING | |
| 106 ##------------------------------------------- | |
| 107 | |
| 108 #if str($platform) == 'cosmx' and str($cosmx_file_quantity) == 'single_cosmx_input': | |
| 109 | |
| 110 ## symlink counts and coords files | |
| 111 ln -s '$single_cosmx_counts' '${single_cosmx_counts.name}' && | |
| 112 ln -s '$single_cosmx_spotcoords' '${single_cosmx_spotcoords.name}' && | |
| 113 | |
| 114 Rscript '$__tool_directory__/spatialGE_single_input.R' | |
| 115 | |
| 116 #if $single_cosmx_counts | |
| 117 --counts '${single_cosmx_counts.name}' | |
| 118 #end if | |
| 119 | |
| 120 #if $single_cosmx_spotcoords | |
| 121 --spots '${single_cosmx_spotcoords.name}' | |
| 122 #end if | |
| 123 | |
| 124 --names '$cosmx_sample_names' | |
| 125 | |
| 126 #if str($distribution_plots.plot) == 'raw_plot': | |
| 127 --distplot | |
| 128 --plotmeta '${distribution_plots.plotmeta}' | |
| 129 #if $distribution_plots.samples | |
| 130 --samples '${distribution_plots.samples}' | |
| 131 #end if | |
| 132 #end if | |
| 133 | |
| 134 #if str($spot_filtering.filter) == 'filter': | |
| 135 --filter | |
| 136 #if $spot_filtering.spot_min_reads | |
| 137 --sminreads '${spot_filtering.spot_min_reads}' | |
| 138 #end if | |
| 139 #if $spot_filtering.spot_max_reads | |
| 140 --smaxreads '${spot_filtering.spot_max_reads}' | |
| 141 #end if | |
| 142 #if $spot_filtering.spot_min_genes | |
| 143 --smingenes '${spot_filtering.spot_min_genes}' | |
| 144 #end if | |
| 145 #if $spot_filtering.spot_max_genes | |
| 146 --smaxgenes '${spot_filtering.spot_max_genes}' | |
| 147 #end if | |
| 148 #if $spot_filtering.gene_min_reads | |
| 149 --gminreads '${spot_filtering.gene_min_reads}' | |
| 150 #end if | |
| 151 #if $spot_filtering.gene_max_reads | |
| 152 --gmaxreads '${spot_filtering.gene_max_reads}' | |
| 153 #end if | |
| 154 #if $spot_filtering.gene_min_spots | |
| 155 --gminspots '${spot_filtering.gene_min_spots}' | |
| 156 #end if | |
| 157 #if $spot_filtering.gene_max_spots | |
| 158 --gmaxspots '${spot_filtering.gene_max_spots}' | |
| 159 #end if | |
| 160 #end if | |
| 161 | |
| 162 #if str($filtered_distribution_plots.plot) == 'filtered_plot': | |
| 163 --filterplot | |
| 164 --plotmeta '${filtered_distribution_plots.plotmeta}' | |
| 165 #if $filtered_distribution_plots.samples | |
| 166 --samples '${filtered_distribution_plots.samples}' | |
| 167 #end if | |
| 168 #end if | |
| 169 | |
| 170 --type '$transformation' | |
| 171 | |
| 172 #end if | |
| 173 | |
| 174 ##--------------------------------------------------------- | |
| 175 ## MULTIPLE COSMX INPUT HANDLING | |
| 176 ##--------------------------------------------------------- | |
| 177 | |
| 178 #if str($platform) == 'cosmx' and str($cosmx_file_quantity) == 'multiple_cosmx_input': | |
| 179 | |
| 180 mkdir coords_dir && | |
| 181 | |
| 182 ## loop over each count and coord file, and symlink | |
| 183 #if str($cosmx_file_selection.cosmx_file_quantity) == 'multiple_cosmx_input': | |
| 184 #for $cf in $multiple_cosmx_counts: | |
| 185 ln -s '$cf' counts_dir/'${cf.name}' && | |
| 186 #end for | |
| 187 #for $sc in $multiple_cosmx_spotcoords: | |
| 188 ln -s '$sc' coords_dir/'${sc.name}' && | |
| 189 #end for | |
| 190 #end if | |
| 191 | |
| 192 Rscript '$__tool_directory__/spatialGE_multiple_input.R' | |
| 193 | |
| 194 #if $cosmx_file_selection.multiple_cosmx_counts | |
| 195 --counts counts_dir/ | |
| 196 #end if | |
| 197 | |
| 198 #if $cosmx_file_selection.multiple_cosmx_spotcoords | |
| 199 --spots coords_dir/ | |
| 200 #end if | |
| 201 | |
| 202 #if $cosmx_sample_names | |
| 203 --names '${cosmx_sample_names}' | |
| 204 #end if | |
| 205 | |
| 206 #if str($distribution_plots.plot) == 'raw_plot': | |
| 207 --distplot | |
| 208 --plotmeta '${distribution_plots.plotmeta}' | |
| 209 #if $distribution_plots.samples | |
| 210 --samples '${distribution_plots.samples}' | |
| 211 #end if | |
| 212 #end if | |
| 213 | |
| 214 #if str($spot_filtering.filter) == 'filter': | |
| 215 --filter | |
| 216 #if $spot_filtering.spot_min_reads | |
| 217 --sminreads '${spot_filtering.spot_min_reads}' | |
| 218 #end if | |
| 219 #if $spot_filtering.spot_max_reads | |
| 220 --smaxreads '${spot_filtering.spot_max_reads}' | |
| 221 #end if | |
| 222 #if $spot_filtering.spot_min_genes | |
| 223 --smingenes '${spot_filtering.spot_min_genes}' | |
| 224 #end if | |
| 225 #if $spot_filtering.spot_max_genes | |
| 226 --smaxgenes '${spot_filtering.spot_max_genes}' | |
| 227 #end if | |
| 228 #if $spot_filtering.gene_min_reads | |
| 229 --gminreads '${spot_filtering.gene_min_reads}' | |
| 230 #end if | |
| 231 #if $spot_filtering.gene_max_reads | |
| 232 --gmaxreads '${spot_filtering.gene_max_reads}' | |
| 233 #end if | |
| 234 #if $spot_filtering.gene_min_spots | |
| 235 --gminspots '${spot_filtering.gene_min_spots}' | |
| 236 #end if | |
| 237 #if $spot_filtering.gene_max_spots | |
| 238 --gmaxspots '${spot_filtering.gene_max_spots}' | |
| 239 #end if | |
| 240 #end if | |
| 241 | |
| 242 #if str($filtered_distribution_plots.plot) == 'filtered_plot': | |
| 243 --filterplot | |
| 244 --plotmeta '${filtered_distribution_plots.plotmeta}' | |
| 245 #if $filtered_distribution_plots.samples | |
| 246 --samples '${filtered_distribution_plots.samples}' | |
| 247 #end if | |
| 248 #end if | |
| 249 | |
| 250 --type '$transformation' | |
| 251 | |
| 252 #end if | |
| 253 | |
| 254 ##--------------------------------------------------------- | |
| 255 ## SINGLE RAW INPUT HANDLING | |
| 256 ##--------------------------------------------------------- | |
| 257 | |
| 258 #if str($platform) == 'raw_data' and str($raw_file_selection.raw_file_quantity) == 'single_raw_input': | |
| 259 | |
| 260 ## symlink count, coord, and metadata files | |
| 261 ln -s '$single_raw_counts' '${single_raw_counts.name}' && | |
| 262 ln -s '$single_raw_spotcoords' '${single_raw_spotcoords.name}' && | |
| 263 ln -s '$raw_metadata' '${raw_metadata.name}' && | |
| 264 | |
| 265 Rscript '$__tool_directory__/spatialGE_single_input.R' | |
| 266 | |
| 267 #if $single_raw_counts | |
| 268 --counts '${single_raw_counts.name}' | |
| 269 #end if | |
| 270 | |
| 271 #if $single_raw_spotcoords | |
| 272 --spots '${single_raw_spotcoords.name}' | |
| 273 #end if | |
| 274 | |
| 275 #if $raw_metadata | |
| 276 --meta '${raw_metadata.name}' | |
| 277 #end if | |
| 278 | |
| 279 #if str($distribution_plots.plot) == 'raw_plot': | |
| 280 --distplot | |
| 281 --plotmeta '${distribution_plots.plotmeta}' | |
| 282 #if $distribution_plots.samples | |
| 283 --samples '${distribution_plots.samples}' | |
| 284 #end if | |
| 285 #end if | |
| 286 | |
| 287 #if str($spot_filtering.filter) == 'filter': | |
| 288 --filter | |
| 289 #if $spot_filtering.spot_min_reads | |
| 290 --sminreads '${spot_filtering.spot_min_reads}' | |
| 291 #end if | |
| 292 #if $spot_filtering.spot_max_reads | |
| 293 --smaxreads '${spot_filtering.spot_max_reads}' | |
| 294 #end if | |
| 295 #if $spot_filtering.spot_min_genes | |
| 296 --smingenes '${spot_filtering.spot_min_genes}' | |
| 297 #end if | |
| 298 #if $spot_filtering.spot_max_genes | |
| 299 --smaxgenes '${spot_filtering.spot_max_genes}' | |
| 300 #end if | |
| 301 #if $spot_filtering.gene_min_reads | |
| 302 --gminreads '${spot_filtering.gene_min_reads}' | |
| 303 #end if | |
| 304 #if $spot_filtering.gene_max_reads | |
| 305 --gmaxreads '${spot_filtering.gene_max_reads}' | |
| 306 #end if | |
| 307 #if $spot_filtering.gene_min_spots | |
| 308 --gminspots '${spot_filtering.gene_min_spots}' | |
| 309 #end if | |
| 310 #if $spot_filtering.gene_max_spots | |
| 311 --gmaxspots '${spot_filtering.gene_max_spots}' | |
| 312 #end if | |
| 313 #end if | |
| 314 | |
| 315 #if str($filtered_distribution_plots.plot) == 'filtered_plot': | |
| 316 --filterplot | |
| 317 --plotmeta '${filtered_distribution_plots.plotmeta}' | |
| 318 #if $filtered_distribution_plots.samples | |
| 319 --samples '${filtered_distribution_plots.samples}' | |
| 320 #end if | |
| 321 #end if | |
| 322 | |
| 323 --type '$transformation' | |
| 324 | |
| 325 #end if | |
| 326 | |
| 327 ##--------------------------------------------------------- | |
| 328 ## MULTIPLE RAW INPUT HANDLING | |
| 329 ##--------------------------------------------------------- | |
| 330 | |
| 331 #if str($platform) == 'raw_data' and str($raw_file_selection.raw_file_quantity) == 'multiple_raw_input': | |
| 332 | |
| 333 mkdir coords_dir && | |
| 334 | |
| 335 ## loop over each count and coord file, and symlink | |
| 336 #if str($raw_file_selection.raw_file_quantity) == 'multiple_raw_input': | |
| 337 #for $cf in $multiple_raw_counts: | |
| 338 ln -s '$cf' counts_dir/'${cf.name}' && | |
| 339 #end for | |
| 340 #for $sc in $multiple_raw_spotcoords: | |
| 341 ln -s '$sc' coords_dir/'${sc.name}' && | |
| 342 #end for | |
| 343 #end if | |
| 344 | |
| 345 ln -s '$raw_metadata' '${raw_metadata.name}' && | |
| 346 | |
| 347 Rscript '$__tool_directory__/spatialGE_multiple_input.R' | |
| 348 | |
| 349 #if $raw_file_selection.multiple_raw_counts | |
| 350 --counts counts_dir/ | |
| 351 #end if | |
| 352 | |
| 353 #if $raw_file_selection.multiple_raw_spotcoords | |
| 354 --spots coords_dir/ | |
| 355 #end if | |
| 356 | |
| 357 #if $raw_metadata | |
| 358 --meta '${raw_metadata.name}' | |
| 359 #end if | |
| 360 | |
| 361 #if str($distribution_plots.plot) == 'raw_plot': | |
| 362 --distplot | |
| 363 --plotmeta '${distribution_plots.plotmeta}' | |
| 364 #if $distribution_plots.samples | |
| 365 --samples '${distribution_plots.samples}' | |
| 366 #end if | |
| 367 #end if | |
| 368 | |
| 369 #if str($spot_filtering.filter) == 'filter': | |
| 370 --filter | |
| 371 #if $spot_filtering.spot_min_reads | |
| 372 --sminreads '${spot_filtering.spot_min_reads}' | |
| 373 #end if | |
| 374 #if $spot_filtering.spot_max_reads | |
| 375 --smaxreads '${spot_filtering.spot_max_reads}' | |
| 376 #end if | |
| 377 #if $spot_filtering.spot_min_genes | |
| 378 --smingenes '${spot_filtering.spot_min_genes}' | |
| 379 #end if | |
| 380 #if $spot_filtering.spot_max_genes | |
| 381 --smaxgenes '${spot_filtering.spot_max_genes}' | |
| 382 #end if | |
| 383 #if $spot_filtering.gene_min_reads | |
| 384 --gminreads '${spot_filtering.gene_min_reads}' | |
| 385 #end if | |
| 386 #if $spot_filtering.gene_max_reads | |
| 387 --gmaxreads '${spot_filtering.gene_max_reads}' | |
| 388 #end if | |
| 389 #if $spot_filtering.gene_min_spots | |
| 390 --gminspots '${spot_filtering.gene_min_spots}' | |
| 391 #end if | |
| 392 #if $spot_filtering.gene_max_spots | |
| 393 --gmaxspots '${spot_filtering.gene_max_spots}' | |
| 394 #end if | |
| 395 #end if | |
| 396 | |
| 397 #if str($filtered_distribution_plots.plot) == 'filtered_plot': | |
| 398 --filterplot | |
| 399 --plotmeta '${filtered_distribution_plots.plotmeta}' | |
| 400 #if $filtered_distribution_plots.samples | |
| 401 --samples '${filtered_distribution_plots.samples}' | |
| 402 #end if | |
| 403 #end if | |
| 404 | |
| 405 --type '$transformation' | |
| 406 | |
| 407 #end if | |
| 408 | |
| 409 ]]></command> | |
| 410 <inputs> | |
| 411 <conditional name="platform_type"> | |
| 412 <param name="platform" type="select" label="Select Input Type" > | |
| 413 <option value="visium">Visium</option> | |
| 414 <option value="cosmx">CosMX-SMI</option> | |
| 415 <option value="raw_data">Raw Counts and Coordinates</option> | |
| 416 </param> | |
| 417 <when value="visium"> | |
| 418 <repeat name="visium_samples" title="Visium Sample" min="1"> | |
| 419 <param name="visium_sample_name" type="text" optional="false" label="Sample Name (sample ID/name in metadata file)" /> | |
| 420 <param name="visium_collection" type="data_collection" multiple="true" label="Visium Files (h5, png, json, csv)" /> | |
| 421 </repeat> | |
| 422 <param name="visium_metadata" type="data" format="csv,tsv" label="Metadata" /> | |
| 423 </when> | |
| 424 <when value="cosmx"> | |
| 425 <conditional name="cosmx_file_selection"> | |
| 426 <param name="cosmx_file_quantity" type="select" label="Choose Input Quantity" > | |
| 427 <option value="single_cosmx_input">Single Sample Input</option> | |
| 428 <option value="multiple_cosmx_input">Multiple Sample Input</option> | |
| 429 </param> | |
| 430 <when value="single_cosmx_input"> | |
| 431 <param name="single_cosmx_counts" type="data" format="csv,tsv" label="Expression Matrix" /> | |
| 432 <param name="single_cosmx_spotcoords" type="data" format="csv,tsv" label="Metadata File" /> | |
| 433 </when> | |
| 434 <when value="multiple_cosmx_input"> | |
| 435 <param name="multiple_cosmx_counts" type="data_collection" format="csv,tsv" label="Collection of Expression Matrices (one file per sample)" /> | |
| 436 <param name="multiple_cosmx_spotcoords" type="data_collection" format="csv,tsv" label="Collection of Metadata Files (one file per sample)" /> | |
| 437 </when> | |
| 438 </conditional> | |
| 439 <param name="cosmx_sample_names" type="text" optional="false" label="Sample Name(s)" /> | |
| 440 </when> | |
| 441 <when value="raw_data"> | |
| 442 <conditional name="raw_file_selection"> | |
| 443 <param name="raw_file_quantity" type="select" label="Choose Input Quantity" > | |
| 444 <option value="single_raw_input">Single Sample Input</option> | |
| 445 <option value="multiple_raw_input">Multiple Sample Input</option> | |
| 446 </param> | |
| 447 <when value="single_raw_input"> | |
| 448 <param name="single_raw_counts" type="data" format="csv,tsv" label="Counts" /> | |
| 449 <param name="single_raw_spotcoords" type="data" format="csv,tsv" label="Spot Coordinates" /> | |
| 450 </when> | |
| 451 <when value="multiple_raw_input"> | |
| 452 <param name="multiple_raw_counts" type="data_collection" format="csv,tsv" label="Collection of Counts Files (one per sample)" /> | |
| 453 <param name="multiple_raw_spotcoords" type="data_collection" format="csv,tsv" label="Collection of spot coord files (one per sample)" /> | |
| 454 </when> | |
| 455 </conditional> | |
| 456 <param name="raw_metadata" type="data" format="csv,tsv" label="Metadata" /> | |
| 457 </when> | |
| 458 </conditional> | |
| 459 <conditional name="distribution_plots"> | |
| 460 <param name="plot" type="select" label="Optional: Generate Distribution Plot of Raw Data" > | |
| 461 <option value="no_plot" selected="true">Do not generate distribution plot</option> | |
| 462 <option value="raw_plot">Generate distribution plot</option> | |
| 463 </param> | |
| 464 <when value="no_plot"> | |
| 465 </when> | |
| 466 <when value="raw_plot"> | |
| 467 <param name="plotmeta" type="select" label="Plot counts per cell or genes per cell" > | |
| 468 <option value="total_counts">Total counts</option> | |
| 469 <option value="total_genes">Total genes</option> | |
| 470 </param> | |
| 471 <param name="samples" type="text" optional="true" label="Optional subset of samples for distribution plotting (defaults to all)" /> | |
| 472 </when> | |
| 473 </conditional> | |
| 474 <conditional name="spot_filtering"> | |
| 475 <param name="filter" type="select" label="Optional: Perform Quality Control with Spot Filtering"> | |
| 476 <option value="no_filter" selected="true">Do not perform filtering</option> | |
| 477 <option value="filter">Filter spots/cells</option> | |
| 478 </param> | |
| 479 <when value="no_filter"> | |
| 480 </when> | |
| 481 <when value="filter"> | |
| 482 <param name="spot_min_reads" type="integer" min="0" optional="true" label="Minimum number of total reads for a spot to be retained" /> | |
| 483 <param name="spot_max_reads" type="integer" min="0" optional="true" label="Maximum number of total reads for a spot to be retained" /> | |
| 484 <param name="spot_min_genes" type="integer" min="0" optional="true" label="Minimum number of genes expressed in a spot" /> | |
| 485 <param name="spot_max_genes" type="integer" min="0" optional="true" label="Maximum number of genes expressed in a spot" /> | |
| 486 <param name="gene_min_reads" type="integer" min="0" optional="true" label="Minimum number of total reads for a gene to be retained" /> | |
| 487 <param name="gene_max_reads" type="integer" min="0" optional="true" label="Maximum number of total reads for a gene to be retained" /> | |
| 488 <param name="gene_min_spots" type="integer" min="0" optional="true" label="Minimum number of spots present in a gene" /> | |
| 489 <param name="gene_max_spots" type="integer" min="0" optional="true" label="Maximum number of spots present in a gene" /> | |
| 490 </when> | |
| 491 </conditional> | |
| 492 <conditional name="filtered_distribution_plots"> | |
| 493 <param name="plot" type="select" label="Optional: Generate Distribution Plot of Filtered Data" > | |
| 494 <option value="no_plot" selected="true">Do not generate distribution plot</option> | |
| 495 <option value="filtered_plot">Generate distribution plot</option> | |
| 496 </param> | |
| 497 <when value="no_plot"> | |
| 498 </when> | |
| 499 <when value="filtered_plot"> | |
| 500 <param name="plotmeta" type="select" label="Plot counts per cell or genes per cell" > | |
| 501 <option value="total_counts">Total counts</option> | |
| 502 <option value="total_genes">Total genes</option> | |
| 503 </param> | |
| 504 <param name="samples" type="text" optional="true" label="Optional subset of samples for distribution plotting (defaults to all)" /> | |
| 505 </when> | |
| 506 </conditional> | |
| 507 <param name="transformation" type="select" label="Data Transformation" > | |
| 508 <option value="log" selected="true">log</option> | |
| 509 <option value="sct">sct</option> | |
| 510 </param> | |
| 511 </inputs> | |
| 512 <outputs> | |
| 513 <collection name="raw_distribution_plot" type="list" label="Raw Data Distribution Plot"> | |
| 514 <discover_datasets pattern="__name_and_ext__" directory="./unfiltered_distribution_plots" ext="png" /> | |
| 515 <filter>distribution_plots['plot'] == "raw_plot"</filter> | |
| 516 </collection> | |
| 517 <collection name="filtered_dist_plot" type="list" label="Filtered Data Distribution Plot"> | |
| 518 <discover_datasets pattern="__name_and_ext__" directory="./filtered_distribution_plots" ext="png" /> | |
| 519 <filter>filtered_distribution_plots['plot'] == "filtered_plot"</filter> | |
| 520 </collection> | |
| 521 <data name="STlist_obj" format="rds" label="STlist.rds" from_work_dir="STobj.rds"> | |
| 522 </data> | |
| 523 </outputs> | |
| 524 <tests> | |
| 525 <test expect_num_outputs="1"> | |
| 526 <conditional name="platform_type"> | |
| 527 <param name="platform" value="raw_data" /> | |
| 528 <conditional name="raw_file_selection"> | |
| 529 <param name="raw_file_quantity" value="single_raw_input" /> | |
| 530 <param name="single_raw_counts" value="ST_mel3_rep1_counts.tsv" /> | |
| 531 <param name="single_raw_spotcoords" value="ST_mel3_rep1_mapping.tsv" /> | |
| 532 </conditional> | |
| 533 <param name="raw_metadata" ftype="csv" value="thrane_clinical.csv" /> | |
| 534 </conditional> | |
| 535 <output name="STlist_obj" file="STobj_raw.rds" compare="sim_size"> | |
| 536 </output> | |
| 537 </test> | |
| 538 <test expect_num_outputs="2"> | |
| 539 <conditional name="platform_type"> | |
| 540 <param name="platform" value="raw_data" /> | |
| 541 <conditional name="raw_file_selection"> | |
| 542 <param name="raw_file_quantity" value="single_raw_input" /> | |
| 543 <param name="single_raw_counts" value="ST_mel3_rep1_counts.tsv" /> | |
| 544 <param name="single_raw_spotcoords" value="ST_mel3_rep1_mapping.tsv" /> | |
| 545 </conditional> | |
| 546 <param name="raw_metadata" ftype="csv" value="thrane_clinical.csv" /> | |
| 547 </conditional> | |
| 548 <conditional name="distribution_plots"> | |
| 549 <param name="plot" value="raw_plot" /> | |
| 550 <param name="plotmeta" value="total_counts" /> | |
| 551 </conditional> | |
| 552 <output name="STlist_obj" file="STobj_raw.rds" compare="sim_size"> | |
| 553 </output> | |
| 554 <output_collection name="raw_distribution_plot"> | |
| 555 <element name="unfiltered_ST_mel3_rep1_counts" file="unfiltered_ST_mel3_rep1_counts.png" compare="sim_size" /> | |
| 556 </output_collection> | |
| 557 </test> | |
| 558 <test expect_num_outputs="3"> | |
| 559 <conditional name="platform_type"> | |
| 560 <param name="platform" value="raw_data" /> | |
| 561 <conditional name="raw_file_selection"> | |
| 562 <param name="raw_file_quantity" value="single_raw_input" /> | |
| 563 <param name="single_raw_counts" value="ST_mel3_rep1_counts.tsv" /> | |
| 564 <param name="single_raw_spotcoords" value="ST_mel3_rep1_mapping.tsv" /> | |
| 565 </conditional> | |
| 566 <param name="raw_metadata" ftype="csv" value="thrane_clinical.csv" /> | |
| 567 </conditional> | |
| 568 <conditional name="distribution_plots"> | |
| 569 <param name="plot" value="raw_plot" /> | |
| 570 <param name="plotmeta" value="total_counts" /> | |
| 571 </conditional> | |
| 572 <conditional name="spot_filtering"> | |
| 573 <param name="filter" value="filter" /> | |
| 574 <param name="spot_min_reads" value="2000" /> | |
| 575 </conditional> | |
| 576 <conditional name="filtered_distribution_plots"> | |
| 577 <param name="plot" value="filtered_plot" /> | |
| 578 <param name="plotmeta" value="total_counts" /> | |
| 579 </conditional> | |
| 580 <output name="STlist_obj" file="STobj_filtered.rds" compare="sim_size"> | |
| 581 </output> | |
| 582 <output_collection name="raw_distribution_plot"> | |
| 583 <element name="unfiltered_ST_mel3_rep1_counts" file="unfiltered_ST_mel3_rep1_counts.png" compare="sim_size" /> | |
| 584 </output_collection> | |
| 585 <output_collection name="filtered_dist_plot"> | |
| 586 <element name="filtered_ST_mel3_rep1_counts" file="filtered_ST_mel3_rep1_counts.png" compare="sim_size" /> | |
| 587 </output_collection> | |
| 588 </test> | |
| 589 </tests> | |
| 590 <help> | |
| 591 <![CDATA[ | |
| 592 **What it does** | |
| 593 | |
| 594 spatialGE is a tool designed for the analysis and visualization of spatially-resolved transcriptomics data. | |
| 595 | |
| 596 spatialGE Preprocessing is built for data reorganization and filtering with exploratory analysis. Input data will be | |
| 597 transformed into an `STlist` object for downstream spatialGE analyses. Optional quality control can be performed by filtering spots/cells | |
| 598 and genes to specific quanitities. Distribution plots of either total counts or total genes can be produced for both raw and filtered data. | |
| 599 Data transformation will prepare the data for later analysis. | |
| 600 | |
| 601 **Input** | |
| 602 | |
| 603 Visium: | |
| 604 | |
| 605 - Sample Name: Name of Visium sample(s) that matches a sample ID in the associated metadata file. | |
| 606 | |
| 607 - Visium Files: All file outputs from `spaceranger count`, must include .h5 file and .csv file from `spatial` subdirectory, and optionally including the .png and .json files (one group of files per sample). For multiple samples, select option "Insert Visium Sample". | |
| 608 | |
| 609 - Metadata: Metadata file including sample ID/names for all input samples. | |
| 610 | |
| 611 CosMX-SMI: | |
| 612 | |
| 613 - Expression Matrix: `exprMat` file from CosMX-SMI output. If running multiple sample input, upload collection of `exprMat` files, one file per sample. | |
| 614 | |
| 615 - Metadata: `metadata` file from CosMX-SMI output. If running multiple sample input, upload collection of `metadata` files, one file per sample. | |
| 616 | |
| 617 - Sample Names: Sample name associated with CosMX-SMI output. If running multiple sample input, create a comma-separated list of sample names with one unique name per sample. | |
| 618 | |
| 619 Raw Data: | |
| 620 | |
| 621 - Counts: Raw count data file(s). If running multiple sample input, upload collection of files, one file per sample. | |
| 622 | |
| 623 - Spot Coordinates: Raw coordinate file(s). If running multiple sample input, upload collection of files, one file per sample. | |
| 624 | |
| 625 - Metadata: Metadata file associated with sample(s). | |
| 626 | |
| 627 | |
| 628 **Run modes** | |
| 629 | |
| 630 Optional: Generate Distribution Plot of Raw Data | |
| 631 | |
| 632 - Display violin distribution plot of samples | |
| 633 | |
| 634 - Choose between plotting either total counts per spot/cell or total genes per spot/cell | |
| 635 | |
| 636 - Can manually enter specific sample names to subset plot (will automatically plot all provided samples) | |
| 637 | |
| 638 Optional: Perform Quality Control with Spot Filtering | |
| 639 | |
| 640 - Perform quality control by filtering spots/cells | |
| 641 | |
| 642 - Optional input for all filtering parameters, can provide quanitity for one to all parameters | |
| 643 | |
| 644 - Specifying minimum and maximum spots/cells and/or genes will restrict the data | |
| 645 | |
| 646 Optional: Generate Distribution Plot of Filtered Data | |
| 647 | |
| 648 - Display violin distribution plot of samples after filtering data | |
| 649 | |
| 650 - Choose between plotting either total counts per spot/cell or total genes per spot/cell | |
| 651 | |
| 652 - Can manually enter specific sample names to subset plot (will automatically plot all provided samples). If sample names were specified in `Generate Distribution Plot of Raw Data`, same samples will be subset for plotting after filtering. | |
| 653 | |
| 654 **Outputs** | |
| 655 | |
| 656 - STlist Object RDS: saves the STlist object as an .rds file for downstream spatialGE analyses | |
| 657 | |
| 658 - Raw Data Distribution Plot: distribution violin plot of all samples provided, displaying either total counts or total genes | |
| 659 | |
| 660 - Filtered Data Distribution Plot: similar to raw data distribution plot, displaying distribution after quality control filtering | |
| 661 | |
| 662 ]]> | |
| 663 </help> | |
| 664 <expand macro="citations"/> | |
| 665 </tool> |
