Skip to contents

Function to generate an annotated edge matrix with transition data

Usage

get_continuation_data(parent_child_df, node_states)

Arguments

parent_child_df

Dataframe with ancestral and tip states

node_states

Whether to perform "joint" or "marginal" reconstruction. Default: joint

Value

Annotated parent child dataframe with transition data. In this coding, 1 == yes and 0 == no. If marginal states were requested, 0.5 = unsure.

transition

Whether the parent and child nodes do not have the same value

gain

Whether a gain event occured (i.e., child had value, but parent did not)

loss

Whether a loss event occured (i.e., parent had value, but child did not)

continuation

Whether a continuation event occurrent (i.e., parent and child have same value)

continuation_present

Continuation event where parent and child had the trait

continuation_absent

Continuation event where parent and child did not have the trait

If node_states == 'marginal', the following additional values will be returned

transition_high

Transition event where both states were confident (i.e., 0 -> 1) per the MLE confidence threshold

transition_low

Transition event where one state was confident and other was unsure (i.e., 0 -> 0.5))

gain_high

Gain event where both states were confident (i.e., 0 -> 1)

gain_low

Gain event where parental value was unsure )i.e., 0.5 -> 1

loss_high

Loss event where both sattes were confident (i.e., 1 -> 0)

loss_low

Loss event where parental value was unsure (i.e., 0.5 -> 0)

continuation_high

Continuation event where parent and child had confident state inferences (i.e., 1 -> 1)

continuation_low

Continuation event where parent and child had unsure state inferences (e.g., 0.5 -> 0.5)