Modeling distribution of cellular aggregation using braching processes

from Brown, Cornell, et al. 2006

Author

Haowen He

Published

March 18, 2024

1 Density-dependent lysis and fission model

In this analysis, we assume that cells lysis does not instantaneously occur at a threshold, instead, it takes place at a given rate \mu_n, depending on the size of cell aggregates n. We also assume that cell division (fission) rate is density-independent, with \alpha being the per-capita splitting rate for a cell in an aggregate. The forward equation for the total number M_n of aggregates with n cells at time t is

dM_n = \left(\alpha_{n-1} \left(n-1\right) M_{n-1} - \alpha_n n M_n - \mu_n M_n\right) dt, \text{ for } 1 < n < N,

and the total number M_1 of singletons at time t is

dM_1 = \left(\sum^N_{j=1} j \mu_jM_j - \alpha_1 M_1\right) dt,

where N is the maximum aggregate size, dM_1 is the number of new singletons at each time step dt, and dM_n is the number of new cells aggregates of siez n for 1 < n < N.

1.1 Set up simulation parameters

Simulation parameters (Initial number of singletons is set to 100)
step size dt division rate \alpha to test lysis rate \mu
t_0 = 0 : 0.1 : 100 = t_f 0 : 0.1 : 1 \mu_1 = 0.001 : 0.001 : 0.019 = \mu_n

1.2 Distribution of aggregate size in 3D

?@fig-AggregateSizeDistribution shows clear differences in the shapes of the distributions in populations from low to high division rates. The first row has a small maximum aggregate size (N = 10), and we can see that as the division rate increases from low to high (left to right), the number of aggregates are decreasing. The second row has a large maximum aggregate size (N = 50), and as the division rate increases from low to high, the aggregates are more likely to be larger, as we observe populations of larger aggregates when division rate is high.

Aggregate size distribution at each time point. Figures A-C: Maximum aggregate size is small (N = 10). From left to right: low division rate to high division rate. Figuress D-F: Maximum aggregate size is large (N = 50). From left to right: low division rate to high division rate.

1.3 Moments statistics

?@fig-FirstFourMoments shows the first four moments of the aggregate size distribution over time given different division rate. Given low division rate (\alpha = 0.1, 0.2), the average aggregate size is large and a lot more variable, growing exponentially over time. Given high division rate (\alpha = 0.3, 0.4, 0.5), the average aggregate size is small (approximately 1 cell), meaning the population is predominantly singleton. Now looking at the skewness and kurtosis to quantify asymmetry, in all cases of division rates, we see that the distribution is highly left skewed. This means that the majority of aggregates are small or singletons, and the distribution has a longer tail extending towards large-sized aggregates. In all cases, skewness appears to stabilize with higher skewness in the lower division rate. We see a similar trend with kurtosis in time. We observe constantly higher skewness and kurtosis over time in lower division rates, possibly due to the density-dependent lysis rate

First four moments of the aggregate size distribution over time. Figure A: mean, figure B: standard deviation, figure C: skewness, and figure D: kurtosis. Different colors of lines indicate moment statistics associated with different division rates.

1.4 Proportional changes over division rates

?@fig-ProportionChanges shows proportion of singletons (blue line) as compared to proportion of cells in aggregates (red line) over division rates. As expected, when the division rate increases from low to high, the proportion of cells in aggregates increases, and the proportion of singletons decreases accordingly. At approximately \alpha = 0.3, very few cells remain planktonic, and most of the cells are in aggregates. The proportional changes of cell in aggregates as well as singletons become stationary then.

Proportion of singletons vs. proportion of cells in aggregates over division rates.

1.5 Simulation codes

Code
# install and import necessary packages
import Pkg
Pkg.add("Plots")
Pkg.add("StatsBase")
Pkg.add("LaTeXStrings")

using Plots
using Statistics
using LaTeXStrings

#--- simulation parameters ---$

# max aggregate size
N = 20      
# lysis rate
u = 0.001:0.001:0.019      

