• No results found

3.3 Testing of diversity and similarity measures on simulated clonal frequency data . 19

3.3.3 Experiment set-up

Figure 3.6 explains how the generative model was used to simulate the data for these experiments, and how the comparisons were done. Throughout the experiments it can be assumed the bold marked settings described in Table 3.2 were used, unless otherwise stated. The R package divo [77] was used to calculate the R´enyi entropy, symmetrized R´enyi divergence and I-index. The mutual information was calculated using the R package infotheo[78]. For all other measures, our own implementations were used. For easier and more clear visualization and comparison of the generalized similarity measures, a limited number of α values were chosen for each measure, which are shown in Table 3.3.

Similarity measure Usedα values

PG-index (with and without Horvitz-Thompson correction) 0.1, 0.5, 1.0

I-index 0.1, 0.5, 1.0

Symmetrized R´enyi divergence 0.1, 0.5, 0.9

Table 3.3: The similarity profile α values that were used in the experiments. The flow diagrams for this experiment can be found in Figure 3.6.

Diversity profiles of repertoires and samples

In order to find out how well the diversity of a repertoire is represented by the diversity of a read sample, diversity profiles were calculated for simulated clonal frequency distributions and their read samples. Figure 3.6a shows the flow chart of the experiment set-up. The experiment was repeated for every repertoireαrep shown in Table 3.2. To calculate the diversity profiles, the α parameters over the range [0.2, 10] were used, with 50 intervals.

4 3 2 1

Cell sample

Read sample

Calculate diversity Immune  repertoire

? 100x

Power-law distribution

? αrep 

nsam

λ  nrep

(a)Experiment 1: Testing the per-formance of diversity measures on simulated read samples.

4 3 2 1

Cell sample Cell

sample

Read sample Read sample

Calculate similarity Immune  repertoire

? 100x

Power-law distribution

αrep 

nsam

λ  nrep

(b)Experiment 2: Testing the per-formance of similarity measures on simulated read samples from the same repertoire.

4 3 2 1

Cell sample Cell

sample

Read sample Read sample 100x

Calculate similarity Immune 

repertoire

? Immune  repertoire

? Power-law distribution

Power-law distribution

αrep 

nsam

λ  nrep

αran

(c)Experiment 3: Testing the per-formance of similarity measures on simulated read samples from dif-ferent repertoires.

Figure 3.6: Flow diagram for calculating the diversity (a) or similarity of simulated read frequencies from the same (b) or different (c) repertoires. The default ranges of parameter settings are given in Table 3.2. The similarity profile α’s for generalized similarity measures are listed in Table 3.3.

1. Draw clonal frequencies from a power-law distribution with a givenαrep, until the total number of cells is approximately nrep. When using multiple repertoires (c), repertoires are optionally randomized using clonal identifier randomization parameter αran.

2. Take subsamples of nsam cells.

3. Draw read frequencies for each cell from a Poisson distribution, where the expected number of reads per cell is λ.

4. a) Calculate the diversity of the read sample and the master repertoire, using a given diversity measure.

b) Calculate the similarity between read samples, using a given similarity measure.

c) Calculate the similarity between read samples, and their master repertoires, using a given similarity measure.

Similarity between reads from the same repertoire

In this experiment, the similarity scores were calculated between read frequency distributions originating from the same master repertoire. Through this, we can establish a baseline for the similarity scores of each measure. Since we know that the reads came from the same repertoire, the expected similarity score is maximal. Thus, we can compare how well the observed similarity scores reflect this, and how they are influenced by underlying parameters such as theαrep, sample size, and read amplification λ. The flow chart for this experiment is shown in Figure 3.6b.

Repertoires were simulated using power-law distributions with every αrep shown in Table 3.2.

From these repertoires, pairs of samples were taken with each sample size shown in the table, and amplified with each of the read amplification λ’s.

Similarity between reads from different repertoires

In reality we are often more interested in comparing different immune repertoires, e.g. repertoires of different cell types, or different individuals. With experimental data it is not possible to know what the ‘true’ similarity between repertoires is, since we do not have access to the full repertoire, but only a subsample. In this experiment, similarity scores are calculated between read samples from different repertoires. The aim is to measure how well the similarity measures reflect the divergence of sister repertoires, and their samples, both in terms of their clonal frequency distribution (αrep) and the randomization of their clonal identifiers (αran). Figure 3.6c shows the experiment set-up. For each value of αrep noted in Table 3.2, two repertoires were simulated.

The similarity scores of repertoire and read sample frequency distributions were calculated across every combination of repertoire αrep exponents. The experiment was repeated using every clonal identifier randomization αrandescribed in the table.

Similarity as a function of the sample size

Although the generative model gives a simplified reflection of reality, subsampling is a straightfor-ward procedure. Because of this, the patterns of changes in similarity scores due to the subsample size of simulated data are likely to accurately reflect the real effect of changing the subsample size in experimental data. Furthermore, the choice of the subsample size is something that can be controlled in an experimental setting. For experimental immunologists it is important to know how large sample sizes need to be in order to measure substantial overlap, and what biases may occur when the samples are too small. For these reasons, the experiment described in Figure 3.6c was repeated with a larger range of sample sizes. To investigate the effect of the sample size on the similarity score, samples were taken from different repertoires using sample sizes ranging from 10 to 100000, using 16 logarithmic intervals.

Similarity profiles

The generalized similarity measures (PG-index, I-index and symmetrized R´enyi divergence) can be used to calculate similarity profiles. To find out how the choice of α influences the similarity scores of each of the generalized similarity measures, and examine what additional information can be found in similarity profiles, the experiment in Figure 3.6c was repeated with a more detailed range of α values. This experiment was done for each of the clonal identifier randomization parameters in Table 3.2. For the PG-index, 50 α’s were chosen in the range [0.1, 3]. For the I-index and symmetrized R´enyi divergence, 25α’s were chosen in the ranges [0.1, 1]

and [0.1, 0.99] respectively.

4.1 Fitting power-law distributions to experimental data

To test whether the frequency distributions of HTS immune repertoire data follow a power-law distribution, the data of three previously published studies [15, 24, 25] were analyzed. As described in Section 1.4, it is important to consider alternative distributions when fitting a power-law distribution, because other distributions may exhibit similar behavior. Therefore, log-normal, exponential and Poisson distributions were fitted to the datasets, in addition to power-law distributions. Optimal xmin thresholds were estimated for each of these distributions, meaning that the distributions are only fitted to all frequency values above xmin. Subsequently, the other distribution parameters were estimated.

4.1.1 Pre- and naive mouse BCRs may obey a power law, but not plasma BCRs