version 0 - mosaic groupmosaic.mpi-cbg.de/downloads/iapmanual.pdf · the interaction analysis...

13
1 Interaction analysis plugin for ImageJ – a tutorial Version 0.1 MOSAIC group, MPI-CBG December 2012

Upload: others

Post on 20-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

1

Interaction analysis plugin for ImageJ – a tutorial

Version 0.1

MOSAIC group, MPI-CBGDecember 2012

1

Page 2: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

CONTENTS 2

Contents

1 Introduction 3

1.1 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2 The interaction analysis framework . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Usage 4

2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2 Starting the plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.3 Opening the images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4 Selecting a region of interest - Applying a mask . . . . . . . . . . . . . . . . . . . . 5

2.5 Paricle detection and computing distance distributions . . . . . . . . . . . . . . . . 5

2.6 Parameter estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.7 Interpreting the parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.8 Hypothesis testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.9 Working with coordinates instead of images . . . . . . . . . . . . . . . . . . . . . . 12

3 Known issues 13

4 References 13

2

Page 3: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

3

1 Introduction

1.1 Aim

The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns(sets of points). These points can be locations of molecules, viruses, organelles, cells, etc, in 2D or3D. Spatial interaction means the point patterns are correlated with each other, and the absenceof this means they are independent of each other.

1.1.1 Beyong co-localization

A familiar measure used in biology for this purpose is object-based co-localization (OBC). In OBC,the nearest neighbor distances (NND) from one point pattern to the other is plotted as a histogramand then a threshold distance is set (typically, the ‘diffraction-limited resolution’ of ≈ 200nm), sothat all points with a NND less than the threshold is considered ‘co-localized (details, and furtherreading, can be found in [2]). The IAP, based on the interaction analysis framework published in [2], extends this method, to include: 1) possibility of assigning different shapes for spatial interactions,in addition to the threshold function 2) a standardized way to correct for co-localizations due torandom chance and the influence of how the points are distributed within a point pattern onthe NND distribution, and to infer the spatial interaction parameters, like strength, hard-core andscale. The estimated parameters can be used for comparing the interactions at different conditions,etc.

1.1.2 The need for different potential shapes

Two examples of point patterns in biology, which are correlated in space but a traditional co-localization measure is insufficient to quantify the information about the interaction available indata, are – (1) when the interactions are a non-step, or even continuous function of distance (asin molecular interactions, but higher order biological interactions may also be considered as one),or (2) indirect interactions (example: presence of Specie A molecules affecting the local pH, andthus affecting the spatial distribution of a specie B).

1.1.3 The need to account for cellular context

The distance distribution between two point patterns is influenced by how the points are distributedwithin themselves. For example, the NND distribution from a randomly distributed point patternX to a point pattern Y follows different patterns, depending on the cellular context, i.e, thedistribution of points within Y (whether they are uniform, random or clustered (Figure 1.1(a))).Quantifying the interactions based on a single distance threshold, as in OBC, without accountingfor the patterns created by the variations in intra-point distributions, may result in incomplete,or even wrong, analysis. The IAP incorporates this dependency on intra-point distribution intoanalysis (by introducing ‘state density’ q(d) into the model, see Figure 1.1(b)). The point patternsare considered interacting only if the NND distributions between them is deviating from the statedensity distribution in a statistically significant way (Figure 1.1(b)).

1.2 The interaction analysis framework

A quick explanation of the model used is given in Figure 1.1. More details can be found in [2, 1, 3].

3

Page 4: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

4

(a)

(b)

Figure 1.1: (a) Different cellular contexts, or distribution of objects in Y – uniform, random andclustered –, and how they affect the NND distribution q(d) from another, randomly distributedpoint pattern. q(d) is known as ’state density’ (b) The basic principle of IAP: q(d) is modifiedby an interaction between X and Y, modelled as a Gibbs function of an interaction potential, togive p(d), the model NND distribution from X and Y. In the case of non-interacting X and Y, thestrength of interaction ε = 0, and the Gibbs function=1, or p(d) = q(d). The parameters for ageneric parametric potential is also shown, with an example potential shape (Hermquist).

2 Usage

This tutorial provides a step-by-step guide on how to use the IAP with the sample data providedalong with. The data consist of dual color images of a HER 911 cell, with Rab5-positive endosomes

4

Page 5: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.1 Installation 5

