labsyspharm / mcmicro

Multiple-choice microscopy pipeline
https://mcmicro.org/
MIT License
111 stars 58 forks source link

MCMICRO compatibility with in situ sequencing #502

Open rocketeer1998 opened 1 year ago

rocketeer1998 commented 1 year ago

Hi @jmuhlich, thanks to you and your team for providing this easy-to-use software to the community! I'd like to try MCMICRO on my ISS (in situ sequencing) data, which belongs to a branch in spatial transcriptomics.

What I have done

The data structure of ISS

Briefly, ISS detects mRNA on the whole tissue slides using cyclic imaging and barcode decoding.

Input1: raw image files (in .tif format)

The raw images obtained from an ISS experiment are almost the same as that of exemplar-001, but only differ in the:

Input2: markers

This is the screenshot of my markers.csv.

截屏2023-04-25 11 43 10

Question

I've tested MCMICRO on my ISS data, however, it failed on quantification:mcquant step which alerted, Exception: The number of channels in markers.csv doesn't match the image. Stitching and alignment can run quickly, despite the output was incorrect after visual inspection.

Thanks for your patience!

rocketeer1998 commented 1 year ago

Maybe I should specify the --align-channel parameter in ashlar to 5 because I want to align based on DAPI channel. Is that right?

jmuhlich commented 1 year ago

How many input tiff files do you have and what are the image dimensions? Do you have one whole-slide image for each mRNA transcript, or do you have many smaller "tiles" for each transcript?

rocketeer1998 commented 1 year ago
Boehmin commented 1 year ago

I wanted to follow up on this thread since I was wondering whether mcmicro will support a module for ISS decoding across multiple rounds, or whether that is still in the pipeline? Thank you!

ArtemSokolov commented 1 year ago

What software do folks currently use for ISS decoding? If there is an existing containerized module we can leverage, it would be relatively straightforward to add one to the pipeline.

Boehmin commented 1 year ago

I guess spacetx/starfish offers a lot of flexibility (in terms of different decoding schemes) - https://spacetx-starfish.readthedocs.io/en/latest/user_guide/index.html#spot-based-decoding.

Additionally, I must admit I have not been able to figure out how to implement spot detection with 3seg yet - I`ve been trying a few params.yml modifications I found https://mcmicro.org/troubleshooting/tuning/s3seg.html, however, I keep getting an error that the puncta parameters are not supported. Is there an optimum configuration for the params.yml required for spot detection to work?

Thanks ever so much for your help!

clarenceyapp commented 1 year ago

Hi @Boehmin Can you list the parameters you are using for s3seg spot detection please? Thanks.

Boehmin commented 1 year ago

I added the following to my s3seg options: s3seg: --maxima-footprint-size 15 --area-max 50000 --expand-size 9 --pixelSize 0.18 --mean-intensity-min 50 --detectPuncta 2 3 4 --punctaSigma 1.5 2 1.75 --punctaSD 3

clarenceyapp commented 1 year ago

Hi @Boehmin , thanks for listing your s3seg parameters. Your spot detection parameters look valid. However, it appears you're using the newer version of s3seg and unfortunately, we have not had a chance to port the spot detection capabilities that were in the older version yet, which is why it is erroring. What are the image dimensions in terms of number of pixels in X and Y? If they are small enough (~30,000 pixels), the older version will work fine with a few additional changes to your other s3seg parameters.

Boehmin commented 1 year ago

Hi @clarenceyapp , thanks a mill for your help - that`s great news! I use s3seg version: 1.5.4-large if that helps as well. Which version do you recommend I go for?

The image is 21,869x17,528 pixels so should be ok then?

ArtemSokolov commented 1 year ago

Another thing to note is that s3seg would only detect the x-y coordinates, so additional processing would need to happen for trace building and spot detection.

It seems that spacetx/starfish is a good one-stop-shop for it. If anybody is able to wrap something like this into a command-line tool that works with .ome.tiff, I would be happy to containerize it and include it in MCMICRO. Anything with an interface like

python starfish.py --in myimage.ome.tiff --codebook codebook.csv

would work.