haps_phylo: Organize information to create haplotypes using phylogenetic...

View source: R/haps_functions.R

haps_phyloR Documentation

Organize information to create haplotypes using phylogenetic tree(s)

Description

This function organizes higher-level information for creating haplotypes from phylogenetic tree(s) output as phylo or multiPhylo objects (both from the ape package) or NEWICK files. Note that all phylogenetic trees must be rooted and binary. If using this function, I encourage you to cite ape. For citation information, see output from citation("ape").

Usage

haps_phylo(obj = NULL, fn = NULL)

Arguments

obj

Object containing phylogenetic tree(s). This can be (1) a single phylo object that represents all chromosomes in the genome or (2) a list or multiPhylo object containing a phylo object for each reference chromosome. In the latter case, phylogenies will be assigned to chromosomes in the order provided. Defaults to NULL.

fn

One or more string(s), each of which specifies the file name of a NEWICK file containing a phylogeny. If one name is provided, that phylogeny will be used for all chromosomes. If more than one is provided, there must be a phylogeny for each reference genome chromosome, and phylogenies will be assigned to chromosomes in the order provided. Defaults to NULL.

Details

See ?ape::write.tree for writing phylogenies to an output file.

Value

A haps_phylo_info object containing information used in create_haplotypes to create variant haplotypes. This class is just a wrapper around a list containing phylogenetic tree information for each reference chromosome, which you can view (but not change) using the object's phylo() method.


jackalope documentation built on Oct. 15, 2023, 9:06 a.m.