# HG changeset patch # User iuc # Date 1773501368 0 # Node ID 1f6c780a263588f6ca2588c6012b9a7fedbd2505 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/spatialdata commit 87bff76d897c5a4277d9987cf26432a18e0458cd-dirty diff -r 000000000000 -r 1f6c780a2635 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sat Mar 14 15:16:08 2026 +0000 @@ -0,0 +1,442 @@ + + 0.7.2 + 0 + 25.0 + + + spatialdata + spatialdata-io + spatialdata-plot + + ome-zarr + + anndata + pandas + rioxarray + zip + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.1038/s41592-024-02212-x + + + \ No newline at end of file diff -r 000000000000 -r 1f6c780a2635 spatialdata_io.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spatialdata_io.xml Sat Mar 14 15:16:08 2026 +0000 @@ -0,0 +1,927 @@ + + load common spatial omics formats into SpatialData + + macros.xml + + + + + + +#if $method_condi.method == 'cosmx': +from spatialdata_io import cosmx +spdata = cosmx(path="./", + dataset_id="$method_condi.dataset_id", + transcripts=$method_condi.transcripts_bool, + ) + +#else if $method_condi.method == 'curio': +from spatialdata_io import curio +spdata = curio(path="./input" + ) + +#else if $method_condi.method == 'dbit': +from spatialdata_io import dbit +spdata = dbit(path="./", + anndata_path="${method_condi.dataset_id}_counts.h5ad", + barcode_position="${method_condi.dataset_id}_barcode_positions.tabular", + image_path="${method_condi.dataset_id}_tissue_lowres.png", + dataset_id="$method_condi.dataset_id", + border=$method_condi.border, + border_scale=$method_condi.border_scale, + ) + +#else if $method_condi.method == 'macsima': +from spatialdata_io import macsima +spdata = macsima(path="./input", + parsing_style="auto", + #if $method_condi.subset: + subset=$method_condi.subset, + #end if + #if $method_condi.subset_c: + subset_c=$method_condi.subset_c, + #end if + max_chunk_size=$method_condi.max_chunk_size, + c_chunks_size=$method_condi.c_chunks_size, + multiscale=$method_condi.multiscale_bool, + transformations=$method_condi.transformations_bool, + #if str($method_condi.scale_factors) != '': + #set scale_factors_list = [int(x.strip()) for x in str($method_condi.scale_factors).split(',')] + scale_factors=$scale_factors_list, + #end if + nuclei_channel_name="$method_condi.nuclei_channel_name", + #if str($method_condi.split_threshold_nuclei_channel) != '': + split_threshold_nuclei_channel=$method_condi.split_threshold_nuclei_channel, + #else: + split_threshold_nuclei_channel=None, + #end if + include_cycle_in_channel_name=$method_condi.include_cycle_in_channel_name_bool, + ) + +#else if $method_condi.method == 'merscope': +from spatialdata_io import merscope +spdata = merscope(path="./input/region", + vpt_outputs="./input/region/vpt_outputs", + #set z_layers_list = [int(x.strip()) for x in str($method_condi.z_layers).split(',')] + z_layers=$z_layers_list, + region_name="$method_condi.region_name", + slide_name="$method_condi.slide_name", + backend="rioxarray", + transcripts=$method_condi.transcripts_bool, + cells_boundaries=$method_condi.cells_boundaries_bool, + cells_table=$method_condi.cells_table_bool, + mosaic_images=$method_condi.mosaic_images_bool, + ) + +#else if $method_condi.method == 'visium': +from spatialdata_io import visium +spdata = visium(path="./input", + dataset_id="$method_condi.dataset_id", + #if $method_condi.matrix_bool: + counts_file='raw_feature_bc_matrix.h5', + #else: + counts_file='filtered_feature_bc_matrix.h5', + #end if + fullres_image_file='fullres_image.tif', + tissue_positions_file='tissue_positions_list.csv', + scalefactors_file='scalefactors_json.json', + var_names_make_unique=True, + ) + +#else if $method_condi.method == 'visium_hd': +from spatialdata_io import visium_hd +spdata = visium_hd(path="./input", + dataset_id="$method_condi.dataset_id", + #if $method_condi.matrix_bool: + filtered_counts_file=False, + #else: + filtered_counts_file=True, + #end if + #if str($method_condi.include_binned_condi.include_binned) == 'no': + load_segmentations_only=True, + #else: + load_segmentations_only=False, + #end if + #if str($method_condi.include_binned_condi.include_binned) == 'yes' and str($method_condi.include_binned_condi.include_nucleus_seg_condi.include_nucleus_seg) == 'yes': + load_nucleus_segmentations=True, + #else: + load_nucleus_segmentations=False, + #end if + bin_size=None, + bins_as_squares=$method_condi.bins_as_squares_bool, + annotate_table_by_labels=$method_condi.annotate_table_by_labels_bool, + #if $method_condi.images.microscope_image: + fullres_image_file="./input/microscope_image/fullres_image.tiff", + #else: + fullres_image_file=None, + #end if + #if str($method_condi.images.cytassist_image_condi.include_cytassist) == 'yes': + load_all_images=True, + #else: + load_all_images=False, + #end if + var_names_make_unique=$method_condi.var_names_make_unique_bool, + ) + +#else if $method_condi.method == 'xenium': +import os +from spatialdata_io import xenium +spdata = xenium(path="./input/region", + #if str($method_condi.cell_boundaries) != '': + cells_boundaries=True, + #else: + cells_boundaries=False, + #end if + #if str($method_condi.nucleus_boundaries) != '': + nucleus_boundaries=True, + #else: + nucleus_boundaries=False, + #end if + cells_as_circles=$method_condi.cells_as_circles_bool, + cells_labels=$method_condi.cells_labels_bool, + nucleus_labels=$method_condi.nucleus_labels_bool, + #if str($method_condi.transcripts) != '': + transcripts=True, + #else: + transcripts=False, + #end if + morphology_mip=$method_condi.morphology_mip_bool, + morphology_focus=$method_condi.morphology_focus_bool, + #if str($method_condi.add_hne_condi.add_hne) == 'yes' or str($method_condi.add_if_condi.add_if) == 'yes': + aligned_images=True, + #else: + aligned_images=False, + #end if + cells_table=$method_condi.cells_table_bool, + gex_only=$method_condi.gex_only_bool, + n_jobs=int(os.getenv("GALAXY_SLOTS")), + ) + +#if str($method_condi.add_if_condi.add_if) == 'yes_accurate': +from spatialdata_io import xenium_aligned_image +spdata["if_image"] = xenium_aligned_image( + image_path="./input/region/if_image.ome.tif", + alignment_file="./input/region/if_image_alignment.csv" +) +#else if str($method_condi.add_hne_condi.add_hne) == 'yes_accurate': +from spatialdata_io import xenium_aligned_image +spdata["he_image"] = xenium_aligned_image( + image_path="./input/region/he_image.ome.tif", + alignment_file="./input/region/he_image_alignment.csv" +) + +#end if +#end if + +print(spdata) +spdata.write("./output/spatialdata", overwrite=True) + + + + + + + + + + + + + + + + + + + + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + + + + + + + + + + + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + + + + + + + + + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + + + + + + + + + + [0-9a-zA-Z_]+ + + + + + + + + + + +
+ + + +
+
+ + + +
+ + + + + + +
+ + + +
+
+ +
+ + + +
+ + +
+
+
+
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + +
+ + +
+ + + +
+ + +
+
+ + + + + + +
+ + + + + + +
+ + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ `__ + + + ]]> + +
\ No newline at end of file