diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index d561f9b..dc3b883 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/phylojunction.data.doctree b/docs/build/doctrees/phylojunction.data.doctree index 59e5a0d..c23889c 100644 Binary files a/docs/build/doctrees/phylojunction.data.doctree and b/docs/build/doctrees/phylojunction.data.doctree differ diff --git a/docs/build/doctrees/phylojunction.distribution.doctree b/docs/build/doctrees/phylojunction.distribution.doctree index 1baf481..10f01a4 100644 Binary files a/docs/build/doctrees/phylojunction.distribution.doctree and b/docs/build/doctrees/phylojunction.distribution.doctree differ diff --git a/docs/build/doctrees/phylojunction.interface.grammar.doctree b/docs/build/doctrees/phylojunction.interface.grammar.doctree index 6178bb6..c6c42ad 100644 Binary files a/docs/build/doctrees/phylojunction.interface.grammar.doctree and b/docs/build/doctrees/phylojunction.interface.grammar.doctree differ diff --git a/docs/build/doctrees/phylojunction.pgm.doctree b/docs/build/doctrees/phylojunction.pgm.doctree index 525c9e7..8baee79 100644 Binary files a/docs/build/doctrees/phylojunction.pgm.doctree and b/docs/build/doctrees/phylojunction.pgm.doctree differ diff --git a/docs/build/doctrees/phylojunction.readwrite.doctree b/docs/build/doctrees/phylojunction.readwrite.doctree index bd6cbcc..72ff39f 100644 Binary files a/docs/build/doctrees/phylojunction.readwrite.doctree and b/docs/build/doctrees/phylojunction.readwrite.doctree differ diff --git a/docs/build/doctrees/phylojunction.utility.doctree b/docs/build/doctrees/phylojunction.utility.doctree index 64be222..7993b49 100644 Binary files a/docs/build/doctrees/phylojunction.utility.doctree and b/docs/build/doctrees/phylojunction.utility.doctree differ diff --git a/docs/build/html/_images/bd_graphical_model_manual.png b/docs/build/html/_images/bd_graphical_model_manual.png deleted file mode 100644 index 209598e..0000000 Binary files a/docs/build/html/_images/bd_graphical_model_manual.png and /dev/null differ diff --git a/docs/build/html/_sources/pjdoc/parametric.rst.txt b/docs/build/html/_sources/pjdoc/parametric.rst.txt index 70e3dae..e06f0c2 100644 --- a/docs/build/html/_sources/pjdoc/parametric.rst.txt +++ b/docs/build/html/_sources/pjdoc/parametric.rst.txt @@ -5,7 +5,7 @@ On this page you will find examples of how to invoke the available distributions Uniform ------- -The function for assigning a uniform (``uniform``) distribution to a variable has four parameters: +The function for assigning a uniform (``uniform``) distribution to a random variable has four parameters: | ``n`` (integer, optional): Number of samples to draw (samples are i.i.d.). Defaults to 1. | ``nr``` (integer, optional): Number of replicates to draw per sample. Defaults to 1. @@ -20,7 +20,7 @@ The function for assigning a uniform (``uniform``) distribution to a variable ha Exponential ----------- -The function for assigning a exponential (``exponential``) distribution to a variable has four parameters: +The function for assigning a exponential (``exponential``) distribution to a random variable has four parameters: | ``n`` (integer, optional): Number of samples to draw (samples are i.i.d.). Defaults to 1. | ``nr`` (integer, optional): Number of replicates to draw per sample. Defaults to 1. @@ -35,7 +35,7 @@ The function for assigning a exponential (``exponential``) distribution to a var Gamma ----- -The function for assigning a gamma (``gamma``) distribution to a variable has five parameters: +The function for assigning a gamma (``gamma``) distribution to a random variable has five parameters: | ``n`` (integer, optional): Number of samples to draw (samples are i.i.d.). Defaults to 1. | ``nr`` (integer, optional): Number of replicates to draw per sample. Defaults to 1. @@ -51,7 +51,7 @@ The function for assigning a gamma (``gamma``) distribution to a variable has fi Normal ------ -The function for assigning a normal (``normal``) distribution to a variable has four parameters: +The function for assigning a normal (``normal``) distribution to a random variable has four parameters: | ``n`` (integer, optional): Number of samples to draw (samples are i.i.d.). Defaults to 1. | ``nr`` (integer, optional): Number of replicates to draw per sample. Defaults to 1. @@ -66,12 +66,12 @@ The function for assigning a normal (``normal``) distribution to a variable has Log-normal ---------- -The function for assigning a log-normal (``lognormal``) distribution to a variable has five parameters: +The function for assigning a log-normal (``lognormal``) distribution to a random variable has five parameters: | ``n`` (integer, optional): Number of samples to draw (samples are i.i.d.). Defaults to 1. | ``nr`` (integer, optional): Number of replicates to draw per sample. Defaults to 1. - | ``mean`` (real, required): Mean (location) of distribution. - | ``sd`` (positive real, required): Standard deviation (scale) of distribution. + | ``meanlog`` (real, required): Mean (location) of distribution over the logarithm of the random variable. + | ``sdlog`` (positive real, required): Standard deviation (scale) of distribution over the logarithm of the random variable. | ``log_space`` (string boolean, optional): Whether the value of ``mean`` is in log-space. Defaults to "true". .. code-block:: diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 6b35746..bd14c41 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -110,8 +110,12 @@

A

  • add_within_hpd_col() (in module phylojunction.plotting.pj_organize)
  • -
  • age (phylojunction.data.sampled_ancestor.SampledAncestor attribute) +
  • age (phylojunction.data.attribute_transition.AttributeTransition attribute) + +
  • alternative_root_label (phylojunction.data.tree.AnnotatedTree attribute)
  • ANAGENETIC_TRANSITION (phylojunction.calculation.discrete_sse.MacroevolEvent attribute) @@ -305,6 +309,8 @@

    D

  • dump_pgm_data() (in module phylojunction.readwrite.pj_write)
  • dump_serialized_pgm() (in module phylojunction.readwrite.pj_write) +
  • +
  • dump_trees_rb_smap_dfs() (in module phylojunction.readwrite.pj_write)
  • @@ -418,7 +424,7 @@

    G

  • get_display_str_by_name() (phylojunction.pgm.pgm.DirectedAcyclicGraph method)
  • -
  • get_ellapsed_time_in_minutes() (in module phylojunction.utility.helper_functions) +
  • get_ellapsed_time_in_seconds() (in module phylojunction.utility.helper_functions)
  • get_exponential_rev_inference_spec_info() (in module phylojunction.inference.revbayes.rb_dn_parametric)
  • @@ -1445,6 +1451,8 @@

    R

  • rec_str() (phylojunction.data.tree.AnnotatedTree method)
  • rec_tr_at_dict (phylojunction.data.tree.AnnotatedTree attribute) +
  • +
  • rec_tr_clado_at_dict (phylojunction.data.tree.AnnotatedTree attribute)
  • rec_tr_root_age (phylojunction.data.tree.AnnotatedTree attribute)
  • diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index c22f710..6952794 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/phylojunction.data.html b/docs/build/html/phylojunction.data.html index ee4a6b4..067c297 100644 --- a/docs/build/html/phylojunction.data.html +++ b/docs/build/html/phylojunction.data.html @@ -106,8 +106,13 @@

    Submodules

    phylojunction.data.attribute_transition module

    -class phylojunction.data.attribute_transition.AttributeTransition(attr_label: str, subtending_node_label: str, global_time: float, from_state: int, to_state: int, to_state2: int | None = None, at_speciation: bool = False)
    +class phylojunction.data.attribute_transition.AttributeTransition(attr_label: str, subtending_node_label: str, global_time: float, from_state: int, to_state: int, age: float | None = None, to_state2: int | None = None, at_speciation: bool = False)

    Bases: object

    +
    +
    +age: float
    +
    +
    at_speciation: bool | None
    @@ -160,7 +165,7 @@

    Submodules

    phylojunction.data.sampled_ancestor module

    -class phylojunction.data.sampled_ancestor.SampledAncestor(label: str, lineage_node_label: str, global_time: float, age: float = None, state: int = 0, time_to_lineage_node: float = -1.0)
    +class phylojunction.data.sampled_ancestor.SampledAncestor(label: str, lineage_node_label: str, global_time: float, age: float | None = None, state: int = 0, time_to_lineage_node: float = -1.0)

    Bases: object

    @@ -626,6 +631,11 @@

    Submodulesrec_tr_at_dict: Dict[str, List[AttributeTransition]] | None

    +
    +
    +rec_tr_clado_at_dict: Dict[str, AttributeTransition] | None
    +
    +
    rec_tr_root_age: float
    @@ -714,12 +724,15 @@

    Submodules
    update_rec_tr_at_dict(rec_tree_root_nd: Node) None
    -

    Update ‘rec_tr_at_dict’ member.

    +

    Update ‘rec_tr_at_dict’ and ‘rec_clado-at_dict’ members.

    The ‘at_dict’ member of the AnnotatedTree, when defined, will by default host the state transitions of every node of the complete -tree. This method initializes ‘rec_trat_dict’ so that it reflects the -reconstructed tree – it is only called when necessary, -by the ‘extract_reconstructed_tree’ method.

    +tree. This method initializes ‘rec_tr_at_dict’ so that it +reflects the reconstructed tree – it is only called when +necessary, by the ‘extract_reconstructed_tree’ method.

    +

    Member ‘rec_tr_clado_at_dict’ is also updated. Internal nodes +undergoing cladogenetic changes that are in the complete tree +but not in the reconstructed tree are removed.

    diff --git a/docs/build/html/phylojunction.distribution.html b/docs/build/html/phylojunction.distribution.html index eec51d6..4bcf87b 100644 --- a/docs/build/html/phylojunction.distribution.html +++ b/docs/build/html/phylojunction.distribution.html @@ -106,7 +106,7 @@

    Submodules

    phylojunction.distribution.dn_discrete_sse module

    -class phylojunction.distribution.dn_discrete_sse.DnSSE(sse_stash: SSEStash, n: int = 1, n_replicates: int = 1, origin: bool = True, start_states_list: List[int] = [], stop: str = '', stop_value: List[float] = [], condition_on_speciation: bool = False, condition_on_survival: bool = True, condition_on_obs_both_sides_root: bool = False, min_rec_taxa: int = 0, max_rec_taxa: int = 1000000000000, abort_at_alive_count: int = 1000000000000, epsilon: float = 1e-12, runtime_limit: int = 5, max_n_failed_attempts: int = 200, rng_seed: int | None = None, debug: bool | None = False, info: bool | None = False)
    +class phylojunction.distribution.dn_discrete_sse.DnSSE(sse_stash: SSEStash, n: int = 1, n_replicates: int = 1, origin: bool = True, start_states_list: List[int] = [], stop: str = '', stop_value: List[float] = [], condition_on_speciation: bool = False, condition_on_survival: bool = True, condition_on_obs_both_sides_root: bool = False, min_rec_taxa: int = 0, max_rec_taxa: int = 1000000000000, abort_at_alive_count: int = 1000000000000, epsilon: float = 1e-12, runtime_limit: int = 300, max_n_failed_attempts: int = 200, rng_seed: int | None = None, debug: bool | None = False, info: bool | None = False)

    Bases: DistrForSampling

    Discrete SSE distribution.

    Class for the discrete state-dependent speciation and extinction @@ -190,9 +190,9 @@

    SubmodulesSubmodules
  • phylojunction.data.attribute_transition module
  • diff --git a/docs/build/html/phylojunction.pgm.html b/docs/build/html/phylojunction.pgm.html index 70e1c59..273bc3e 100644 --- a/docs/build/html/phylojunction.pgm.html +++ b/docs/build/html/phylojunction.pgm.html @@ -133,7 +133,7 @@

    Submodules
    -plot_node(axes: Axes, sample_idx: int | None = 0, repl_idx: int | None = 0, repl_size: int | None = 1, branch_attr: str | None = 'state') None
    +plot_node(axes: Axes, sample_idx: int | None = 0, repl_idx: int | None = 0, repl_size: int | None = 1, branch_attr: str | None = 'state', draw_reconstructed: bool | None = False) None

    diff --git a/docs/build/html/phylojunction.readwrite.html b/docs/build/html/phylojunction.readwrite.html index b1dda2f..69e5cfc 100644 --- a/docs/build/html/phylojunction.readwrite.html +++ b/docs/build/html/phylojunction.readwrite.html @@ -292,6 +292,11 @@

    Submodules +
    +phylojunction.readwrite.pj_write.dump_trees_rb_smap_dfs(dir_string: str, dag_obj: DirectedAcyclicGraph, tr_dag_node_name_list: List[str], mapped_attr_name: str, prefix: str = '') None
    +

    +
    phylojunction.readwrite.pj_write.get_write_inference_rev_scripts(all_sims_model_spec_list: List[str], all_sims_mcmc_logging_spec_list: List[str], dir_list: List[str], prefix: str = '', write2file: bool = False) List[str]
    @@ -436,12 +441,40 @@

    Submodules
    -phylojunction.readwrite.pj_write.prep_trees_rb_smap_dfs(dag_obj: DirectedAcyclicGraph) DataFrame
    +phylojunction.readwrite.pj_write.prep_trees_rb_smap_dfs(dag_obj: DirectedAcyclicGraph, tree_dag_node_name_list: List[str], mapped_attr_name: str) Tuple[Dict[str, List[DataFrame]], Dict[str, List[str]]]

    Initialize pandas DataFrame’s for holding stochastic maps.

    Each dataframe will hold stochastic maps for all nodes for all (replicate) trees in a single sample. Each iteration will correspond to a single replicate.

    -

    Returns:

    +
    +
    Parameters:
    +
      +
    • dag_obj (DirectedAcyclicGraph) – Instance of DAG class, holding +the model.

    • +
    • tree_dag_node_name_list (list) – List with names of the DAG nodes +tree random variables along which attributes have +transitioned and for which we are producing a stochastic +mapping dataframe.

    • +
    • mapped_attr_name (str) – Name of the attribute being +stochastically mapped. E.g., ‘state’.

    • +
    +
    +
    Returns:
    +

    +
    A tuple with two dictionaries. The keys of both

    dictionaries are DAG node names. The values are lists. +Inside the lists of one are pandas DataFrame instances +with all replicates per sample in a single dataframes +(and one dataframe per sample). In the lists of the other +dictionary’s values are lists of strings with the contents +of the dataframes (used for unit testing).

    +
    +
    +

    +
    +
    Return type:
    +

    (tuple)

    +
    +

    @@ -454,12 +487,10 @@

    SubmodulesReturns: -

    None

    -

    diff --git a/docs/build/html/phylojunction.utility.html b/docs/build/html/phylojunction.utility.html index d00b92c..61fc077 100644 --- a/docs/build/html/phylojunction.utility.html +++ b/docs/build/html/phylojunction.utility.html @@ -950,9 +950,9 @@

    Submodules -
    -phylojunction.utility.helper_functions.get_ellapsed_time_in_minutes(start: float, end: float) int
    -

    Calculate ellapsed time

    +
    +phylojunction.utility.helper_functions.get_ellapsed_time_in_seconds(start: float, end: float) int
    +

    Calculate ellapsed time in seconds.

    Parameters: