locus: General constructor for locus object

View source: R/locus.R

locusR Documentation

General constructor for locus object

Description

This function creates an object of type locus, a fundamental type in the gstudio package. Therea re several kinds of loci that can be created.

Usage

locus(x, type = "codom", phased = FALSE)

Arguments

x

The data to be turned into a locus object

type

An indication of what kind of data it is. By default this parameter is missing and this will cause the function to assume that every element of x is an allele in the genotype.

blank

Default value, uses all passed items as alleles

aflp

Encoded as 0,1 for absence/presence of bands.

column

Two columns of alleles

separated

Pre-separated alleles (with ':').

snp

Encoded by the number of minor alleles at the locus.

zyme

Alleles like zymes (e.g., 12 for '1' and '2' alleles).

snp_prob

A probabilistic snp call denoted as three posterior likelihoods for AA, AB, and BB as is often found in RAD-seq data.

phased

A flag indicating the the alleles should are of known gametic phase (default=FALSE).

Value

Either a single or vector of objects of type locus.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

AA <- locus( c("A","A") )
AB <- locus( c("A","B") )
BB <- locus( c("B","B") )
AC <- locus( c("A","C") )
AD <- locus( c("A","D") )
BC <- locus( c("B","C") )
BD <- locus( c("B","D") )
CC <- locus( c("C","C") )
CD <- locus( c("C","D") )
DD <- locus( c("D","D") )
loci <- c(AA,AB,AC,AD,BB,BC,BD,CC,CD,DD) 
loci

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.