sim_genome: Create a simulated genome

View source: R/genome_functions.R

sim_genomeR Documentation

Create a simulated genome

Description

Creates a list containing information on a simulated genome

Usage

sim_genome(len, n.mar, map, eq.spacing = FALSE, type = c("pbsim", "hypred"))

Arguments

len

A vector specifying the chromosome lengths (in cM).

n.mar

A vector specifying the umber of markers per chromosome.

map

A list of marker positions (in cM), where each list element is a named vector of marker positions that are located on a single chromosome. The names of these elements in the list are chromosome numbers. If NULL (default), marker positions are drawn from a uniform distribution. See sim.map for more information.

eq.spacing

If TRUE, markers will be equally spaced. See sim.map.

type

Deprecated. 'hyped' genomes are no longer supported.

Value

Object of class "genome" with the length of each chromosome, the number of markers per chromosome, and the genetic map.

Examples


## Not run: 
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

exp_map <- replicate(1, runif(10), simplify = FALSE)
# This will fail because the vector elements in the list are not mapped
sim_genome(map = exp_map)

# Name the markers
names(exp_map[[1]]) <- paste0("M", seq_along(exp_map[[1]]))
# This will fail because the list is not named.
sim_genome(map = exp_map)

# Give the chromosomes names
names(exp_map) <- "chr1"
# This will fail because the chromosome names are not coercible to numbers
sim_genome(map = exp_map)

# This will work
names(exp_map) <- 1
sim_genome(map = exp_map)

## End(Not run)



neyhartj/qgsim documentation built on Nov. 11, 2023, 4:08 p.m.