Follows every haplogroup's path from the root of the tree and records, for
each requested site, whether the haplogroup's haplotype differs from the
root (RSRS) there. Back-mutations are applied as Haplogrep defines them
(they undo the latest change at that site), so a site gained and later
reverted on a lineage is not carried below the reversion. Insertions are
tracked as their own sites ("573.X", "2491.1"), separate from
substitutions at the same position; a deletion counts as carried.
Usage
haplotypeMatrix(
haplogroups,
sites = NULL,
tree = dimoose::phylotree17,
mutations = dimoose::phylotree17_mutations
)Arguments
- haplogroups
Haplogroup names, one per row of the result; repeats are allowed (e.g. one per sample).
- sites
Sites to report: positions as character (
"16311") or insertion sites ("573.X"). Defaults to the sites ofrecurrentPositions().- tree, mutations
The tree and its mutations; default phylotree17 and phylotree17_mutations.
treeneedshaplogroup,parentanddepth;mutationsneedshaplogroup,notation,position,type,ancestralandderived.