High-level description
TheSequentialLineageTracingDataSimulator class simulates lineage tracing data generated by sequential Cas9-based technologies, such as the DNA Typewriter. It overlays simulated edits onto a CassiopeiaTree, mimicking the sequential recording process of these technologies. The simulator considers factors like initiation and continuation rates of Cas9 recording, cassette architecture, state distributions, and silencing rates to generate realistic data.
Code Structure
TheSequentialLineageTracingDataSimulator class inherits from the LineageTracingDataSimulator class. It primarily implements the overlay_data method, which simulates the sequential editing process on the provided CassiopeiaTree. The class also includes helper functions like edit_site and silence_cassettes to manage individual editing events and cassette silencing, respectively.
References
cassiopeia.data.CassiopeiaTree: The simulator operates on aCassiopeiaTreeobject, modifying its character states to represent the simulated lineage tracing data.cassiopeia.simulator.LineageTracingDataSimulator: This class inherits from theLineageTracingDataSimulatorclass, providing a framework for simulating lineage tracing data.
Symbols
SequentialLineageTracingDataSimulator
Description
This class simulates sequential Cas9-based lineage tracing data and overlays it onto aCassiopeiaTree. It models the sequential editing process on a “DNA tape” or “cassette” where only one site can be edited at a time.
Inputs
Outputs
This class doesn’t directly return any output. It modifies the providedCassiopeiaTree in place.
Internal Logic
The simulator initializes a character matrix representing the cassettes and their states. It then iterates through each node in the tree, simulating the editing process based on the node’s lineage and lifetime. For each cassette, it determines if it’s initiated and simulates edits based on the continuation rate. It also applies heritable and stochastic silencing to the cassettes, mimicking real-world data variability. Finally, it updates theCassiopeiaTree with the simulated character matrix.
overlay_data
Description
This method overlays the simulated Cas9-based lineage tracing data onto the providedCassiopeiaTree.
Inputs
Outputs
This method doesn’t return any output. It modifies the inputCassiopeiaTree in place.
Internal Logic
The method first initializes a character matrix with all sites set to an unedited state. It then traverses the tree in depth-first order. For each node, it simulates the Cas9 editing process based on the node’s lifetime and the parent’s character state. It then applies heritable and stochastic silencing to the character array. Finally, it updates theCassiopeiaTree with the simulated character matrix.