and Adenovirus serotype 2 particles have been fluorescently labeled, used in the publication [2].The IAP estimates the interaction between the set of viruses (referred to as X) and endosomes(reference point pattern: Y). The estimated interaction between X and Y need not be the same asthat between Y and X, hence Y is called a reference set of points.

2.1 Installation

To install the plugin, ImageJ must be already installed. ImageJ can be downloaded fromhttp://rsbweb.nih.gov/ij . Variants like Fiji (http://fiji.sc/) may also be used.

Once ImageJ is installed, download the latest Mosaic Toolbox.jar from http://mosaic.ethz.ch.This jar file should be downloaded to the plugins folder of your ImageJ installation. On restartingImageJ, the plugin will appear under the menu Plugins → Mosaic → Interaction Analysis.

2.2 Starting the plugin

The plugin can now be started by accessing the menu Plugins → Mosaic → InteractionAnalysis. A screenshot of the GUI is shown in Figure 2.1.

2.3 Opening the images

The images can be selected by clicking on Open X and Open Y . Keep in mind that Y shouldbe the reference set of points.

For the tutorial, select the Virus image for X and Endosome image for Y, to study the interactionfrom X to Y (Figure 2.2).

2.4 Selecting a region of interest - Applying a mask

Some parts of the image might have all the points of interest, and other parts might be empty.The plugin assumes to have a homogenous density of points in the region of interest. This regioncan be selected for analysis by creating a binary mask– regions with pixel intensity> 0 will be theanalyzed, and the black (pixel intensity= 0) regions will be ignored.

The mask can be created by hand, or using some other tools - segmentation, contour detection etc- and can be loaded by clicking on Load . One can also create a very rudimentary mask with theGenerate button.

Once the mask is loaded/generated, they can be applied to the images by clicking on Apply , anda popup will confirm which mask was applied.

At any moment, the mask can be reset (i.e all points in the image will be used for analysis) byclicking on Reset .

For the tutorial, the user can click on Load and use the mask provided with the tutorial (Endo-someMask1.tif, Figure 2.2(c)), and click Apply (confirmation: 2.2(d)). The user is welcome tocreate better masks with other tools.

2.5 Paricle detection and computing distance distributions

At this step, the particles in the image will be detected, and the nearest neighbor distances fromX to Y and from a rectangular grid of points to X will be computed, and smoothed empiricalprobability density functions will be estimated.

5

Page 6: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.5 Paricle detection and computing distance distributions 6

Figure 2.1: The GUI of IAP

2.5.1 Particle detection

These parameters are:

• Radius: Approximate radius of the particles in the images in units of pixels. The valueshould be slightly larger than the visible particle radius, but smaller than the smallest inter-particle separation.

• Cutoff : The score cut-off for the non-particle discrimination. The higher the number in thecutoff field the more suspicious the algorithm is of false particles.

6

Page 7: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.5 Paricle detection and computing distance distributions 7

(a)

(b)

(c) (d)

Figure 2.2: (a) The Virus(left) and Endosome images provided for the tutorial, opened with theIAP. (b) After particle detection (c) The mask provided with the tutorial, loaded by clicking Loadmask (d) Popup after clicking Apply

7

Page 8: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.6 Parameter estimation 8

• Percentile : The percentile (r) that determines which bright pixels are accepted as Particles.All local maxima in the upper rth percentile of the image intensity distribution are consideredcandidate Particles.

More information on the particle tracker can be found in:http://courses.washington.edu/me333afe/ImageJ_tutorial.html

2.5.2 Grid generation and density estimation

Instead of running Monte-Carlo simulations to generate random point patterns and calculate theNND distribution to Y to compute the state density q̂(d), the IAP uses an approximate and fastermethod to compute the mean value of q̂(d). In this method, mean q̂(d) is found by computingthe NND distribution from the point pattern generated by exhaustively sampling a grid (withpoints separated by Grid spacing), to Y. The grid spacing should ideally be half of any possibleinteraction that can be detected with the available data. For an image, without sub-pixel particledetection, .5 (pixels) will be OK.

Kernel wt(q) and Kernel wt(p) are weights for the kernel density estimator, for q̂(d) and p̂(d)respectively . It is inversely related to the smoothness of the fit function.

• Grid spacing : The grid spacing should ideally be half of any possible interaction that canbe detected with the available data. For an image, without sub-pixel particle detection, .5(pixels) will be OK. In other cases, the user can try our lower values till no major differenceis noticed in the distance distribution q̂(d).

