plastro.lineage_simulation.introduce_crispr_mutations
- plastro.lineage_simulation.introduce_crispr_mutations(tree: TreeNode, number_of_cassettes: int = 100) cassiopeia.data.CassiopeiaTree[source]
Simulate CRISPR mutations on a phylogenetic tree.
Uses Cassiopeia’s mutation simulation to add realistic CRISPR-based lineage tracing mutations to the tree structure.
- Parameters:
tree (ete3.Tree) – Phylogenetic tree to add mutations to.
number_of_cassettes (int, optional) – Number of mutation sites, by default 100 so we can accurately resolve lineage relationships.
- Returns:
Tree with simulated character matrix containing mutation data.
- Return type:
cassiopeia.data.CassiopeiaTree
Examples
>>> from ete3 import Tree >>> tree = Tree("((A,B),C);") >>> cass_tree = introduce_crispr_mutations(tree) >>> print(cass_tree.character_matrix.shape)
Notes
This function requires the Cassiopeia package for mutation simulation. The resulting character matrix will have cells as rows and mutation sites as columns, with values representing different mutation states.