get.fitch.n.mts: Caclulate parsimony scores.

View source: R/fitch.R

get.fitch.n.mtsR Documentation

Caclulate parsimony scores.

Description

Determine parsimony scores for all genetic loci, or a phenotypic variable, along a given tree. An extension of the fitch function available in package phangorn.

Usage

get.fitch.n.mts(x, tree, snps = NULL)

Arguments

x

A numeric matrix or vector containing two unique values with row.names matching tree tip.labels.

tree

A phylo object.

Author(s)

Caitlin Collins caitiecollins@gmail.com

Examples

## Not run: 

## generate a tree
tree <- ape::rtree(100)
## generate snps, a matrix of 0s and 1s
snps <- matrix(sample(c(0,1),100000,TRUE), nrow=100)
row.names(snps) <- tree$tip.label

## run function
out <- get.fitch.n.mts(x=snps, tree)

## examine output
str(out)
table(out)
hist(out)

## End(Not run)


caitiecollins/treeWAS documentation built on Sept. 9, 2024, 8:23 a.m.