This script generates and annotates a collection of phylogenetic trees (a “forest”) using the jungle
library. It allows specifying the number of trees, leaves per tree, and a shape parameter controlling the tree structure. The resulting annotated forest is then saved to a compressed pickle file.
This script references the jungle
library (jg
) for phylogenetic tree generation and manipulation.
generate_annotate_forest.py
This script generates a collection of phylogenetic trees, annotates them with various features, and saves the resulting forest data structure to a file.
This script takes its input from command line arguments:
Name | Type | Description |
---|---|---|
n_leaves | int | Number of leaves (tips) in each generated tree. |
n_trees | int | Number of trees to generate for the forest. |
alpha | float | Shape parameter influencing the tree structure (2.0 for neutral, 1.0 for positive selection). |
output_dir | str | Path to the directory where the output file will be saved. |
The script generates a gzipped pickle file containing the annotated forest data structure. The file name is based on the input parameters and a unique identifier.
jungle
library to generate a forest of n_trees
trees, each with n_leaves
leaves, using the specified alpha
shape parameter.verbose
is True.Dependency | Purpose |
---|---|
jungle | Provides functionality for phylogenetic tree generation, manipulation, and analysis. |
sys | Used for accessing command line arguments. |
time | Used for tracking the script’s execution time. |
uuid | Used for generating a unique identifier for the output file. |
pickle | Used for serializing and saving the forest object. |
gzip | Used for compressing the output pickle file. |
The script’s behavior is controlled by command line arguments, as described in the “Inputs” section.
The script prints informative messages to the console if the verbose
variable is set to True
. This includes parameter values, progress updates, and timing information.
This script generates and annotates a collection of phylogenetic trees (a “forest”) using the jungle
library. It allows specifying the number of trees, leaves per tree, and a shape parameter controlling the tree structure. The resulting annotated forest is then saved to a compressed pickle file.
This script references the jungle
library (jg
) for phylogenetic tree generation and manipulation.
generate_annotate_forest.py
This script generates a collection of phylogenetic trees, annotates them with various features, and saves the resulting forest data structure to a file.
This script takes its input from command line arguments:
Name | Type | Description |
---|---|---|
n_leaves | int | Number of leaves (tips) in each generated tree. |
n_trees | int | Number of trees to generate for the forest. |
alpha | float | Shape parameter influencing the tree structure (2.0 for neutral, 1.0 for positive selection). |
output_dir | str | Path to the directory where the output file will be saved. |
The script generates a gzipped pickle file containing the annotated forest data structure. The file name is based on the input parameters and a unique identifier.
jungle
library to generate a forest of n_trees
trees, each with n_leaves
leaves, using the specified alpha
shape parameter.verbose
is True.Dependency | Purpose |
---|---|
jungle | Provides functionality for phylogenetic tree generation, manipulation, and analysis. |
sys | Used for accessing command line arguments. |
time | Used for tracking the script’s execution time. |
uuid | Used for generating a unique identifier for the output file. |
pickle | Used for serializing and saving the forest object. |
gzip | Used for compressing the output pickle file. |
The script’s behavior is controlled by command line arguments, as described in the “Inputs” section.
The script prints informative messages to the console if the verbose
variable is set to True
. This includes parameter values, progress updates, and timing information.