Skip to content

Command line

Eighteen scimappro modules ship an argparse front end, so an analysis step can be run from a shell script or a workflow manager without writing Python.

There are no console entry pointspyproject.toml declares no [project.scripts] — so each one is invoked with python -m and its module path, which is not always the same as the function name.

python -m scimappro.tl.spatial_distance \
    --data analysis.h5ad \
    --phenotype phenotype \
    --outputDir results

Available commands

Module path Function
scimappro.pp.mcmicro_to_scimap pp.mcmicro_to_scimap
scimappro.pp.rescale pp.rescale
scimappro.pp.log1p pp.log1p
scimappro.pp.combat pp.combat
scimappro.tl.phenotype tl.phenotype
scimappro.tl.cluster tl.cluster
scimappro.tl.umap tl.umap
scimappro.tl.foldChange tl.foldChange
scimappro.tl.spatial_distance tl.spatialDistance
scimappro.tl.spatial_cooccurrence tl.spatialCooccurrence
scimappro.tl.spatial_aggregate tl.spatialAggregate
scimappro.tl.spatialProximityScore tl.spatialProximityScore
scimappro.tl.spatialSimilarityLookup tl.spatialSimilarityLookup
scimappro.tl.neighCount tl.neighCount
scimappro.tl.neighExp tl.neighExp
scimappro.tl.neighLDA tl.neighLDA
scimappro.tl.neighNMF tl.neighNMF
scimappro.pl.barplot pl.barplot

Every one of them prints its full option list with --help:

python -m scimappro.tl.phenotype --help

Shared conventions

Flag Meaning
--data PATH The .h5ad file or .zarr store to work on. --adata is accepted as an alias for scripts carried over from scimap.
--sdataTable NAME Which table to use when --data is a .zarr SpatialData store.
--outputDir DIR Where to write the result. Omit it and the input file is updated in place.
--streamData A flag, not a value. Runs the step out of core — see Streaming.
--verbose A flag. Off by default on the command line, unlike the Python API where verbose=True is usually the default.
--label NAME The obs/uns/layers key to write results under.
--maxWorkers N Caps parallelism.

Flag names match the Python parameter names exactly, camelCase and all, so imageId= in Python is --imageId on the command line.

A pipeline in bash

#!/usr/bin/env bash
set -euo pipefail

H5AD=big.h5ad

python -m scimappro.pp.rescale             --data "$H5AD" --gate manual_gates.csv --streamData
python -m scimappro.tl.phenotype           --data "$H5AD" --phenotype phenotype_workflow.csv --streamData
python -m scimappro.tl.spatial_distance    --data "$H5AD" --phenotype phenotype --streamData
python -m scimappro.tl.spatial_cooccurrence --data "$H5AD" --phenotype phenotype --streamData

Each step edits big.h5ad in place, so there are no intermediate files to manage.

Module names use the old spelling in a few places

spatial_distance, spatial_cooccurrence, and spatial_aggregate kept their snake_case module filenames from the port even though the functions they export are spatialDistance, spatialCooccurrence, and spatialAggregate. The table above is the authoritative mapping.