haps_gtrees {jackalope} | R Documentation |
Organize information to create haplotypes using gene trees
Description
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.
Usage
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 |
fn |
A single string specifying the name of the file containing
the |
gtrees |
A |
out_prefix |
Prefix for the output file of gene trees.
The extension will be |
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.
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.
Functions
-
write_gtrees()
: Write gene trees to ms-style output file.