Skip to contents

Parses the nested <haplogroup> XML that Haplogrep distributes (for example phylotree-rcrs-17's tree.xml) into the same data frame shape as phylotree17, so any Haplogrep tree can be loaded, not just the bundled snapshot. Each haplogroup's <details><poly> entries become its mutations.

Usage

readHaplogrep(file, key = FALSE)

Arguments

file

Path to the tree XML.

key

If TRUE, return a dimoose key built with keyFromLeads() instead of the data frame.

Value

A data frame with haplogroup, parent, depth, n_subclades and mutations, or a dimoose object if key = TRUE.

Examples

if (FALSE) { # \dontrun{
tree <- readHaplogrep("tree.xml")
} # }