• Kernel wt(q): Since q̂(d) is generally computed with a large number of data points (givenby the number of points in the grid), the a low parameter of .001 will produce smooth fits,and hence, this parameter do not need generally need tweaking.

• Kernel wt(p): For p̂(d), it is more critical, and a rough estimate for this parameter iscomputed with a modified Silvermans rule of thumb law, shown in the popup as a sugges-tion(Figure 2.3(e))). This should be selected carefully so that the resulting fit distributionsshould carry all the information relevant to the interaction analysis from the histograms,without overfitting. A larger value for this parameters means a finer, less smooth, fit.

Note: Kernel wt(p) is a very critical parameter. While the suggestion provided by the popup(Figure 2.3(e)) can be used as an initial guess, the user has to play with this parameter sothat the final fit accurately reflects the information relevant to the interaction. Changingthis parameter by an order of magnitude might result in poor analysis, as shown in Figure2.3(b,c,d). We are currently working on estimating this parameter from data.

For the tutorial, the user should enter Grid spacing=.5, Kernel wt(q)=.001, and Kernel wt(p)=35.9,and click Calculate distances. When prompted, input radius=4, cutoff=4 and percentile=1 forVirus particle detection, and (3,3,5) for the Endosome image. The user will get a result as inFigure 2.2(b).

Note: After entering the value in a field, the user must click Enter/Return, so that the IAP readsthe field value.

2.6 Parameter estimation

Here one can estimate the parameters of the interaction potential. The potential shape can beselected from the dropdown, and the estimation can be done by clicking on Estimate . Currently,

8

Page 9: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.6 Parameter estimation 9

(a) (b)

(c) (d)

(e)

Figure 2.3: (a) Histogram of the observed NND from X to Y (i.e corresponding to p̂(d)) (b) Blue:Kernel density estimator fit of p̂(d), for a Kernel wt(p)=35.9, as suggested by the IAP, Red: q̂(d)(c,d) Blue: p̂(d) corresponding to Kernel wt(p)=1 and 200. Note that in (c) is too smooth, anddetails in the NND distribution is lost, and it is difficult to distinguish between p̂(d) and q̂(d) (Redcurve), and in (d), there is overfitting, which can affect the analysis. (e) Popup with a suggestionof the kernel, as suggested by the modified Silvermans rule of thumb law.

the IAP has a few parametric potential shapes,and a piece-wise linear non-parametric potential,as shown in the dropdown here, and explain below. The estimation can be repeated several times(Repeat estimation parameter) to confirm that the optimizer is indeed returning the best fitness.

9

Page 10: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.6 Parameter estimation 10

2.6.1 Details of parametric potentials

Potentials are parameterized as φ(d) = εf((d − t)/σ) with interaction strength ε, length scale σ,and threshold t. The step potential has σ = 1, and all other parametric potentials have t = 0.Their shapes f(·) are defined as:

• Step potential:

f st(z) =

