Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CODEX Raw data #545

Open
andreevg04 opened this issue Mar 26, 2024 · 8 comments
Open

CODEX Raw data #545

andreevg04 opened this issue Mar 26, 2024 · 8 comments

Comments

@andreevg04
Copy link

andreevg04 commented Mar 26, 2024

Dear MCMICRO Team,

I stumble upon this problem. I have my project with raw (where my raw data is separated only by "_".raw.qptiff).
I have my marker.csv and my params.yml
Here are the params.yml:
workflow:
start-at: illumination
stop-at: background
qc-files: copy
tma: false
viz: false
background: true
background-method: backsub
multi-formats: .qptiff
segmentation: unmicst
segmentation-recyze: false
downstream: scimap
options:
ashlar: -m 30
cypository: --model zeisscyto
ilastik: --num_channels 1
mcquant: --masks cell*.tif _cp_masks.tif
naivestates: -p png
imagej-rolling-ball: 100 -n=4 -j="-Xmx4g"
modules:
illumination:
name: basic
container: labsyspharm/basic-illumination
version: 1.1.1
registration:
name: ashlar
container: labsyspharm/ashlar
version: 1.18.0
dearray:
name: coreograph
container: labsyspharm/unetcoreograph
version: 2.2.9
cmd: python /app/UNetCoreograph.py --outputPath .
input: --imagePath
background:
name: backsub
container: ghcr.io/schapirolabor/background_subtraction
version: v0.4.1
cmd: |-
python3 /background_subtraction/background_sub.py
-r ${image} -m ${marker}
-o ${image_id}_backsub.ome.tif -mo markers_bs.csv
segmentation:

  • name: unmicst
    container: labsyspharm/unmicst
    version: 2.7.7
    cmd: python /app/unmicstWrapper.py --stackOutput --outputPath .
    input: ''
    channel: --channel
    idxbase: 1
    watershed: 'yes'
    watershed:
    name: s3seg
    container: labsyspharm/s3segmenter
    version: 1.5.6
    channel: --probMapChan
    idxbase: 1
    quantification:
    name: mcquant
    container: labsyspharm/quantification
    version: 1.5.3
    downstream:
  • name: scimap
    container: labsyspharm/scimap
    version: 0.17.7
    cmd: scimap-mcmicro -o .
    input: ''
    viz:
    name: autominerva
    container: ghcr.io/labsyspharm/mcmicro
    version: auto-minerva-2023-08-29
    I tried everything with the formatting but every single time I get this output and error:
    N E X T F L O W ~ version 23.10.1
    Launching https://github.com/labsyspharm/mcmicro [nauseous_cray] DSL2 - revision: 69ee2ef [master]
    ERROR ~ No such variable: name

-- Check script '/home/burgera/.nextflow/assets/labsyspharm/mcmicro/main.nf' at line: 21 or see '.nextflow.log' file for more details
In the log there is nothing specific that can help with troubleshooting.

Another note: When I delete the Illumination from the exemplar-002 and have only raw, markers.csv and then the params (default) I get the same error. When I dont have the extra params file it starts running normally by default, so it has to be something from this file that is causing trouble.

@andreevg04
Copy link
Author

andreevg04 commented Mar 26, 2024

I replaced the params.yml with this
workflow:
start-at: registration
stop-at: background
qc-files: copy
background: true
background-method: backsub
multi-formats: .qptiff
segmentation: unmicst
segmentation-recyze: false
The Error message now is ERROR ~ Error executing process > 'registration:ashlar (1)'

Caused by:
Process registration:ashlar input file name collision -- There are multiple input files for each of the following file names: raw
The name of the image is tissue_Scan_1_Cycle_x.qptiff where x is from 0 to 14

Even reducing the naming to Cycle_1.qptiff, Cycle_2.qptiff didnt help.
The images are 4x1x1

I tried also --in project --multi-formats .qptiff this but got the same error

The images are not in tiles but they are WSI. I want to perform the registration of the WSI

@ArtemSokolov
Copy link
Collaborator

@jmuhlich can provide more details, but ASHLAR is not really designed to align pre-stitched images. It's not going to produce accurate registration, and you will get marker combinations that make no sense for individual cells.

Can you check with your microscope vendor about disabling on-board stitching? It would be ideal if you were able to download raw tiles from the instrument and letting ASHLAR do simultaneous stitching and registration to get accurate results.

Alternatively, you can look into running an external tool to do WSI alignment (e.g., https://github.com/labsyspharm/palom). You can then place the output from that external tool into the registration/ subfolder and start-at: segmentation to run the rest of the pipeline.

@andreevg04
Copy link
Author

I couldnt get the unstitched file so I will process the registerred one. Thank you for that!!!

On a side note:I have following issue:
I have big ome.tiff images that I want to process with MCMICRO or simillar pipelines but because of hardware limitations I have to slice the large images beforehand and save the metadata in each slice, to be able to process it in MCMICRO like their examples on IMC.
I tried some python coding and got the sliced images to be saved as a z-stack, but the MCMICRO pipeline got error message of: that the pixel size is missing and the coordinates of the slices.

@ArtemSokolov
Copy link
Collaborator

Hi @andreevg04,

Can you provide a little bit more detail about your process? Are you saving all your slices into a single z-stack?

Can you also please share you parameter file that you are using?

@andreevg04
Copy link
Author

andreevg04 commented Apr 1, 2024

Hi @ArtemSokolov
may I send you an email/link with images with the details. I am saving the slices in a single z-stack becaus the examples were like this. But I since I am a programming novice I cant save the metadata/coordinates to the slices.
The parameter file for MCMICRO is just the default. I wanted to just test it so I didnt use any specifics.

@ArtemSokolov
Copy link
Collaborator

If you save all slices into a single z-stack, the file size will be the same as the original .ome.tiff. So, how will it help you with hardware limitations?

My suggestion would be to put your tiles into the registration/ subfolder as individual .tif files and then run the pipeline with the following params.yml:

workflow:
  start-at: registration

It will process each tile separately, but you will need to aggregate the quantification tables manually.

Alternatively, you can try running the entire .ome.tiff on a machine with more memory / disk storage.

@andreevg04
Copy link
Author

The main problem was that it couldnt load the image in memory as the original .ome.tiff when I performed some processing and color deconvolution to it in the beginning. That is why I decided to slice the image and proces the tiles which then worked.
Nevertheless I wasnt able to start the MCMICRO pipeline with the errors I described.
What you are suggesting will not produce a composite image then, correct? My plan was to generate a composite large multichannel image and then process it further. Would you happen to have any ideas or someone that has done such image slicing?

@ArtemSokolov
Copy link
Collaborator

Sorry, looks like I listed the wrong step above. You would want to do:

workflow:
  start-at: segmentation

The tiles don't need to be registered, which is the module that wants to know tile coordinates. You should be able to proceed directly to cell segmentation instead.

At the high level, yes, by splitting the image and segmenting each tile separately, you would need to either stitch the segmentation masks back together before quantification or simply combine the quantification tables (but probably be mindful of cells near the edges of tiles, as they may get double-counted). I am not aware of any tools that do these automatically, but I admit that it's been a while since I last looked.

One other suggestion is to try other segmentation modules. MCMICRO runs UnMicst by default, which is a very resource-intensive module (both memory and disk). Try selecting one of the other modules and see if that still runs up against your hardware limitations. The following documentation pages may be useful:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants