Create effect plots for significant QTLs found with
qtl_perm_test
.
effect_plots(x_data_sim, qtl_data, cpus = 1, plots_dir = tempdir())
Cross-data frame simulated with qtl::sim.geno
.
Significant QTL data.
Number of CPUs to be used in the computation.
Output directory for plots.
# Toy dataset
excluded_columns <- c(1, 2)
population <- 5
seed <- 1
example_data <- data.frame(ID = 1:population,
P1 = c("one", "two", "three", "four", "five"),
T1 = rnorm(population),
T2 = rnorm(population))
# \donttest{
example_data_normalised <-
data.frame(index = rep(c(1, 2), each = 5),
trait = rep(c("T1", "T2"), each = 5),
values = c(example_data$T1, example_data$T2),
flag = "Normal",
transf = "",
transf_val = NA,
stringsAsFactors = FALSE)
out_prefix <- file.path(tempdir(), "metapipe")
example_data_normalised_post <-
MetaPipe:::assess_normality_postprocessing(example_data,
excluded_columns,
example_data_normalised,
out_prefix = out_prefix)
# Create and store random genetic map (for testing only)
genetic_map <-
MetaPipe:::random_map(population = population, seed = seed)
write.csv(genetic_map,
file.path(tempdir(), "metapipe_genetic_map.csv"),
row.names = FALSE)
# Load cross file with genetic map and raw data for normal traits
x <- qtl::read.cross(format = "csvs",
dir = tempdir(),
genfile = "metapipe_genetic_map.csv",
phefile = "metapipe_raw_data_norm.csv")
#> --Read the following data:
#> 5 individuals
#> 100 markers
#> 3 phenotypes
#> --Cross type: f2
set.seed(seed)
x <- qtl::jittermap(x)
x <- qtl::calc.genoprob(x, step = 1, error.prob = 0.001)
x_qtl_perm <-
MetaPipe::qtl_perm_test(x, n_perm = 5, model = "normal", method = "hk")
x_sim <- qtl::sim.geno(x)
MetaPipe::effect_plots(x_sim, x_qtl_perm)
# }