Tumor infiltrating lymphocytes

381 views
Skip to first unread message

Arash Nazeri

unread,
Jul 15, 2018, 3:34:11 PM7/15/18
to QuPath users
Dear all,

I am a total beginner with QuPath. I was wondering if there is a documentation/tutorial on how to train a classifier to detect tumor infiltrating lymphocytes on H&E slides automatically with QuPath. Similar to the method briefly described in: Zhang, Allen W., et al. "Interfaces of Malignant and Immunologic Clonal Dynamics in Ovarian Cancer." Cell(2018).

Any advice is greatly appreciated.


Best,

Arash

Abhishek Rawat

unread,
Jul 16, 2018, 10:49:39 AM7/16/18
to QuPath users
Hi Arash,
I am sure QUpath can perform such an analysis although you will not find a single document entitled "How to find TILs using QUpath".
I suggest you break down the problem into smaller steps and ask/dig around if you get stuck . Something like:

Stain separation --> cell segmentation --> Train classifier to separate into Epithelial cells Vs Stormal cells --> Find a threshold for immune cell marker -- > compare to known ground truth -- > iterate.

Disclaimer: I have not read the paper you cited but I have worked on H-DAB images for similar problem. 
My 2 cents.
cheers!
abhi.


micros...@gmail.com

unread,
Jul 16, 2018, 11:38:49 AM7/16/18
to QuPath users
Yes, finally got somewhere where I could look into the article.  It sounds like most of the specific information would only be available through the authors, but they pretty much ran what Abhishek recommended, although they separated out different tissue types using SLICs at first.  Then they proceeded to identify the cells they were interested in using a trained classifier.  Other than the general method, it would be almost impossible to exactly reproduce without getting the classifier file itself and/or the training set.

In their case, they specify Simple tissue detection->Superpixel segmentation->Classify superpixels with random trees,->cell detection->random trees classifier to find TILs.  Hopefully they also did some stain vector optimization as pointed out above.

Abhishek Rawat

unread,
Jul 16, 2018, 3:35:48 PM7/16/18
to QuPath users
It's interesting that they have used SLIC segmentation/classification here. I only resort to that if I am unable to perform a satisfactory cell segmentation (due to over staining for example). Also they seem to be using RF classifier for identifying TILs directly (instead of using a threshold). Maybe I should get hold of the paper and read it after all.... :))

micros...@gmail.com

unread,
Jul 16, 2018, 5:24:00 PM7/16/18
to QuPath users
I have usually used the SLICs for separating out compartments prior to cell segmentation so that I can compare different types of tissue within the same sample (purely for statistical reasons).  Once you merge the SLICs back into a couple of annotations, you can get separate percent positive values in the different tissue types.  I wish they went into a little more detail on their segmentation and classifiers... but it's nice to see the process working for someone!

If I need to separate out tissue types because I needed different cell segmentation settings (usually due to dark backgrounds in certain areas), I have more often used the "Create cytokeratin annotations" tool since it skips the training step.

Finn

unread,
Jul 17, 2018, 12:21:41 PM7/17/18
to QuPath users
Hi all-

Abhishek -- you won't find much more detail in the methods of the paper as they were kept fairly brief.

I initially did try that analysis with cell-based tissue segmentation, but was concerned with how acellular regions might affect the downstream hotspot analysis. So, we really needed classification for the whole tissue area. I tried the SLIC superpixels and it just turned out they worked beautifully for segmentation in this particular context (especially once Haralick features were added...). I've attached one of the epithelial masks so you can see for yourself.

I wasn't able to nest the classifications easily (i.e. the question I just posted: https://groups.google.com/forum/#!topic/qupath-users/f9PE5VsiPMk) so re-detected cells to build and apply a lymphocyte classifier, and the downstream merging was done in R. I think the workaround Pete suggests would make this step easier.

I'd point out that the computational requirements weren't trivial and took up to 5+ hours and 40+ GB of RAM per whole slide (I think particularly to merge the superpixels to annotations...), so the whole thing was run on a cluster... Thanks go to Pete for the software that made it possible!





Finn

unread,
Jul 17, 2018, 12:44:44 PM7/17/18
to QuPath users
Hi again --

I've attached a script that will reproduce the basic workflow if anyone is interested -- will of course need lots of customization for other projects. Not elegant but worked really well for this project.
QuPath_ITH_basic_workflow.groovy

Pete

unread,
Jul 17, 2018, 1:17:55 PM7/17/18
to QuPath users
Thanks for sharing this!  And good also to know about the computational requirements and bottleneck.  Sounds like the command to merge the superpixels to annotations needs some more optimization....

micros...@gmail.com

unread,
Jul 17, 2018, 2:00:04 PM7/17/18
to QuPath users
Yes, thanks!  It's nice to see some alternate approaches, and I sympathize with the SLIC computation times when over 500k detections.  

The last time I played with a similar project I used the original calculated features for the SLICs (rather than smoothing there), and then applied smoothing to the classification itself to eliminate islands where the identification happened to be off.  The inclusion of a downsampled image mask is also really nice.

Arash Nazeri

unread,
Jul 17, 2018, 4:35:03 PM7/17/18
to QuPath users
Thank you all very much. These are really helpful.

Best,

Arash
Reply all
Reply to author
Forward
0 new messages