When there is a phenotype, e.g. degree-of-accumulation, you wish to define quantitatively in an image, one approach is to measure EVERYTHING and ask questions later Try to segment regions that are sensitive to the phenomenon you are studying and measure as many aspects of these objects as you can.
Granularity is a type of texture measurement, rather than a tool that counts spots, granules, or foci. Texture measurements could be valuable in distinguishing the state of the worm, but even if a feature has a strong predictive value there isn’t always an easy way to interpret the “meaning” of the number. Some features only make sense through the lens of the algorithm used to derive them.
Even after you’ve generated all your features for the worm, there may be secondary features that you derive that follow some kind of logic you observe between the two worm conditions. Some of these secondary features can be added in a CellProfiler pipeline with the CalculateMath module. Please refer to the translocation tutorial to see an example.
I’ve made a pipeline to generate features in your worms. My strategy was to segment the compartments within the worm that you describe: the distributed version of the protein and the accumulated version of the protein. Here are the two processed worms:
I added an established approach for identifying spots (BLUE outlines) in an image. Applying this approach to an image without spots will still yield spots (this is what the algorithm does after all), but they’ll be of different shapes and different numbers than when nice round spots are present in the accumulated case. Notice there are fewer and elongated spots in the top image.
I also wanted to capture the distributed protein (GREEN outlines) by thresholding once within the worm body. Both worms still have a region with distributed protein, but the bottom worm has less signal than the top worm; this should help differentiate the state of the worm.
Ultimately, you’ll need many more examples of your phenotype to rigorously analyze the worm feature space and determine whether or not the phenotype you’re trying to define is captured within. Here is some python code you can use to see if you can separate your worms with PCA:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import decomposition
df = pd.read_csv("MyExpt_Image.csv")
df_num = df.select_dtypes(include=np.number)
X = df_num.values
pca = decomposition.PCA(n_components=2)
X = pca.transform(X)
plt.scatter(X[:, 0], X[:, 1], edgecolor='k')
The result with 2 samples is trivial, but you’ll get a similar plot (see below) when you run this code; each dot is a worm. Note that I have not “cleaned” or normalized the data, which would be expected in a formal analysis. Please refer to cytominer to learn more about how to analyze CellProfiler feature data.
Good luck and I’d be curious to know if this approach works out for you. Here is a zip file with pipeline I used to segment your worms: forum6194.zip (866.5 KB)
P.S. If your translocation phenotype is continuous in nature and the transition state is suitably sampled in your image set, you might want to check out pseudotime. Pseudotime will attempt to infer the natural order of the transition stages as a worm progresses from distributed protein to accumulated protein. You could potentially use the position of the worm on the pseudotime axis as the degree of homogeneity.