about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander_Kabui2024-11-11 11:49:42 +0300
committerAlexander_Kabui2024-11-11 11:49:42 +0300
commit3efd12e3058e300e7d99e9233699a31088c2fcd1 (patch)
tree5ed01a450c5c001ddb867b757b0bf3b3ac97c66f /scripts
parent038b3cd1416d406ae8a55948795c93a3106b4acc (diff)
downloadgenenetwork3-3efd12e3058e300e7d99e9233699a31088c2fcd1.tar.gz
feat: add plots for qtl effect multi parent population.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rqtl2_wrapper.R18
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/rqtl2_wrapper.R b/scripts/rqtl2_wrapper.R
index a4fcbfb..f2d6a87 100644
--- a/scripts/rqtl2_wrapper.R
+++ b/scripts/rqtl2_wrapper.R
@@ -497,16 +497,32 @@ covar
 
 
 meffects <- c()
+meffects_plots <- c()
+
 # TODO add plots for meffects
 for (chr in chr_names(dataset)){
   cat("Getting the qtl effect for chromosome", chr)
   cat("\n")
    if (dataset$crosstype == "4way"){
      coeff_results <- get_qtl_effect(chr, aPr, pheno, LOCO="LOCO", covar = sex)
+     file_name = genRandomFileName(prefix = "RQTL_EFFECT_", file_ext = ".png")
+     image_loc = file.path(base_dir , file_name)
+     par(mar=c(4.1, 4.1, 0.6, 0.6))
+       png(image_loc,
+      width = 1000,
+      height = 600,
+      type = 'cairo-png') 
+      plot(
+      coeff_results,
+      cross$gmap[chr],
+     bgcolor="gray95",
+     legend="bottomleft"
+     )
+     meffects <- append(meffects_plots, image_loc)
    } else {
     coeff_results  <- get_qtl_effect(chr, Pr, pheno)
    }
-
+ 
     meffects <- append(meffects, coeff_results)
 }