ts_ancestors | R Documentation |
Extract (spatio-)temporal ancestral history for given nodes/individuals
ts_ancestors(ts, x, verbose = FALSE, complete = TRUE)
ts |
Tree sequence object of the class |
x |
Either an individual name or an integer node ID |
verbose |
Report on the progress of ancestry path generation? |
complete |
Does every individual in the tree sequence need to have
complete metadata recorded? If |
A table of ancestral nodes of a given tree-sequence node all the way up to the root of the tree sequence
init_env()
# load an example model with an already simulated tree sequence
slendr_ts <- system.file("extdata/models/introgression_slim.trees", package = "slendr")
model <- read_model(path = system.file("extdata/models/introgression", package = "slendr"))
# load the tree-sequence object from disk
ts <- ts_read(slendr_ts, model)
# find the complete ancestry information for a given individual
ts_ancestors(ts, "EUR_1", verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.