AlleleShare: Calculate numbers of sharing alleles each pair at each locus

Description Usage Arguments Details Value Examples

View source: R/AlleleShare.R

Description

Calculate numbers of sharing alleles each pair at each locus

Usage

1
AlleleShare(df,sep,replacement=FALSE)

Arguments

df

a dataframe of genotype data with rownames of sample ID and column names of markers.

sep

allele separator in the imported genotype data. Note: when using the special character like "|", remember to protect it as "\|"(default).

replacement

a logical variable. If it is TRUE, the pairs are sampled with replacement; if FALSE (default), the pairs are sampled without replacement.

Details

This function calculates the numbers of shared alleles between each pair of individuals for a dataset.

Value

a dataframe of numbers of shared alleles. Each row denotes each pair; Each column denotes each locus.

Examples

1
2
3
df <- data.frame(SNP1=c("A|A","T|T","A|T","A|T"),
                STR1=c("12|12","13|14","13|13","14|15"))
AlleleShare(df,"\\|",replacement=FALSE)

mixIndependR documentation built on March 17, 2021, 5:09 p.m.