Buyancy / LlpsSim

Liquid-liquid phase separation simulation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LlpsSim

This repository contains a liquid-liquid phase separation simulation for analyzing how different interaction matrices effect the number of phases that can be produced.

This code is based on the paper Evolved interactions stabilize many coexisting phases in multicomponent liquids and uses a similar technique for determining the number of phases that a given interaction matrix can produce.

Overview

Here I use a the same simulation algorithm used in the above paper to simulate each starting condition to a final, stable state, using a matrix $\chi$ containing the interaction strengths between the components. Then, I use a higherarchical clustering algorithm to identify the number of distinct states from the samples generated by multiple iterations of the simulation. This helps us characterize how the different components, represented by $\chi$, behave with respect to phase separation.

Basically:

  1. Run the simulation on a bunch of random starting conditions to get a bunch of samples of final states.
  2. Perform a higherarchical clustering of the final states to compute the number of phases present for the given interaction matrix.
  3. Use the phase counts to characterize the probability distribution of the number of phases produced for the given interaction matrix.

The "starting conditions" of the simulation is a set of $N+1$ volume fractions with random amounts of each component in them. These are simulated to a final "end state" where the component fractions in each volume are stable.

Component Simulation

The simulation takes an initial start state and simulates the dynamics of the change in the different components over time until a stable state is reached. Then the final concentrations of each phase are recorded. The simulation is progressed iteratively using the equation

$\partial_{\hat t}\phi^{(n)}_i = \phi^{(n)}_i \sum_{m=1}^M \left[ \phi^{(m)}_i \left( \hat{\mu_i}^{(m)} - \hat{\mu_i}^{(n)} \right) + \hat P^{(m)} - \hat P^{(n)} \right]$

to update the different component volumes over time until they converge to a steady state.

If you want details about the derivation, then definately go read the paper, they explain it much better than I could.

Usage

The library can be used in scripts but it is intended to be used in the following way on the REPL:

julia> using LlpsSim, Statistics
[ Info: Precompiling LlpsSim [0bc873b6-c522-4845-a95e-a4d541d9658e]

julia> χ = generate_random_interaction_matrix(5, 2.0, 2.0)
5×5 Matrix{Float64}:
  0.0       2.71539  -0.204025  -1.462     6.73549
  2.71539   0.0       3.09666    1.34214   6.63846
 -0.204025  3.09666   0.0        0.104928  0.748687
 -1.462     1.34214   0.104928   0.0       1.60546
  6.73549   6.63846   0.748687   1.60546   0.0

julia> samples = sample_phase_counts(χ, 64)
64-element Vector{Int64}:
2
3
⋮
2
2

julia> mean(samples)
2.09375

Future Work

Moving forward, I plan on using directed evolution to determine if it is theroretically possible for cells to evolve specific types of dynamics with respect to phase separation.

Refrences

The code here is based off of this (https://github.com/zwicker-group/paper-multicomponent-evolution) github repository which is associated with this (Evolved interactions stabilize many coexisting phases in multicomponent liquids) paper.

About

Liquid-liquid phase separation simulation.


Languages

Language:Julia 100.0%