Learn R Programming

strataG (version 1.0.5)

sharedLoci: Shared Loci

Description

Calculate proportion of alleles and number of loci shared between pairs of individuals or strata.

Usage

propSharedLoci(g, type = c("strata", "ids"), num.cores = NULL)
sharedAlleles(g, smry = c("num", "which"))
propSharedIds(ids, g, id.row.mat = idRows(g)[ids, ])

Arguments

g
a gtypes object.
type
a character vector determining type of pairwise comparsion. Can be "strata" for strata or "ids" for individuals.
num.cores
number of CPU cores to use. Defaults to the number reported by detectCores - 1.
smry
a character vector determining type of summary for sharedAlleles. "which" returns the names of the alleles shared. "num" returns the number of alleles shared.
ids
character vector of two sample ids to compare.
id.row.mat
lookup matrix of id row names or numbers of a format like the one generated by idRows.

Value

data.frame summary of pairwise shared loci.

Examples

Run this code
data(msats.g)
msats.g <- stratify(msats.g, "fine")

sharedAlleles(msats.g)

## Not run: 
# propSharedLoci(msats.g, num.cores = 2)
# ## End(Not run)

Run the code above in your browser using DataLab