powered by
Calculate numbers of sharing alleles each pair at each locus
AlleleShare(df,sep,replacement=FALSE)
a dataframe of genotype data with rownames of sample ID and column names of markers.
allele separator in the imported genotype data. Note: when using the special character like "|", remember to protect it as "\|"(default).
a logical variable. If it is TRUE, the pairs are sampled with replacement; if FALSE (default), the pairs are sampled without replacement.
a dataframe of numbers of shared alleles. Each row denotes each pair; Each column denotes each locus.
This function calculates the numbers of shared alleles between each pair of individuals for a dataset.
# NOT RUN { 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) # }
Run the code above in your browser using DataLab