Home

Image Analyis

Origins of cell-to-cell variability in virus infection

When monoclonal culture cells are exposed to a virus, usually only a part of these cells become infected. It is not known whether this selection is completely random or whether there are also deterministic influences of unknown factors. In order to find out whether the cell’s population context affects infection rates, Snijder et al. performed large scale image analysis to find whether there were significant correlations between cell context features and infection rates.

Aim: Find out whether MHV infection rate is correlated with the local density and/or nuclear area.

I
Cell Profiler is needed to segment images and identify nuclei. Several characteristics of these nuclei need to be determined as well:

  1. You can find a cell profiler project (MHV.cpproj) and images (in MHV_data) on OLAT. Import the pipeline into Cell Profiler, draw the input images into the 'Images' module and set the default output folder under 'view output settings'.
  2. In order to view single images, you can double-click on them in the 'Images' module. Which documents (end with '0.png' or '1.png') depict general nuclear stainings, which ones MHV infections?
  3. In the 'NamesAndTypes', images are being grouped. Press 'Update' and check which names are given to nuclear and infection stainings, respectively.
  4. Which thresholding method is used to identify nuclei? Under which circumstances is this a useful method?
  5. Which method is used to distinguish clumped nuclei? What is its underlying principle?
  6. Add an additional module in order to determine the intensity of the 'viral staining' of each nucleus. The results are needed to determine which cells (nuclei) have been infected by MHV.
  7. In order to identify infected cells, you will need to define a threshold (for your own python code). Add a module that displays the mean intensity on images and determine which threshold would be better, 0.05 or 0.005. Note that the analysis can be paused and that the displayed images can be zoomed.
  8. The pipeline saves its results into a Matlab-file. Cell Profiler also provides the opportunity to save data into .csv files (viewable with Excel). Add a module to the pipeline to save the data in such files as well.

II
Python code is needed to analyze whether infection rates correlate with local cell density and with nuclear area.

  1. The .csv files can be opened directly with python. Alternatively, there is also a library to read Matlab files. The code below for example loads two kinds of measurements from the cell profiler output (Matlab file) and convert these into python arrays. View the .csv files with Excel or with python and consider which measurements you need. Create numpy arrays containing these data, either starting from .csv files or from matlab files, depending on your own preference.
  2. Create further python code, such that cells are appointed to an area class (1: 1 to 100 pixels, 2: 101 to 200 pixels etc) and infection rates are plotted for each of these classes.
  3. Optional: Appoint cells to a local density class (1: 1 cell per square of 48 (x) by 52 (y) pixels; 2: 2 cells per square etc.) and plot infection rates for each density class.

Submit the program

Example: converting matlab data to numpy arrays

#load libraries
from scipy.io import loadmat
from numpy import array
import pylab
import numpy
#numpy.set_printoptions(threshold=numpy.nan) #uncomment for printing full variables

#set number of images to be analyzed 
#(different channels do not count as different images)
number_of_images=6

#load profiler results (verify the proper locations of the input file)
data=loadmat("profiler_output/DefaultOut.mat", matlab_compatible=True)
a=data['handles']
b=a[0,0]['Measurements']
c=b[0,0]['FilteredNuclei']
center_x_matlab=c[0,0]['Location_Center_X']
center_y_matlab=c[0,0]['Location_Center_Y']

#determine the total number of cells (cnum)
cnum=0
for i in range (0,number_of_images):
    cnum+=len(center_x_matlab[0,i])
print 'total number of cells (cnum):',cnum

#transfer data to arrays
center_x=array(cnum*[0.0])
center_y=array(cnum*[0.0])

k=0
for i in xrange (0,number_of_images):
    l=0
    for j in center_x_matlab[0,i]:
        center_x[k]=j
        center_y[k]=center_y_matlab[0,i][l]
        k=k+1
        l=l+1

Thanks to Berend Snijder of the Pelkman’s group for providing images!

Further reading: original paper