Skip to main content

Code to process merfish data

Project description

Introduction

MERMAKE processes MERFISH and smFISH imaging data by detecting local intensity maxima (puncta) in 3D image stacks. In multiplexed experiments (MERFISH), these puncta are decoded using a user-supplied codebook, while in smFISH mode, the puncta are simply called and reported as-is.

To install MERMAKE,

python3 -m pip install mermake

❗The newest version of mermake (>= 0.0.61) does drift but requires the nightly release of cupy available via:

pip install --pre cupy-cuda12x==14.0.0a1 -f https://pip.cupy.dev/pre

⚠️ GPU Requirements & CUDA Toolkit

MERMAKE relies on CuPy for GPU-accelerated image processing. To run MERMAKE successfully, you must have:

  1. An NVIDIA GPU with CUDA support
  2. The CUDA Toolkit installed (Refer to the official CuPy installation guide)

MERMAKE Usage

To run MERMAKE, you'll need to provide a configuration TOML file with a few key settings describing your experiment.

mermake my_settings.toml

If mermake is run without providing a toml file, it will warn about the usage and print out the toml file format. Most users only need to edit the [paths] section.

TOML Section Variable Name Description
[paths] codebook Path to the CSV codebook for decoding barcodes (for MERFISH data only)
[paths] psf_file Path to the PSF file used for deconvolution (e.g., .npy or .pkl)
[paths] flat_field_tag Prefix path for flat field correction files (e.g., "Scope3_")
[paths] hyb_range Range of hybridization rounds to process (e.g., 'H1_*_set1:H1_*_set3')
[paths] hyb_folders List of folders containing raw imaging data
[paths] output_folder Path to the folder where MERMAKE should save results

All other sections ([hybs], [dapi], etc.) are preconfigured for most use cases and usually do not need to be changed. Though to use multi-psfs you will want to set the tilesize to the size of the samping grid (ie 300).


Example Config (config.toml)

[paths]
codebook = "codebook.csv"
psf_file = "psfs/psf_scope3.npy"
flat_field_tag = "flat_field/Scope3_"
hyb_range = "H1_*_set1:H16_*_set3"
hyb_folders = ["experiment_folder"]
output_folder = "output"

#---------------------------------------------------------------------------------------#
#---------------------------------------------------------------------------------------#
#           you probably dont have to change any of the settings below                  #
#---------------------------------------------------------------------------------------#
#---------------------------------------------------------------------------------------#

hyb_save =  '{fov}--{tag}--col{icol}__Xhfits.npz'
dapi_save = '{fov}--{tag}--dapiFeatures.npz'
drift_save = 'drift_{fov}--_set{iset}.pkl'
regex = '''([A-z]+)(\d+)_([^_]+)_set(\d+)(.*)''' #use triple quotes to avoid double escape

[hybs]
tile_size = 500
overlap = 89
beta = 0.0001
threshold = 3600
blur_radius = 30
delta = 1
delta_fit = 3
sigmaZ = 1
sigmaXY = 1.5

[dapi]
tile_size = 500
overlap = 89
beta = 0.01
threshold = 3.0
blur_radius = 50
delta = 5
delta_fit = 5
sigmaZ = 1
sigmaXY = 1.5

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mermake-0.0.68.tar.gz (122.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mermake-0.0.68-py3-none-any.whl (113.4 kB view details)

Uploaded Python 3

File details

Details for the file mermake-0.0.68.tar.gz.

File metadata

  • Download URL: mermake-0.0.68.tar.gz
  • Upload date:
  • Size: 122.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for mermake-0.0.68.tar.gz
Algorithm Hash digest
SHA256 1ffca5333ece1c830d34096a7559e06c4ac59fe137ba253b30bee6f37cbc2455
MD5 dd70d5e5e603a01cd839f7877e51921d
BLAKE2b-256 ad120b4173e3161b6c6ad4cf9449b6eb33cf3fb83419c04620e8768830cca13c

See more details on using hashes here.

File details

Details for the file mermake-0.0.68-py3-none-any.whl.

File metadata

  • Download URL: mermake-0.0.68-py3-none-any.whl
  • Upload date:
  • Size: 113.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for mermake-0.0.68-py3-none-any.whl
Algorithm Hash digest
SHA256 3d8fcb27964a6f071ec0d112d8d87da40e24e9965eb77f9085bf365ae771d20f
MD5 f7193172e6d0a96a92c6d6818aaabcc7
BLAKE2b-256 8757555b0dfc72df7eb81f6f43295c64ac8ac8d7a31379aa413589271a290567

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page