{−1 if z < 00 else .

(1)

• Hermquist potential:

fhe(z) =

{− (z + 1)

−1if z > 0

−(1− z) else .(2)

• Linear potential, type 1:

f l1(z) =

{0 if z > 1−(1− z) else .

(3)

• Linear potential, type 2:

f l2(z) =

0 if z > 1−1 if z < 0−(1− z) else .

(4)

• Plummer potential:

fpl (z) =

{−(z2 + 1

)−0.5if z > 0

−1 else .(5)

2.6.2 Non-parametric potential

The plugin has a piece-wise linear non-parametric potential, which can be used to see how thepotential shape will look like, and then a parametric potential can be designed accordingly. Itis defined as a weighted sum of kernel functions centered on P support points ( # supportpoints field in GUI) and it estimates the weights at the support points. The more the numberof support points is, the finer the potential will fit the data. The smoothness of the potentialfunction is controlled by the Smoothness parameter, which is a penalty on the difference betweentwo adjacent weights. The larger this parameter is, the more smooth the estimated potential willbe – however large values of this parameter causes the estimation to converge to q(d), therefore,use the parameter with caution.

For the tutorial, the user is welcome to select different potential shapes, and click on Estimate .The model fit, along with the observed distance distribution and the cellular context distributionare obtained as results, along with fit parameters and the fit potential shape. The results corre-sponding to step and Plummer potentials are shown in Figure 2.4. Note that the Plummer potentialhas a four fold better fitness than the step potential. In the case of non-parametric potential, entera large enough # Support points and small enough Smoothness (100 and .001).

Note: After entering the value in a field, the user must click Enter/Return, so that the IAP readsthe field value.

10

Page 11: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.7 Interpreting the parameters 11

2.7 Interpreting the parameters

The parametric potential, as shown in 1.1, has three parameters – strength, hard core and scale ofinteraction. For the potential shapes provided with the IAP, the step potential has scale=1, andall other parametric potentials have hard core=0, by definition.

Strength of interaction, as its name implies, is a measure of the strength of interaction, and is equalto zero in the case of non-interaction. However, due to random coincidences and uncertainties, thismight be marginally greater than zero even in the case of non-interaction – and hypothesis testsin the following section helps to separate true and false interactions in that case. The strength ofinteractions for different biological conditions (wt vs mutant, before/after adding agonist, etc) canbe compared, to obtain biological conclusions.

Hard core of interaction is similar to the distance threshold in OBC - if an object is inside the hardcore, it is interacting.

The scale of interaction gives the scale at which interaction exists.

Note: Comparisons between the parameters estimated, for different conditions etc, should be donefor the same potential shape. That is, the strength of interaction from a step potential should notbe compared with that from using a Hermquist potential.

In the tutorial, for the results obtained in Figure 2.4, it can be seen that the strength of interactionparameter for both potentials (1 and 3.65) are well over zero, i.e, these are cases of true interaction.

(a) (b)

(c) (d)

Figure 2.4: (a,c) Distance distributions after fitting. Green: the fit p(d) with estimated parameters,Blue: the empirical distribution p̂(d) of NND from X to Y, from data and Red: the state densityq̂(d) (a) Corresponding to a step potential, (c) a Plummer potential. (b,d) The estimated potentials- step and Plummer respectively. Notice that the Plummer potential has a 4-fold improvementover the fitness.

11

Page 12: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

2.8 Hypothesis testing 12

2.8 Hypothesis testing

Once the estimation of the parameters is done, tests whether these parameters correspond to aninteraction or not can be done by a hypothesis test. A test statistic (which is a function of theestimated scale/threshold) is calculated for K Monte Carlo samples (# Monte carlo runs field)of the distribution corresponding to the Null Hypothesis of “no interaction”, and for the observeddistance distribution. The values corresponding to the Null Hypothesis distribution is sorted, andthat corresponding to the observed distribution is ranked. If it ranks higher than the d(1−α)Ke-thtest statistic, H0 is rejected on the significance level α. Smaller values of α means lower chancesof false positives.

The IAP also runs a non-parametric test explained in [2]. It is also a MC rank based test, butis based on the histograms of observed NND and the state density, and is independent of theestimated parameters.

The IAP returns the rank for both tests and the result of the test based on the significance level.

Caution: This part of IAP is to be used with caution, and the user is advised to derive conclusionsfrom the tests only if both tests return similar conclusions.

For the tutorial, the user can keep the values given in # Monte carlo runs and Significancelevel fields, to get hypothesis tests with a significance of 95%, and click Test .

(a) (b)

Figure 2.5: Results of parametric and non-parametric hypothesis tests.

2.9 Working with coordinates instead of images

It is possible to use IAP with coordinates of the point patterns, instead of images. This mightcome in handy when working with results from superresolution techniques like PALM/STORM,where the concept of a reconstructed image is ambiguous, and the coordinates of particles aremore readily available. This functionality can be accessed by clicking Load coordinates insteadof Load images. The coordinates can be loaded in CSV format – Xcoord, Y coord, Zcoord, forboth X and Y point patterns. The boundaries of the point patterns (they must coincide) are tobe entered in the fields provided. For the other parts of the program, including masks, the samesteps as in the case of images are to be followed.

12

Page 13: Version 0 - MOSAIC Groupmosaic.mpi-cbg.de/Downloads/IAPManual.pdf · The Interaction Analysis Plugin(IAP) can infer the spatial interaction between two point patterns (sets of points)

13

3 Known issues

To be added...

4 References

[1] J. A. Helmuth. Computational Methods for Analyzing and Simulating Intra-Cellular TransportProcesses. PhD thesis, ETHZ, 2010.

[2] J. A. Helmuth, G. Paul, and I. F. Sbalzarini. BMC Bioinformatics, pages 372–372.

[3] M. Sutter. Computational analysis of spatial point patterns for cell organelles. Master’s thesis,ETHZ, 2011.

13