genome¶
Simulation of whole genomes and proteomes.
genome_simulation
¶
Module for the simulation of genomes.
GenomeSimulator
¶
Class for the simulation of genomes.
Source code in asymmetree/genome/genome_simulation.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
__init__(species_tree: Tree, outdir: str | Path = None) -> None
¶
Constructor for the GenomeSimulator class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
species_tree
|
Tree
|
The species tree along which gene trees are simulated. |
required |
outdir
|
str | Path
|
The path to a directory into which the results of the simulation (serialized trees, one fasta file per genome, one 'true' alignment per gene family). The default is None, in which case nothing is saved to file. |
None
|
Source code in asymmetree/genome/genome_simulation.py
simulate_gene_trees(n: int, **kwargs)
¶
Simulate gene trees.
Simulates the 'true gene trees' which still contain the loss events as well as the 'pruned gene trees' in which the loss branches are removed.
For the parameters of the simulation, see function 'gene_trees' in 'treeevolve' subpackage or documentation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Number of gene trees to be simulated. |
required |
Source code in asymmetree/genome/genome_simulation.py
simulate_sequences(subst_model: SubstModel, root_genome: list | None = None, length_distr: tuple | Sampler = ('constant', 200), min_length: int = 10, max_length: int | None = None, write_fastas: bool = True, write_alignments: bool = True, **kwargs) -> None
¶
Simulate sequences along the (pruned) gene trees.
For the additional parameters of the simulation, see class 'Evolver' in the 'seqevolve' subpackage or documentation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subst_model
|
SubstModel
|
Substitution model. |
required |
root_genome
|
list | None
|
List of sequences for the roots of the gene trees, must contain the same number of str sequences as trees that were simulated. The default is None, in which case new sequences are generated at random. The sequences must be compatible with the specified substitution model (model_type='n'/'a'). |
None
|
length_distr
|
tuple | Sampler
|
Distribution of the length of the root sequences if root genome is not supplied. See documentation for available options. |
('constant', 200)
|
min_length
|
int
|
Minimal length at which the distribution of lengths is truncated. Must be less than the mean of this distribution. |
10
|
max_length
|
int | None
|
Maximal length at which the distribution of lengths is truncated. Must be less than the mean of this distribution. The default is None, in which case the distribution is not truncated. |
None
|
write_fastas
|
bool
|
If True and an output directory was specified, write the sequences (one file per species) into the directory 'fasta_files' in the output directory. |
True
|
write_alignments
|
bool
|
If True and an output directory was specified, write the true alignments (one file per gene tree) into the directory 'alignments' in the output directory. |
True
|