newGenopheno: Generates a new genetic system

Description Usage Arguments Value Examples

View source: R/setup.R

Description

This function generates a new genetic system that stores information about the number of loci, alleles at each locus as well as recombination rates and mode of inheritance.

Usage

1
2
newGenopheno(nloci = 1, nalleles = rep(2, nloci),
  alleleNames = "standard", rec = NULL, type = "autosomal")

Arguments

nloci

The number of loci. The default value is 1 but any (reasonable) number can be chosen.

nalleles

The number of alleles for each locus. This should be a vector of length nloci containing positive integer numbers. By default, all loci are set to be biallelic.

alleleNames

The names for the alleles at the different loci. The default value is 'standard', which for biallelic loci produces allele names 'a' and 'A' for the first locus, 'b' and 'B' for the second locus etc. If one locus has more than two alleles, 'standard' produces allele names a0, a1, a2; b0, b1, b2 etc. For other allele names, alleleNames should be a list of nloci elements, each of which needs to be a vector containing the allele names. Allele names need to be strings (class character) and can contain letters, numbers, or symbols (except '~', '.' and '|').

rec

A vector of length nloci-1 specifying recombination rates between the loci.

type

This parameter specifies the ploidy and inheritance for the loci. The default value is "autosomal" and currently, this is also the only supported type of linkage group.

Value

An object of class genopheno that stores all of the specifications provided about the genetic system and that can then be extended to also include other linkage groups and corresponding phenotypes.

Examples

1
2
3
4
5
6
7
MendelsPeas <- newGenopheno(nloci = 1, alleleNames = list(c('Y', 'y')))
MendelsPeas <- addLinkageGroup(MendelsPeas, nloci = 1, alleleNames = list(c('R', 'r')))
MendelsPeas <- setPhenotypes(MendelsPeas, 'colour', 'Y_ | __', 'yellow')
MendelsPeas <- setPhenotypes(MendelsPeas, 'colour', 'yy | __', 'green')
MendelsPeas <- setPhenotypes(MendelsPeas, 'shape', '__ | R_', 'round')
MendelsPeas <- setPhenotypes(MendelsPeas, 'shape', '__ | rr', 'wrinkled')
MendelsPeas

JanEngelstaedter/peas documentation built on May 5, 2019, 1:33 a.m.