drawLocCrossovers: Crossing-overs

View source: R/quantgen.R

drawLocCrossoversR Documentation

Crossing-overs

Description

Draw the number and location of crossing-overs per gamete, in terms of SNP indices and not physical coordinates.

Usage

drawLocCrossovers(
  crosses,
  nb.snps,
  lambda = 2,
  simplistic = FALSE,
  verbose = 0
)

Arguments

crosses

data.frame with three columns, parent1, parent2, child; if parent 1 and 2 are the same, it will be an autofecondation; if parent2 is NA, it will be a haplodiploidization

nb.snps

vector with the nb of SNPs per chromosome, which names are chromosome names

lambda

mean number of crossing-overs (parameter of a Poisson)

simplistic

if TRUE, the value of lambda is ignored, and a single crossing over per gamete chromosome is assumed, which location is drawn uniformly

verbose

verbosity level (0/1)

Value

list of lists (one per cross, then one per parent, then one per chromosome) whose names are crosses$child, in the same order

Author(s)

Timothee Flutre

See Also

makeGameteSingleIndSingleChrom

Examples

## Not run: ## make inputs
nb.offs <- 100
names.offs <- paste0("par1-par2-",
                     sprintf(fmt=paste0("%0", floor(log10(nb.offs))+1, "i"),
                             1:nb.offs))
crosses <- data.frame(parent1=rep("par1", nb.offs),
                      parent2=rep("par2", nb.offs),
                      child=names.offs,
                      stringsAsFactors=FALSE)

## draw locations of crossing-overs
loc.crossovers <- drawLocCrossovers(crosses=crosses,
                                    nb.snps=setNames(c(2739, 2811),
                                                     c("chr1", "chr2")),
                                    verbose=1)

## End(Not run)

timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.