Skip to main content

Staging module for Miltenyi - MACSIMA to MCMICRO

PyPI PyPI - Python Version PyPI - License PyPI - Downloads

The tool macsima2mc stages MACSima data sets for being registered with ASHLAR in MCMICRO.

After installation the tool is executed via the command macsima2mc, which offers a CLI where the main inputs are path to the cycle folder that contains the tiles generated by the Miltenyi-MACSima platform. The cycle folder generated by the platform follows the nomenclature (N_CycleX),where N is an integer and X is the cycle number. macsima2mc reads the .tif files inside this folder and distributes them into acquisition groups. i.e tiles with common rack, well, ROI and exposure levels will be written into an ome.tiff file with the necessary metadata for registration. To be more precise two such ome.tiff files will be generated per cycle, one corresponds to the background signal and the other to the markers signal.

CLI

After installation you can print the cli arguments in your terminal by running:

macsima2mc --help

Required arguments

Argument Long name Type Description Default value
-i string/path --input Absolute path to the the parent folder of the raw tiles, i.e. the cycle folder whose name follows the pattern X_Cycle_N,where N represents the cycle number NA
-o string/path --output Absolute path to the directory in which the outputs will be saved. If the output directory doesn't exist it will be created. NA

Optional arguments

Argument Type Long name Description Default value
-rm string --reference_marker Name of the reference marker for registration 'DAPI'
-osd string --output_subdir String specifying the name of the subfolder in which the staged images will be saved. 'raw'
-ic boolean flag --illumination_correction Give this flag to apply illumination correction to all tiles, the illumination profiles are calculated with basicpy FALSE
-he boolean flag --hi_exposure_only Give this flag to extract only the set of images with the highest exposure time FALSE
-rr boolean flag --remove_reference_marker mark the removal of the reference marker ,e.g. DAPI, for all cycles except the first one FALSE
-qc boolean flag --qc_metrics measure features of contrast, intensity and sharpness of each tile in the cycle and appends them to a table FALSE
-wt boolean flag --write_table writes a table with the acquisition parameters, metadata and,if enabled, qc metrics of each tile. Table will be saved in --output/cycle_info FALSE

Installation via pip

Windows

BaSicPy(v2.0.0) is a dependency required by macsima2mc(>=v1.3.0). BaSicPy 2.0.0 requires pytorch, which is better handled by conda environments in Windows. Thus, install first pytorch in a fresh conda environment and only afterwards install macsima2mc:

# Create conda environment
conda create -n your_env  python=3.12

# Activate environment
conda activate your_env

# Install PyTorch 2.11.0+cpu via pip (using the official PyTorch index)
pip install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu

# Install your package
pip install macsima2mc

Linux/macOS

# Install your package
pip install macsima2mc

Check if pip installation was successful by printing the CLI:

macsima2mc --help

Container

Downloading a container to use the tool is also possible. Pull the container file via Docker or Singularity:

  • Docker
docker pull ghcr.io/schapirolabor/macsima2mc:v1.3.0

or

  • Singularity
singularity pull docker://ghcr.io/schapirolabor/macsima2mc:v1.3.0

Usage example

The example below shows how to run the command macsima2mc via the singularity container in a bash script. The logic of execution and CLI usage is the same for a Docker container or as pypi package.

# Give the absolute path to the container file you pulled
container_file=C:/MyLocalVolume/macsima2mc:v1.3.0.sif
# Give the absolute path to where you want your output files to be written
output_dir=C:/MyLocalVolume/output
# Path to the directory containing all the cycle folders (N_CycleX)
input_dir=C:/MyLocalVolume/ROI_01


# Loop over the absolute path of all the N_CycleX folders
for cycle in $input_dir/*Cycle*;
do
# Extract just the name of the cycle folder
cycle_folder=$(basename "$cycle")
# Execute macsima2mc with singularity using the container file (adapt accordingly if using docker or just the pip installation)
singularity exec --bind $sample:/mnt,$output_dir:/media --no-home $container_file macsima2mc -i /mnt/$cycle_folder -o /media -ic
#IF DOCKER : docker run -v $sample:/mnt -v $output_dir:/media $container_image macsima2mc -i /mnt/$cycle_folder -o /media -ic
# IF PIP PACKAGE:  macsima2mc -i $cycle -o $output_dir -ic
done

macsima2mc and ASHLAR

It is important that when you use ASHLAR to stitch and register the files produced by macsima2mc, you use the argument --flip-y in the ASHLAR CLI. This is just to account for the inverted axis orientation with which the position of the tiles in the MACSima platform are recorded.

Metadata

Release files for macsima2mc 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macsima2mc 1.3.1
File Size Uploaded
macsima2mc-1.3.1.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for macsima2mc 1.3.1
File Interpreter ABI Platform
macsima2mc-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / macsima2mc-1.3.1.tar.gz

Download URL macsima2mc-1.3.1.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a040a0c32507100009ef9d59fa4ed6c3fe2aa80911c91e012bb601a1d90ada39
BLAKE2b-256 checksum
How to use checksums
f6f78a26f3fc6dc0e4d42f5f3b301ca6184a2d82bebe281721e9a5b7efbd284b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / macsima2mc-1.3.1-py3-none-any.whl

Download URL macsima2mc-1.3.1-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfd84c77bad6c563690819b898b19a7076a5f359aaa126f3ac4ae62af777dc94
BLAKE2b-256 checksum
How to use checksums
209b3520c4c0702ade9086062a8c2d29f2035676a5ae74d7f8701e41b860823e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page