# time step size
t0 = 1
tf = 10
dt = 0.001
times = t0:dt:tf

# initial conditions
A = zeros(length(times), N-1)
# initial number of singletons
A[1, 1] = 10  

# initial division rate
R = 0:0.1:1

# keep track of proportion of aggregates vs singletons
part = zeros(length(R), 2)

# initialize a dictionary to store the matrices
matrices_dict = Dict()

for (i, r) in enumerate(R)
    # run simulation
    for t in 1:length(times)-1

        # check for negative number of aggregates
        A[A .< 0] .= 0

        # save current time for calculation
        At = copy(A[t, :])

        # update singletons for new time
        dA1 = (sum((2:N) .* u .* At[1:N-1]) - r * At[1]) * dt
        A[t+1, 1] = At[1] + dA1

        # update aggregates for new time
        for n in 2:N-1
            dAn = (r * (n-1) * At[n-1] - r * n * At[n] - u[n] * At[n]) * dt
            A[t+1, n] = At[n] + dAn
        end
        
    # assign the matrix to a different name in the dictionary
    matrices_dict["matrix_$i"] = A
    
    end
    
    # calculate proportion of singletons vs. cells in aggregates
    pcount = A[end, 1]
    acount = sum(A[end, 2:end] .* (2:N-1))

    part[i, 1] = pcount / (pcount + acount)
    part[i, 2] = acount / (pcount + acount)
    
end

# plot proportion of cells that are singletons vs. aggregates
using Plots
plotly()  

# proportion plot
plot(R, part[:, 1], label="singletons", 
     color="#4E6691", xlabel="division rate", ylabel="proportion of cells", 
     lw=2, legend=:right, legendoutside=true)
plot!(R, part[:, 2], label="aggregates", 
      color="#B8474D", xlabel="division rate", ylabel="proportion of cells", 
      lw=2, legend=:right, legendoutside=true)

# plot simulation results
# aggregates of size n over time
plot_aggregates = plot(layout=(1, 3), size=(900, 300))
for n in 1:N-1
    plot!(times, A[:, n], label="n=$n")
end
xlabel!("time")
ylabel!("# of aggregates of size n")

# distribution of aggregate size at t=tf (including singletons)
plot_distribution_all = plot(A[end, :], xlabel="n", 
                             ylabel="# of aggregates of size n", 
                             title="Distribution of aggregate size at t=tf (including planktonic)")

# distribution of aggregate size at t=tf (excluding singletons)
plot_distribution_aggregates = plot(A[end, 2:end], xlabel="n", 
                                    ylabel="# of aggregates of size n", 
                                    title="Distribution of aggregate size at t=tf")

plot(plot_aggregates, plot_distribution_all, plot_distribution_aggregates, layout=(1, 3))

# plot moments statistics
for matrix in matrices_dict
    matrix_to_use = matrix[:, 2:end]
    mean = [mean(row) for row in eachrow(matrix_to_use)]
    plot!(mean, line = ("#DACCDD", 3);
          xlabel = "Time", ylabel = "Mean"))
end

for matrix in matrices_dict
    matrix_to_use = matrix[:, 2:end]
    std_dev = [std(row) for row in eachrow(matrix_to_use)]
    plot!(std_dev, line = ("#E88A6D", 3);
          xlabel = "Time", ylabel = "Standard deviation"))
end

for matrix in matrices_dict
    matrix_to_use = matrix[:, 2:end]
    skewness = [StatsBase.skewness(row) for row in eachrow(matrix_to_use)]
    plot!(skewness, line = ("#440154", 3);
          xlabel = "Time", ylabel = "Skewness"))
end

for matrix in matrices_dict
    matrix_to_use = matrix[:, 2:end]
    kurtosis = [kurtosis(row) for row in eachrow(matrix_to_use)]
    plot!(kurtosis, line = ("#FFFAD3", 3);
          xlabel = "Time", ylabel = "Kurtosiss"))
end