This function organizes higher-level information for creating haplotypes from gene trees output from coalescent simulations. Note that all gene trees must be rooted and binary.

haps_gtrees(obj = NULL, fn = NULL)

write_gtrees(gtrees, out_prefix)

Arguments

obj

Object containing gene trees. This can be one of the following: (1) A single list with a trees field inside. This field must contain a set of gene trees for each chromosome. (2) A list of lists, each sub-list containing a trees field of length 1. The top-level list must be of the same length as the number of chromosomes. Defaults to NULL.

fn

A single string specifying the name of the file containing the ms-style coalescent output with gene trees. Defaults to NULL.

gtrees

A haps_gtrees_info object output from haps_gtrees.

out_prefix

Prefix for the output file of gene trees. The extension will be .trees.

Value

A haps_gtrees_info object containing information used in create_haplotypes

to create variant haplotypes. This class is just a wrapper around a list of NEWICK tree strings, one for each gene tree, which you can view (but not change) using the object's trees() method.

Details

Using the obj argument is designed after the trees fields in the output from the scrm and coala packages. (These packages are not required to be installed when installing jackalope.) To get gene trees, make sure to add + sumstat_trees() to the coalmodel for coala, or make sure that "-T" is present in args for scrm. If using either of these packages, I encourage you to cite them. For citation information, see output from citation("scrm") or citation("coala").

If using an output file from a command-line program like ms/msms, add the -T option.

Functions

  • write_gtrees(): Write gene trees to ms-style output file.