The workflow goes 1. Create a lumped trajectory for each choice of parameters A lumped trajectory is a genotype frequency trajectory in which haplotypes within a class (e.g., U haplotypes) are counted collectively rather than individually (U1, U2, etc.). The script make_lumped_trajectory.R creates a single lumped trajectory, and the script make_trajectories.sh batch runs make_lumped_trajectory.R. 2. Split each lumped trajectory into a split trajectory A split trajectory is a genotype frequency trajectory in which haplotypes within a class are counted separately (U1, U2, etc.). The script lumped_to_split.R splits a single lumped trajectory, and the script split.trajectories.sh batch runs lumped_to_split.R. 3. Create a survival probability vector for each split trajectory A survival probability vector describes the probability that a new, potentially rescuing gene convertant survives, conditional on it arising in a given generation: P(survive | arose in Gen. 1), P(survive | arose in Gen. 2), etc. The script analytic_survival.R calculates the survival probability vector for a single split trajectory, and the script calculate_survival.sh batch runs analytic_survival.R. 4. For each combination of survival probability vector and population gene conversion rate, calculate the rescue probability A rescue probability is the probability that EVERY doomed haplotype (U1, U2, etc.) BOTH creates a rescuing gene convertant AND that convertant actually survives. The script rescue_from_trajectory.R calculates the rescue probability from a single split trajectory and a single survival probability vector, and the script calculate_rescue.sh batch runs rescue_from_trajectory.R. 5. For a desired subset of parameter choices, calculate and plot the probability distribution of the number of surviving haplotypes from the split trajectories and survival probability vectors A survival probability distribution describes the probability that zero, one, two, etc. doomed haplotypes are rescued after a transition. The script outcome_distribution.R calculates and plots survival probability distributions for multiple parameter combinations, and it must be manually edited to specify parameters. 6. Create transition matrices for a subset of parameter choices A transition matrix describes the probability of transitioning from one haplotype number to another. The script transition_probs.R creates a transition matrix for a single parameter choice, and it must be manually edited to change parameters. 7. Determine and plot the long-run stable distribution of haplotype numbers, plot an example of a transition matrix, and plot a few simulated trajectories of haplotype number from a transition matrix A long-run stable distribution of haplotype numbers is the state of the system after many steps through the transition matrix Markov chain, and it is meant to estimate a stationary distribution of a Markov chain. The script long-term.R creates long-run stable distributions from transition matrices for all parameter choices used in the previous step, plots a single transition matrix as a heatmap, simulates trajectories of haplotype number using a transition matrix, and plots simulated trajectories of haplotype number