multi_lrt | R Documentation |
Uses the future
package to implement parallelization support for
the likelihood ratio tests for segregation distortion. This function
only works for tetraploids, and cannot account for outliers. For
higher ploidies and more functionality, see seg_multi()
.
multi_lrt(
g,
p1,
p2,
drbound = 1/6,
pp = TRUE,
dr = TRUE,
alpha = 0,
xi1 = 1/3,
xi2 = 1/3,
nullprop = FALSE
)
g |
One of two inputs
|
p1 |
One of three inputs
|
p2 |
One of three inputs
|
drbound |
The upper bound on the double reduction rate. |
pp |
Is (partial) preferential pairing possible ( |
dr |
Is double reduction possible ( |
alpha |
If |
xi1 |
If |
xi2 |
If |
nullprop |
Should we return the null proportions ( |
A data frame with the following elements:
statistic
The likelihood ratio test statistic
p_value
The p-value of the likelihood ratio test.
df
The degrees of freedom of the test.
alpha
The MLE of the double reduction rate. Do not use for real work.
xi1
The MLE of the first parent's partial preferential pairing parameter. Do not use for real work.
xi2
The MLE of the second parent's partial preferential pairing parameter. Do not use for real work.
p1
(Estimate of) the first parent's genotype.
p2
(Estimate of) the second parent's genotype.
snp
The name of the SNP.
The multi_lrt()
function supports parallel computing. It does
so through the future
package.
You first specify the evaluation plan with plan()
from the future
package. On a local machine, this is typically
just future::plan(future::multisession, workers = nc)
where
nc
is the number of workers you want. You can find the maximum
number of possible workers with availableCores()
.
You then run multi_lrt()
, then shut down the workers with
future::plan(future::sequential)
.
David Gerard
lrt_men_g4()
Single locus LRT for segregation distortion when genotypes are known.
lrt_men_gl4()
Single locus LRT for segregation distortion when using genotype likelihoods.
## Assuming genotypes are known (typically a bad idea)
glist <- multidog_to_g(
mout = ufit,
ploidy = 4,
type = "all_g",
p1 = "indigocrisp",
p2 = "sweetcrisp")
p1_1 <- glist$p1
p2_1 <- glist$p2
g_1 <- glist$g
multi_lrt(g = g_1, p1 = p1_1, p2 = p2_1)
## Using genotype likelihoods (typically a good idea)
glist <- multidog_to_g(
mout = ufit,
ploidy = 4,
type = "all_gl",
p1 = "indigocrisp",
p2 = "sweetcrisp")
p1_2 <- glist$p1
p2_2 <- glist$p2
g_2 <- glist$g
multi_lrt(g = g_2, p1 = p1_2, p2 = p2_2)
## Offspring genotype likelihoods and parent genotypes known
multi_lrt(g = g_2, p1 = p1_1, p2 = p2_1)
## Offspring genotype likelihoods and no information on parent genotypes
multi_lrt(g = g_2, p1 = NULL, p2 = NULL)
## Parallel computing is supported through the future package
# future::plan(future::multisession, workers = 2)
# multi_lrt(g = g_2, p1 = p1_2, p2 = p2_2)
# future::plan(future::sequential)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.