Learn R Programming

RADami (version 1.1-2)

locus.dist: Generate a pairwise similarity matrix for individuals based on locus-sharing patterns

Description

This function returns a pairwise similarity matrix based on how many loci or the proportion of loci shared between individuals.

Usage

locus.dist(pyIn, proportional = TRUE, upper = TRUE, diagonal = TRUE)

Arguments

pyIn
an object of class pyRAD.loci
proportional
set to TRUE for a proportional similarity (scaled from 0 to 1), FALSE for absolute number of loci shared
upper
set to TRUE for a symmetrical matrix, FALSE for a lower-only matrix
diagonal
set to TRUE to get the number (or percentage) of total loci reported for each individual

Value

A square matrix with individuals as the rows and columns, and proportions or whole numbers in the cells

Details

Under the proportional = TRUE option, this function normalizes based on all loci in the dataset. Thus, two individuals that share 100 have sequences for only 90 0.9 instead of 1.0.

See Also

plot.locus.dist

Examples

Run this code
	data(oak.rads)
	temp <- locus.dist(oak.rads, proportional = TRUE)
	diag(temp) # this is how well everyone sequenced as a proportion
	temp <- locus.dist(oak.rads, proportional = FALSE)
	temp[c(1,28),]# how well did a successful sequencing do in comparison to a poor sequencing?
	temp[6:7,] # ... and 2010 sequencing (upper row) vs. 2012 sequencing of the same library?

Run the code above in your browser using DataLab