Package Xoi': Topics Documented
Package Xoi': Topics Documented
URL https://github.com/kbroman/xoi
BugReports https://github.com/kbroman/xoi/issues
RoxygenNote 7.1.0
Encoding UTF-8
ByteCompile true
LazyData true
NeedsCompilation yes
Repository CRAN
Date/Publication 2023-03-22 12:40:02 UTC
R topics documented:
bssbsb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
chiasma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
coincidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
convertxoloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1
2 bssbsb
countxo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
distance.given.two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
est.coi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
est.coi.um . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
est.recrate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
find.breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
first.given.two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
firstden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
fitGamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
fitStahl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
gammacoi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
intensity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
ioden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
joint.given.two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
kfunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
location.given.one . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
recrate2scanone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
simStahl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
stahlcoi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
stahlLoglik . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
xoiversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
xoprob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Index 41
Description
Data from two densely genotyped backcrosses.
Format
An object of class cross. See qtl::read.cross() for details.
Details
There are 94 individuals from each of two interspecific backcross: (C57BL/6J × M. spretus) ×
C57BL/6J and (C57BL/6J × SPRET/Ei) × SPRET/Ei. They were typed on 1372 and 4913 genetic
markers, respectively, with 904 markers in common.
These data are from September, 2000. Updated data are available.
Source
Lucy Rowe, Jackson Laboratory
chiasma 3
References
Rowe, L. B., Nadeau, J. H., Turner, R., Frankel, W. N., Letts, V. A., Eppig, J. T., Ko, M. S.,
Thurston, S. J. and Birkenmeier, E. H. (1994) Maps from two interspecific backcross DNA panels
available as a community genetic mapping resource. Mamm. Genome 5, 253–274.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
Examples
data(bssbsb)
summary(bssbsb)
## Not run: plot(bssbsb)
Description
Fit several models, with an assumption of no chromatid interference, to crossover count data to
obtain fitted distributions of the number of chiasmata.
Usage
chiasma(
xo,
max.chiasma = max(xo) * 2 + 5,
n.iter = 10000,
tol = 0.000001,
verbose = FALSE
)
Arguments
xo Vector of non-negative integers; the number of crossovers in a set of meiotic
products.
max.chiasma Maximum number of chiasmata to allow.
n.iter Maximum number of iterations in the EM algorithm.
tol Tolerance for convergence of the EM algorithm.
verbose If TRUE, print number of interations for each of the 4 models at the end.
Details
See Broman and Weber (2000) for details of the method.
We use R’s stats::integrate() function for numerical integrals, stats::optimize() for opti-
mizing the likelihood, and stats::uniroot() for identifying the endpoints of the likelihood sup-
port interval.
4 chiasma
Value
Author(s)
References
See Also
Examples
data(bssbsb)
Description
Usage
Arguments
cross Cross object; must be a backcross. See qtl::read.cross() for format details.
chr Chromosome to consider (only one is allowed). If NULL, the first chromosome
is considered.
window Window size
ncalc Total number of points for calculations.
Value
Data frame with columns distance and coincidence. The input argument window is kept as an
attribute.
Author(s)
Il youp Kwak
See Also
intensity(), est.coi()
Examples
Description
Convert the format of data on crossover locations to that needed for the function fitGamma.
Usage
convertxoloc(breaks)
Arguments
Value
A data frame with two columns: the inter-crossover and crossover-to chromosome end differences
("distance") and indicators of censoring type ("censor"), with 0 = distance between crossovers,
1=start of chromosome to first crossover, 2 = crossover to end of chromosome, and 3 = whole
chromosome.
Author(s)
See Also
Examples
data(bssbsb)
Description
Estimate the number of crossovers in each meiosis in a backcross.
Usage
countxo(cross, chr = NULL)
Arguments
cross An object of class cross. (This must be a backcross.) See qtl::read.cross()
for details.
chr Optional set of chromosomes across which to count crossovers. If NULL, the
total number of crossovers, genome-wide, is counted.
Details
This works only a backcross. We use the internal function (within R/qtl) locate.xo.
Value
A vector with the estimated number of crossovers for each individual.
Author(s)
Karl W Broman, <[email protected]>
See Also
find.breaks()
Examples
data(bssbsb)
Description
Calculates the density of the distance between the crossovers on a meiotic product, given that there
are precisely two crossovers, for the gamma model.
Usage
distance.given.two(
nu,
L = 103,
x = NULL,
n = 400,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
Arguments
nu The interference parameter in the gamma model.
L The length of the chromsome in cM.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from the start of the chromosome to the first crossover is g ∗ (x; ν) =
1 − F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
We calculate the distribution of the distance between crossovers on a product with two crossovers by
first calculating the joint distribution of the location of the two crossovers, given that they both occur
before L and the third occurs after L, and then integrating out the location of the first crossover.
distance.given.two 9
Value
A data frame with two columns: x is the distance (between 0 and L, in cM) at which the density was
calculated and f is the density.
Warning
We sometimes have difficulty with the numerical integrals. You may need to use large min.subd
(e.g. 25) to get accurate results.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
location.given.one(), first.given.two(),joint.given.two(), ioden(), firstden(), xoprob(),
gammacoi()
Examples
## Not run:
f3 <- distance.given.two(4.3, L=200, n=101)
lines(f3, col="red", lwd=2)
## End(Not run)
10 est.coi
Description
Estimate the coincidence function from backcross data.
Usage
est.coi(
cross,
chr = NULL,
pos = NULL,
window = 0,
fill.method = c("imp", "argmax"),
error.prob = 0.0000000001,
map.function = c("haldane", "kosambi", "c-f", "morgan")
)
Arguments
cross Cross object; must be a backcross. See qtl::read.cross() for format details.
chr Chromosome to consider (only one is allowed). If NULL, the first chromosome
is considered.
pos If provided, these are used as the marker positions. (This could be useful if you
want to do things with respect to physical distance.)
window Window size used to smooth the estimates.
fill.method Method used to impute missing data.
error.prob Genotyping error probability used in imputation of missing data.
map.function Map function used in imputation of missing data.
Details
The coincidence function is the probability of a recombination event in both of two intervals, divided
by the product of the two recombination fractions. We estimate this as a function of the distance
between the two intervals.
Note that we first call qtl::fill.geno() to impute any missing genotype data.
Value
A data.frame containing the distance between intervals and the corresponding estimate of the co-
incidence. There are actually two columns of estimates of the coincidence. In the first estimate,
we take a running mean of each of the numerator and denominator and then divide. In the second
estimate, we first take a ratio and then take a running mean.
est.coi.um 11
Author(s)
References
See Also
Examples
Description
Estimate the coincidence as a function of micron distance, with data on XO locations in microns
plus SC length in microns.
Usage
est.coi.um(
xoloc,
sclength,
centromeres = NULL,
group = NULL,
intwindow = 0.05,
coiwindow = NULL,
intloc = NULL,
coiloc = NULL
)
12 est.coi.um
Arguments
xoloc list of crossover locations (in microns) for each of several oocytes or spermato-
cytes.
sclength vector of SC lengths (in microns).
centromeres vector of centromere locations (in microns). If NULL, taken to be sclength/2.
group nominal vector of groups; the intensity function of the crossover process will
be estimated separately for each group, but a joint coincidence function will be
estimated.
intwindow Window size used to smooth the estimated intensity function.
coiwindow Window size used to smooth the estimated coincidence function.
intloc Locations at which to estimate the intensity function, in the interval [0,1]
coiloc Values at which the coincidence function is to be estimated, in microns, less than
max(sclength)
Details
The coincidence function is the probability of a recombination event in both of two intervals, divided
by the product of the two intensity function for the two intervals.
We estimate this as a function of the distance between the two intervals in microns, taking account
of varying SC lengths,.
Value
A list containing the estimated coincidence (as a matrix with two columns, micron distance and cor-
responding estimated coincidence) and the estimated intensity functions (as a matrix with length(group)+1
columns (the locations at which the intensity functions were estimated followed by the group-
specific estimates).
Author(s)
Karl W Broman, <[email protected]>
See Also
gammacoi(), stahlcoi(), kfunc(), est.coi()
Examples
# simple example using data simulated with no crossover interference
ncells <- 1000
L <- 2 # chr lengths in Morgans (constant here)
nchi <- rpois(ncells, 2*L) # number of chiasmata
xoloc <- lapply(nchi, function(a) runif(a, 0, L)) # chi locations
coi <- est.coi.um(xoloc, rep(L, ncells))
par(mfrow=c(2,1), las=1)
plot(coi$coincidence, type="l", lwd=2, ylim=c(0, max(coi$coincidence[,2])))
plot(coi$intensity, type="l", lwd=2, ylim=c(0, max(coi$intensity[,2])))
Description
Obtain a smoothed estimate of the recombination rate along a chromosome, using the cM and Mbp
position of markers.
Usage
Arguments
Details
Value
Author(s)
See Also
est.coi(), intensity()
14 find.breaks
Examples
# create equally-spaced map
pmap <- sim.map(100, n.mar=51, anchor=TRUE, include.x=FALSE, eq.spacing=TRUE)
# simulate cross
x <- sim.cross(pmap, type="bc", n.ind=501)
Description
Estimate the locations of crossovers in a backcross.
Usage
find.breaks(cross, chr = NULL)
Arguments
cross An object of class cross. (This must be a backcross, RIL, or intercross.) See
qtl::read.cross() for details.
chr Optional set of chromosomes on which to look for crossovers. If NULL, all
chromosomes are considered.
Details
This works only a backcross, RIL, or intercross. We use the function qtl::locateXO() in R/qtl.
Crossovers are estimated to be at the midpoint of the interval between the nearest flanking typed
markers.
Value
If only one chromosome is considered, this is a list with one component for each individual. If
multiple chromosomes were considered, this is a list with one element for each chromosome, each
of which is a list with one element for each individual, as above.
For backcrosses and RIL, the componenets for the individuals are numeric(0) if there were no
crossovers or a vector giving the crossover locations. The length of the chromosome (in cM) is
saved as an attribute. (Note that the format is the same as the output of simStahl().)
first.given.two 15
For an intercross, the components for the individuals are themselves lists with all possible alloca-
tions of the crossovers to the two meiotic products; each component of this list is itself a list with
two components, corresponding to the two meiotic products.
Author(s)
See Also
Examples
data(bssbsb)
Description
Calculates the density of the location of the first crossover on a random meiotic product, given that
there are precisely two crossovers, for the gamma model.
Usage
first.given.two(
nu,
L = 103,
x = NULL,
n = 400,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
16 first.given.two
Arguments
nu The interference parameter in the gamma model.
L The length of the chromsome in cM.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from the start of the chromosome to the first crossover is g ∗ (x; ν) =
1 − F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
We calculate the distribution of the location of the first crossover in a product with two crossovers
by calculating the joint distribution of the location of the two crossovers, given that they both occur
before L and the third occurs after L, and then integrating out the location of the second crossover.
Value
A data frame with two columns: x is the location (between 0 and L, in cM) at which the density was
calculated and f is the density.
Warning
We sometimes have difficulty with the numerical integrals. You may need to use large min.subd
(e.g. 25) to get accurate results.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
firstden 17
See Also
location.given.one(), distance.given.two(), joint.given.two(), ioden(), firstden(),
xoprob(), gammacoi()
Examples
## Not run:
f3 <- first.given.two(4.3, L=200, n=101)
lines(f3, col="red", lwd=2)
## End(Not run)
Description
Calculates the density of the distance from an arbitrary point to the next crossover, for the gamma
model.
Usage
firstden(nu, L = 103, x = NULL, n = 400, max.conv = 25)
Arguments
nu The interference parameter in the gamma model.
L Maximal distance (in cM) at which to calculate the density. Ignored if x is
specified.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
18 firstden
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from an arbitrary point to the first crossover is g ∗ (x; ν) = 1 −
F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
Value
A data frame with two columns: x is the distance (between 0 and L, in cM) at which the density was
calculated and f is the density.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
location.given.one(), first.given.two(), distance.given.two(), joint.given.two(), ioden(),
xoprob(), gammacoi()
Examples
Description
Fit the gamma model for crossover interference to data on crossover locations.
Usage
fitGamma(
d,
censor = NULL,
nu = NULL,
lo = NULL,
hi = NULL,
se = FALSE,
supint = FALSE,
rescale = FALSE,
drop = 1.5,
tol = 0.00001,
maxit = 1000,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10,
h = 0.1,
hstep = 1.5
)
Arguments
Details
See Broman and Weber (2000) for details of the method.
We use R’s stats::integrate() function for numerical integrals, stats::optimize() for opti-
mizing the likelihood, and stats::uniroot() for identifying the endpoints of the likelihood sup-
port interval.
Value
If nu is specified, we return a data frame with two columns: nu and the corresponding log (base e)
likelihood. If rescale=TRUE, the maximum log likelihood is subtracted off, so that its maximum is
at 0.
If lo and hi is specified, the output contains a single row with the MLE of ν and the corresponding
log likelihood. If se=TRUE, we also include the estimated SE. If supint=TRUE, we include two
additional rows with the lower and upper limits of the likelihood support interval.
Author(s)
Karl W Broman, <[email protected]>
fitStahl 21
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
qtl::fitstahl()
Examples
data(bssbsb)
# get MLE
## Not run: mle <- fitGamma(xodist, lo=8, hi=12)
mle
mle
int
abline(v=mle[2:3,1], h=mle[2:3,2], col="red", lty=2)
Description
Fit the Stahl model for crossover interference to data on crossover locations.
Usage
fitStahl(
xoloc,
chrlen = NULL,
nu = c(1, 20),
p = 0.02,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10,
verbose = TRUE,
...
)
Arguments
xoloc A list of crossover locations (in cM), each component being a vector of locations
for a different meiotic product.
chrlen Chromosome length (in cM), either of length 1 or the same length as xoloc.
nu Interference parameter (ν). This should be a pair of values to be used as end-
points to first do a 1-dimensional optimization with p = 0.
p Starting value for the proportion of crossovers from the no interference pathway,
for the 2-dimensional optimization.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
verbose If TRUE, print tracing information. If ". . . " includes control, this is ignored.
... Further arguments sent to stats::optim().
Details
See Housworth and Stahl (2003) and Broman and Weber (2000) for details of the method.
We first use stats::optimize() to find the MLE with the contraint p=0, followed by use of
stats::optim() to do a 2-dimensional optimization for the MLEs of the pair.
gammacoi 23
Value
A vector with the estimates of ν (interference parameter) and p (proportion of crossovers com-
ing from the no interference pathway), the maximized log likelihood, the estimate of nu with p
constrained to be 0, the maximized log likelihood in this case, and the log likelihood ratio for com-
paring the model with p allowed to vary freely versus contrained to be 0. (Note that it’s the natural
log of the likelihood ratio, and not twice that.)
Author(s)
Karl W Broman, <[email protected]>
References
Housworth, E. A. and Stahl, F. W. (2003) Crossover interference in humans. Am. J. Hum. Genet.
73, 188–197.
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
See Also
fitGamma(), stahlLoglik(), simStahl()
Examples
data(bssbsb)
# get MLE (limiting maximum iterations to 10, just for speed in this example)
## Not run: mle <- fitStahl(xoloc, L, nu=c(9, 12), control=list(maxit=10))
Description
Calculates the coincidence function for the gamma model.
Usage
gammacoi(nu, L = 103, x = NULL, n = 400, max.conv = 25)
24 gammacoi
Arguments
nu The interference parameter in the gamma model.
L Maximal distance (in cM) at which to calculate the density. Ignored if x is
specified.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolution. This should be greater than
the maximum number of chiasmata on the 4-strand bundle.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The coincidence function for the gamma model is C(x; ν) = k=1 fk (x; ν)/2.
Value
A data frame with two columns: x is the distance (between 0 and L, in cM) at which the coicidence
was calculated and coincidence.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
stahlcoi(), location.given.one(), first.given.two(), distance.given.two(), joint.given.two(),
ioden(), firstden(), xoprob()
Examples
Description
Usage
Arguments
cross Cross object; must be a backcross. See qtl::read.cross() for format details.
chr Chromosome to consider (only one is allowed). If NULL, the first chromosome
is considered.
window Window size
ncalc Total number of points for calculations.
Value
Data frame with columns position and intensity. The input argument window is kept as an
attribute.
Author(s)
Il youp Kwak
See Also
coincidence()
26 ioden
Examples
Description
Calculates the density of the distance from a given crossover to the next crossover, for the gamma
model.
Usage
ioden(nu, L = 103, x = NULL, n = 400, max.conv = 25)
Arguments
nu The interference parameter in the gamma model.
L Maximal distance (in cM) at which to calculate the density. Ignored if x is
specified.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
Value
A data frame with two columns: x is the distance (between 0 and L, in cM) at which the density was
calculated and f is the density.
joint.given.two 27
Author(s)
References
See Also
Examples
Description
Calculates the joint density of the crossover locations on a random meiotic product, given that there
are precisely two crossovers, for the gamma model.
28 joint.given.two
Usage
joint.given.two(
nu,
L = 103,
x = NULL,
y = NULL,
n = 20,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
Arguments
nu The interference parameter in the gamma model.
L The length of the chromsome in cM.
x If specified, locations of the first crossover.
y If specified, locations of the second crossover.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x and y are specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from the start of the chromosome to the first crossover is g ∗ (x; ν) =
1 − F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
Value
A data frame with three columns: x and y are the locations (between 0 and L, in cM) at which the
density was calculated and f is the density.
Warning
We sometimes have difficulty with the numerical integrals. You may need to use large min.subd
(e.g. 25) to get accurate results.
kfunc 29
Author(s)
References
See Also
Examples
Description
Usage
kfunc(
x,
d = seq(0, 100, by = 0.1),
lengths = NULL,
exclude = 0,
tol = 0.000001
)
Arguments
Value
See Also
Examples
L <- 103
n <- 2000
map1 <- sim.map(L, n.mar=104, anchor=TRUE, include.x=FALSE, eq=TRUE)
x <- sim.cross(map1, n.ind=n, m=6, type="bc")
Description
Calculates the density of the location of the crossover on a random meiotic product, given that there
is precisely one crossover, for the gamma model.
Usage
location.given.one(
nu,
L = 103,
x = NULL,
n = 400,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
Arguments
nu The interference parameter in the gamma model.
L The length of the chromsome in cM.
x If specified, points at which to calculate the density.
n Number of points at which to calculate the density. The points will be evenly
distributed between 0 and L. Ignored if x is specified.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from the start of the chromosome to the first crossover is g ∗ (x; ν) =
1 − F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
We calculate the distribution of the location of the crossover on a product with a single crossover as
the convolution of g ∗ with itself, and then rescaled to integrate to 1 on the interval (0,L).
32 recrate2scanone
Value
A data frame with two columns: x is the location (between 0 and L, in cM) at which the density was
calculated and f is the density.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
first.given.two(), distance.given.two(), joint.given.two(), ioden(), firstden(), xoprob(),
gammacoi()
Examples
Description
Convert the result of est.recrate() to the format output by R/qtl’s qtl::scanone() function.
simStahl 33
Usage
recrate2scanone(recrate, phymap = NULL)
Arguments
recrate A list of results from est.recrate()
phymap A list of vectors of Mbp positions of markers
Value
A data frame with class "scanone", in the format output by qtl::scanone().
Author(s)
Karl W Broman, <[email protected]>
See Also
est.recrate()
Examples
pmap <- sim.map(100, n.mar=51, anchor=TRUE, include.x=FALSE, eq.spacing=TRUE)
# simulate cross
x <- sim.cross(pmap, type="bc", n.ind=501)
# make it a list (one component per chromosome, but here just the one chromosome)
rr <- list("1"=rr)
Description
Simulate crossover locations under the Stahl model.
34 simStahl
Usage
simStahl(
n.sim,
nu = 1,
p = 0,
L = 100,
obligate_chiasma = FALSE,
n.bins4start = 10000
)
Arguments
n.sim Number of meiotic products to simulate.
nu The interference parameter in the gamma model.
p The proportion of chiasmata coming from the no-interference mechanism.
L Chromosome length (in cM).
obligate_chiasma
Require an obligate chiasma (requires nu to be an integer; if nu is not an integer,
it is rounded.
n.bins4start We approximate the distribution of the location of the first crossover from the
mechanism exhibiting interference using a even grid with this many bins. (Only
if nu is not an integer.)
Details
The Stahl model is an extension to the gamma model, in which chiasmata occur according to two
independent mechanisms. A proportion p come from a mechanism exhibiting no interference, and
a proportion 1-p come from a mechanism in which chiasma locations follow a gamma model with
interference parameter ν.
Value
A vector of length n.sim, each element being empty (for products with no crossovers) or a vector
of crossover locations, in cM. An attribute, L, contains the chromosome length in cM.
Author(s)
Karl W Broman, <[email protected]>
References
Copenhaver, G. P., Housworth, E. A. and Stahl, F. W. (2002) Crossover interference in Arabidopsis.
Genetics 160, 1631–1639.
Housworth, E. A. and Stahl, F. W. (2003) Crossover interference in humans. Am J Hum Genet 73,
188–197.
stahlcoi 35
See Also
fitGamma(), qtl::sim.cross()
Examples
# simulations under chi-square model with nu=11 (m=10) and obligate chiasma
xo_oblchi <- simStahl(100, nu=11, p=0, L=80, obligate_chiasma=TRUE)
# simulations under Stahl model with nu=11, p=0.1, and obligate chiasma
xo_oblchi_stahl <- simStahl(100, nu=11, p=0.1, L=80, obligate_chiasma=TRUE)
Description
Usage
Arguments
Details
The Stahl model is an extension to the gamma model, in which chiasmata occur according to two
independent mechanisms. A proportion p come from a mechanism exhibiting no interference, and
a proportion 1-p come from a mechanism in which chiasma locations follow a gamma model with
interference parameter ν.
Let f (x; ν, λ) denote the density of a gamma random variable with parameters shape=ν and rate=λ.
P∞
The coincidence function for the Stahl model is C(x; ν, p) = [p + k=1 f (x; kν,2(1 − p)ν)]/2.
Value
A data frame with two columns: x is the distance (between 0 and L, in cM) at which the coicidence
was calculated and coincidence.
Author(s)
Karl W Broman, <[email protected]>
References
Copenhaver, G. P., Housworth, E. A. and Stahl, F. W. (2002) Crossover interference in Arabidopsis.
Genetics 160, 1631–1639.
Housworth, E. A. and Stahl, F. W. (2003) Crossover interference in humans. Am J Hum Genet 73,
188–197.
See Also
gammacoi(), location.given.one(), first.given.two(), distance.given.two(), ioden(),
firstden(), xoprob()
Examples
Description
Calculate the log likelihood for the Stahl model for varying parameters, with data on crossover
locations.
Usage
stahlLoglik(
xoloc,
chrlen = NULL,
nu,
p,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
Arguments
xoloc A list of crossover locations (in cM), each component being a vector of locations
for a different meiotic product.
chrlen Chromosome length (in cM), either of length 1 or the same length as xoloc.
nu A vector of interference parameters (ν) at which to calculate the log likelihood.
p A vector of parameter values for the proportion of crossovers from the no inter-
ference pathway.
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
See Housworth and Stahl (2003) and Broman and Weber (2000) for details of the method.
If neither nu nor p has length 1, they both must have the same length. If one has length 1 and the
other does not, the one with length 1 is repeated so that they both have the same length.
38 xoiversion
Value
A vector of log likelihoods.
The corresponding values of nu and p are saved as attributes.
Author(s)
Karl W Broman, <[email protected]>
References
Housworth, E. A. and Stahl, F. W. (2003) Crossover interference in humans. Am. J. Hum. Genet.
73, 188–197.
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
See Also
qtl::fitstahl()
Examples
data(bssbsb)
xoloc <- find.breaks(bssbsb, chr=1)
Description
Print the version number of the currently installed version of R/xoi.
Usage
xoiversion()
Value
A character string with the version number of the currently installed version of R/xoi.
Author(s)
Karl W Broman, <[email protected]>
xoprob 39
Examples
xoiversion()
Description
Calculates the probability of 0, 1, 2, or >2 crossovers for a chromosome of a given length, for the
gamma model.
Usage
xoprob(
nu,
L = 103,
max.conv = 25,
integr.tol = 0.00000001,
max.subd = 1000,
min.subd = 10
)
Arguments
nu The interference parameter in the gamma model.
L Length of the chromosome (in cM).
max.conv Maximum limit for summation in the convolutions to get inter-crossover dis-
tance distribution from the inter-chiasma distance distributions. This should be
greater than the maximum number of chiasmata on the 4-strand bundle.
integr.tol Tolerance for convergence of numerical integration.
max.subd Maximum number of subdivisions in numerical integration.
min.subd Minimum number of subdivisions in numerical integration.
Details
Let f (x; ν) denote the density of a gamma random variable with parameters shape=ν and rate=2ν,
and let fk (x; ν) denote the density of a gamma random variable with parameters shape=kν and
rate=2ν.
P∞
The distribution of the distance from one crossover to the next is f ∗ (x; ν) = k=1 fk (x; ν)/2k .
The distribution of the distance from the start of the chromosome to the first crossover is g ∗ (x; ν) =
1 − F ∗ (x; ν) where F ∗ is the cdf of f ∗ .
We calculate the desired probabilities by numerical integration.
40 xoprob
Value
A vector of length 4, giving the probabilities of 0, 1, 2, or >2 crossovers, respectively, on a chromo-
some of length L cM.
Author(s)
Karl W Broman, <[email protected]>
References
Broman, K. W. and Weber, J. L. (2000) Characterization of human crossover interference. Am. J.
Hum. Genet. 66, 1911–1926.
Broman, K. W., Rowe, L. B., Churchill, G. A. and Paigen, K. (2002) Crossover interference in the
mouse. Genetics 160, 1123–1131.
McPeek, M. S. and Speed, T. P. (1995) Modeling interference in genetic recombination. Genetics
139, 1031–1044.
See Also
location.given.one(), first.given.two(), distance.given.two(), joint.given.two(), ioden(),
firstden(), gammacoi()
Examples
xoprob(1, L=103)
xoprob(4.3, L=103)
Index
∗ datagen countxo, 7
simStahl, 33 countxo(), 4
∗ datasets
bssbsb, 2 distance.given.two, 8
∗ distribution distance.given.two(), 17, 18, 24, 27, 29,
distance.given.two, 8 32, 36, 40
first.given.two, 15
firstden, 17 est.coi, 10
gammacoi, 23 est.coi(), 5, 12, 13
ioden, 26 est.coi.um, 11
joint.given.two, 27 est.recrate, 13
location.given.one, 31 est.recrate(), 32, 33
stahlcoi, 35
xoprob, 39 find.breaks, 14
∗ models find.breaks(), 6, 7
chiasma, 3 first.given.two, 15
est.coi, 10 first.given.two(), 9, 18, 24, 27, 29, 32, 36,
est.coi.um, 11 40
est.recrate, 13 firstden, 17
fitGamma, 19 firstden(), 9, 17, 24, 27, 29, 32, 36, 40
fitStahl, 21 fitGamma, 6, 19
kfunc, 29 fitGamma(), 4, 6, 15, 23, 35
recrate2scanone, 32 fitStahl, 21
stahlLoglik, 37
∗ print gammacoi, 23
xoiversion, 38 gammacoi(), 9, 11, 12, 17, 18, 27, 29, 30, 32,
∗ utilities 36, 40
coincidence, 5
convertxoloc, 6 intensity, 25
countxo, 7 intensity(), 5, 13
find.breaks, 14 ioden, 26
intensity, 25 ioden(), 9, 17, 18, 24, 29, 32, 36, 40
bssbsb, 2 joint.given.two, 27
joint.given.two(), 9, 17, 18, 24, 27, 32, 40
chiasma, 3
coincidence, 5 kfunc, 29
coincidence(), 25, 30 kfunc(), 11, 12
convertxoloc, 6
convertxoloc(), 15 location.given.one, 31
41
42 INDEX
qtl::fill.geno(), 10
qtl::fitstahl(), 4, 21, 38
qtl::locateXO(), 14
qtl::read.cross(), 2, 5, 7, 10, 14, 25
qtl::scanone(), 32, 33
qtl::sim.cross(), 35
recrate2scanone, 32
simStahl, 33
simStahl(), 6, 14, 15, 23
stahlcoi, 35
stahlcoi(), 11, 12, 24, 30
stahlLoglik, 37
stahlLoglik(), 23
stats::integrate(), 3, 20
stats::optim(), 22
stats::optimize(), 3, 20, 22
stats::uniroot(), 3, 20
xoiversion, 38
xoprob, 39
xoprob(), 9, 17, 18, 24, 27, 29, 32, 36