BodenmillerGroup / ImcSegmentationPipeline

A pixel classification based multiplexed image segmentation pipeline
https://bodenmillergroup.github.io/ImcSegmentationPipeline/
MIT License
83 stars 35 forks source link

Update 3_measure_mask_basic.cppipe #58

Closed PierreBSC closed 2 years ago

PierreBSC commented 3 years ago

Modification of the script to compute less features related to antibody staining and more related to the cell shape and size.

votti commented 3 years ago

Hi Pierre,

Somehow the pipeline contained duplicated fragments that I removed.

Also using the feature selection to unselect some Intensity features is something I currently would not advise for the standard pipeline: Currently this hard-codes the actual feature names saved. As the channel names are part of this feature names, that means that if eg a user modifies the pipeline to add more channels, they will per default NOT be exported, except if the user modifies the pipeline to do so (explicitly: push the 'select measurements' button, and manually add these channels to the exported measurements). Either this a) needs to be very explicitly documented b) we do not use the feature selection feature to avoid any confusion and remove the superflous features downstream

I prefer b, other opinions?

PierreBSC commented 3 years ago

Hi Vitto,

Thank you for the feedback ! IMO I would rather to go for option a) as it is significantly reducing the size of the data by an order of magnitude and that we can easily warn about it in the documentation. However if you have already observe significant differences between for instance the mean and the median intensity then of course we discuss it. Btw is it possible to easily compute nuclear/cytoplasmic intensity ratio for markers using CellProfiler ? That might be an interesting feature to add...

Best

Pierre

votti commented 3 years ago

Hi Pierre, Sorry for being a bit slow to answer: @Reducing features: I think an even better option would be to change the 'MeasureIntensityMultichannel' CP plugin to contain a selector what features to measure to begin with. Like this one would also save the computation on the features. I think this would be quite easily done. I will look into this in the weekend.

Btw is it possible to easily compute nuclear/cytoplasmic intensity ratio for markers using CellProfiler ? That might be an interesting feature to add... This is possible by also modifying the pipeline to keep the nuclear masks and then generating the cytoplasmic mask using 'IdentifyTertiaryObjects' to identify cytoplasm. This allows you to measure mean intensity of nuclei and cytoplasm. While - as far as I remember- it is not possible to do the ratio from within cellprofiler, it should be straight forward to calculate it from this data. Genreally: don't hesitate to also ask in the Image.sc forum for questions like this. Cellprofiler people are usually very responsive there.

A question from this would be how the downstream analysis handles measurements of multiple objects (eg nuclei, cytoplasm, cell) like this. Is there a plan to support this @nilseling ? Otherwise we shall not include this in the standard cellprofiler output.

Cheers, Vito

PierreBSC commented 3 years ago

Hi Vito,

I think Nicolas has worked on the nuclear/cytoplasmic quantification (just presented it this morning during the last meeting), we should ask him.... For the downstream I think it will really depend on the protein targeted : I you wish to measure nuclear translocation of TF (STAT, NF-kB) that it is absolutely required. However for most of the genes I don't think it is absolutely needed...

votti commented 3 years ago

Nicola will be definitely able to help you. I would definitly recommend you to talk with him about this topic. Measuring the nuclear/cytoplasmic ratio was also part of his Diabetes paper response to reviewers. As far as I remember the results were rather noisy back then, but maybe now things are better nowadays.

votti commented 3 years ago

I now added a WIP implementation of the functionality to select the measurements to be measured in the MeasureObjectIntensityMultichannel module directly using a MultiChoice widget: https://github.com/BodenmillerGroup/ImcPluginsCP/pull/50

If you would have time to test this and eg add unittests for the new functionality, this this would be highly appreciated! This could be quite a nice task to get to know CP modules better.

nilseling commented 3 years ago

Maybe just a quick comment on the handling of "alternative" readouts per cell. The SingleCellExperiment supports this via the altExp framework where alternative SummarizedExperiment objects are nested into the main SingleCellExperiment object https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#5_Adding_alternative_feature_sets But of course you would need to write wrapper functions depending on what you want to do with this information. So far, the standard calls for clustering, dimred, etc also work for the altExp slots. IMO I would not add the nuclear signal extraction to the standard pipeline unless there is a severe bias in the cell-level intensities. Or maybe add it as an optional module - trying to avoid users wrongfully reading in the one measurement or the other.

nilseling commented 2 years ago

Reducing the number of feature is now documented and needs to be done on the user side. Morphological features are being exported via #87