View source: R/genome_functions.R
sim_genome | R Documentation |
Creates a list containing information on a simulated genome
sim_genome(len, n.mar, map, eq.spacing = FALSE, type = c("pbsim", "hypred"))
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
|
eq.spacing |
If TRUE, markers will be equally spaced. See |
type |
Deprecated. 'hyped' genomes are no longer supported. |
Object of class "genome" with the length of each chromosome, the number of markers per chromosome, and the genetic map.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.