infer_tracts: Identify crossover, non-crossover, and gene conversion tracts

Description Usage Arguments Details Value Author(s) References Examples

View source: R/infer-recom.R

Description

Infers different types of tracts (crossover, non-crossover, and gene conversion) along a chromosome

Usage

1
infer_tracts(dat, threshold_size = 2500)

Arguments

data

A data.frame with 7 columns:

  1. c("Tetrad", "Chr", "Snp", "one", "two", "three", "four")

  2. Tetrad specifying the tetrad ID

  3. Chr giving the chromosome name

  4. Snp a vector of snp locations (in bps)

  5. one the inferred states for spore 1

  6. two the inferred states for spore 2

  7. three the inferred states for spore 3

  8. four the inferred states for spore 4

threshold_size

The size (in bps) of the threshold (see details)

Details

Uses the 3 step classification scheme described in Hether et al. (in review) to identify the location of these specific CO, NCO, and telomeric gene conversion tracts. Specifically, infer_tracts attempts to identify the following tracts:

Value

A data.frame containing the following columns:

  1. type The type of inferred tract

  2. start_snp The starting snp position in base pairs

  3. end_snp The ending snp position in base pairs

  4. extent The size of the tract. For COnoGC, this extent is the s spanning region between flanking CO events.

Author(s)

Tyler D. Hether

References

Hether, T.D., C. G. Wiench1, and P.A. Hohenlohe (in review). 2015. Novel molecular and analytical tools for efficient estimation of rates of meiotic crossover, non-crossover and gene conversion

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
set.seed(1234567)        # For reproducibility
n_tetrads <- 3           # number of tetrads
l <- 1000                # number of snps to simulate
c <- 3e-05               # recombination rate between snps (Morgan/bp)
snps <- c(1:l)*250       # snps are evenly spaced 250 bp apart
p_a <- 0.95              # assignment probability
coverage <- 1            # mean coverage
# simulate tetrads
tetrad <- sim_tetrad(n.tetrads=n_tetrads, scale=c, snps=snps,
 p.assign=p_a, mu.rate=1e-03, f.cross=0.6, f.convert=0.8,
 length.conversion=2e3, coverage=coverage)
#' # Example 1 -- infer tracts directly from simulated data
inf_tracts_sim <- infer_tracts(tetrad)
inf_tracts_sim
#' # Example 2 -- infer tracts from inferred data
inf_states <- ddply(tetrad, .(Tetrad, Spore, Chr),
    function(x){
    return(fb_haploid(snp_locations=x$Snp, p0=x$p0,
    p1=x$p1, p_assign=p_a, scale=c))})
inf_tracts_inf_states <- infer_tracts(inf_states)
inf_tracts_inf_states

tylerhether/HMMancestry documentation built on May 3, 2019, 1:53 p.m.