setSNPs: Attach SNP loci to a pedigree

View source: R/marker_distribute.R

setSNPsR Documentation

Attach SNP loci to a pedigree

Description

Create and attach a list of empty SNP markers with specified position and allele frequencies.

Usage

setSNPs(x, snpData)

Arguments

x

A ped object.

snpData

A data frame with 6 columns. See Details.

Details

The data frame snpData should contain the following columns, in order:

  • CHROM: Chromosome (character)

  • MARKER: Marker name (character)

  • MB: Physical position in megabases (numeric)

  • A1: First allele (single-letter character)

  • A2: Second allele (single-letter character)

  • FREQ1: Allele frequency of A1 (number in ⁠[0,1]⁠)

The actual column names do not matter.

Each column must be of the stated type, or coercible to it. (For example, CHROM, A1 and A2 may be given as numbers, but will be internally converted to characters.)

Value

A copy of x with the indicated SNP markers attached.

Examples


snps = data.frame(
  CHROM  = 1:2,
  MARKER = c("M1", "M2"),
  MB     = c(1.23, 2.34),
  A1     = c("A", "G"),
  A2     = c("C", "C"),
  FREQ1  = c(0.7, 0.12))

x = setSNPs(nuclearPed(), snpData = snps)

# Inspect the results:
getMap(x)
getFreqDatabase(x)


pedtools documentation built on Nov. 5, 2023, 5:06 p.m.