| qtl_perm_test | R Documentation |
Perform a QTL mapping permutation test using the
qtl:scanone(...) function to find significant QTL.
qtl_perm_test( x_data, cpus = 1, qtl_method = "par-scanone", raw_data_normalised = NULL, lod_threshold = 3, parametric = TRUE, n_perm = 1000, plots_dir = tempdir(), ... )
x_data |
Cross-data frame containing genetic map data and traits. |
cpus |
Number of CPUs to be used in the computation. |
qtl_method |
QTL mapping method. |
raw_data_normalised |
Normalised raw data, see
|
lod_threshold |
LOD score threshold to look up for significant QTLs |
parametric |
Boolean flag to indicate whether or not |
n_perm |
Number of permutations. |
plots_dir |
Output directory for plots. |
... |
Arguments passed on to
|
Data frame containing the significant QTLs information.
Other QTL mapping functions:
qtl_scone(),
read.cross()
# Create temp dir
tmp <- tempdir()
dir.create(tmp, showWarnings = FALSE, recursive = TRUE)
# Toy dataset
excluded_columns <- c(1, 2)
population <- 5
seed <- 123
set.seed(seed)
example_data <- data.frame(ID = 1:population,
P1 = c("one", "two", "three", "four", "five"),
T1 = rnorm(population),
T2 = rnorm(population))
output <- MetaPipe::assess_normality(example_data,
excluded_columns,
show_stats = FALSE,
out_prefix = paste0(tmp, "/tmp"))
# Create and store random genetic map (for testing only)
genetic_map <- MetaPipe:::random_map(population = population,
seed = seed)
# Load cross file with genetic map and raw data for normal traits
x <- MetaPipe::read.cross(genetic_map, output$norm)
x <- qtl::calc.genoprob(x, step = 1, error.prob = 0.001)
x_scone <- MetaPipe::qtl_scone(x, 1, model = "normal", method = "hk")
x_qtl_perm <- MetaPipe::qtl_perm_test(x,
n_perm = 5,
model = "normal",
method = "hk",
plots_dir = tmp)
x_qtl_perm_1000 <- MetaPipe::qtl_perm_test(x,
n_perm = 1000,
model = "normal",
method = "hk",
plots_dir = tmp)
# F1 Seedling Ionomics dataset
data(ionomics) # Includes some missing data
data(father_riparia) # Genetic map
ionomics_rev <- MetaPipe::replace_missing(ionomics,
excluded_columns = c(1, 2),
replace_na = TRUE,
out_prefix = paste0(tmp, "/tmp"))
ionomics_normalised <-
MetaPipe::assess_normality(ionomics_rev,
excluded_columns = c(1, 2),
out_prefix = file.path(tmp, "ionomics"),
transf_vals = c(2, exp(1)),
show_stats = FALSE)
# Load cross file with genetic map and raw data for normal traits
x <- MetaPipe::read.cross(father_riparia,
ionomics_normalised$norm,
genotypes = c("nn", "np", "--"))
set.seed(seed)
x <- qtl::jittermap(x)
x <- qtl::calc.genoprob(x, step = 1, error.prob = 0.001)
x_scone <- MetaPipe::qtl_scone(x, 1, model = "normal", method = "hk")
x_qtl_perm <- MetaPipe::qtl_perm_test(x,
n_perm = 5,
model = "normal",
method = "hk",
plots_dir = tmp)
x_qtl_perm_1000 <- MetaPipe::qtl_perm_test(x,
n_perm = 1000,
model = "normal",
method = "hk",
plots_dir = tmp)
# Clean temporal directory
# unlink(tmp, recursive = TRUE, force = TRUE)
MetaPipe:::tidy_up(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.