From fe1e3b600511ceedbd6778618d2c0d7e9ea2ffb6 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Fri, 25 Oct 2024 16:51:55 +0300 Subject: feat: add function to fetch load peaks for 1 QTL. --- scripts/rqtl2_wrapper.R | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/rqtl2_wrapper.R b/scripts/rqtl2_wrapper.R index babf19e..cbf2b93 100644 --- a/scripts/rqtl2_wrapper.R +++ b/scripts/rqtl2_wrapper.R @@ -315,7 +315,7 @@ perform_permutation_test <- function(cross, } else if (method == "LOCO") { kinship = calc_kinship(genome_prob, "loco") - operm3 <- scan1perm( + perm <- scan1perm( genome_prob, cross$pheno, kinship = kinship , @@ -331,3 +331,22 @@ perform_permutation_test <- function(cross, perm <- perform_permutation_test(dataset, Pr, n_perm = 2, method = "LMM") # get the permutation summary with a significance threshold summary(perm, alpha = c(0.2, 0.05)) + +# find function to perform the LOD peaks + +find_lod_peaks <-function(scan_results, cross, threshold=4, drop=1.5){ +# can this take pmap??? which map should we use??? +# TODO add more ags +print("Finding the lod peaks with thresholds n and drop n\n") +return (find_peaks(scan_results, cross$gmap, threshold= threshold, drop=drop)) +} + +# add the number of cores +lod_peaks <- find_lod_peaks(results, dataset) +print(load_peaks) + +# how can we perform qtl effect computations ??? with input from user + +# what data should we return to the user + +# improve on this script \ No newline at end of file -- cgit 1.4.1