allelematch (version 2.5.1)

amAlleleFreq: Determine allele frequencies

Description

This function determines the allele frequencies for each locus in a multilocus genetic dataset by first removing missing observations. It requires an amDataset object and a map vector relating each column of the dataset to a genetic locus.

Usage

amAlleleFreq(amDatasetFocal, multilocusMap = NULL)
# S3 method for amAlleleFreq
print(x, ...)

Value

An amAlleleFreq object

Arguments

amDatasetFocal

An amDataset object

multilocusMap

Optionally a vector of integers or strings giving the mappings onto loci for all genotype columns in amDatasetFocal. When omitted, columns are assumed to be paired (i.e. diploid loci with alleles in adjacent columns). See details.

x

An amDataset object.

...

Additional arguments to summary

Author

Paul Galpern (pgalpern@gmail.com)

Details

This function is called by amUnique

multilocusMap is often not required, as amDataset objects will typically consist of paired columns of genotypes, where each pair is a separate locus. In cases where this is not the case (e.g. gender is given in only one column), a map vector must be specified.
Example: amDataset consists of gender followed by 4 diploid loci in paired columns
multilocusMap=c(1,2,2,3,3,4,4,5,5)
or equally
multilocusMap=c("GENDER", "LOC1", "LOC1", "LOC2", "LOC2", "LOC3", "LOC4", "LOC4")

References

Please see the supplementary documentation for more information. This is available as a vignette. Click on the index link at the bottom of this page to find it.

See Also

amUnique

Examples

Run this code

if (FALSE) {

data("amExample5")

## Produce amDataset object
myDataset1 <- amDataset(amExample5, missingCode="-99", indexColumn=1,
    metaDataColumn=2)

## Usage
myAlleleFreq <- amAlleleFreq(myDataset1,
    multilocusMap=c(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11))

## Produce amDataset object, but remove gender column
myDataset2 <- amDataset(amExample5, missingCode="-99", indexColumn=1,
    metaDataColumn=2, ignoreColumn="gender")

## Because all columns are paired, usage is simpler
myAlleleFreq <- amAlleleFreq(myDataset2)

}

Run the code above in your browser using DataCamp Workspace