From 9d0cda2c1dc386cdc79505b34dacbeb164afa765 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 11 Nov 2024 15:14:34 +0300 Subject: fix: fix issue fetching covar: --- scripts/rqtl2_wrapper.R | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'scripts/rqtl2_wrapper.R') diff --git a/scripts/rqtl2_wrapper.R b/scripts/rqtl2_wrapper.R index 5908934..4355769 100644 --- a/scripts/rqtl2_wrapper.R +++ b/scripts/rqtl2_wrapper.R @@ -194,8 +194,6 @@ if (cross$crosstype == "4way"){ aPr <- genoprob_to_alleleprob(pr) } - - #Function to Calculate genotyping error LOD scores cat("Calculating the genotype error LOD scores\n") error_lod <- calc_errorlod(cross, Pr, quiet = FALSE, cores = NO_OF_CORES) @@ -211,12 +209,12 @@ cat("Getting the phenotypes and covariates\n") pheno <- cross$pheno covar <- match(cross$covar$sex, c("f", "m")) # make numeric + if (!is.null(covar)){ names(covar) <- rownames(cross$covar) } print("The covariates are") print(covar) - Xcovar <- get_x_covar(cross) print("The Xcovar are ") print(Xcovar) @@ -308,9 +306,9 @@ perform_genome_scan <- function(cross, # Perform the genome scan for the cross object if (cross$crosstype == "4way"){ - sex <- (DOex$covar$Sex == "male")*1 + sex <- (cross$covar$Sex == "male")*1 names(sex) <- rownames(cross$covar) - sex <- setNames( (cross$covar$Sex == "male")*1, rownames(DOex$covar)) + sex <- setNames( (cross$covar$Sex == "male")*1, rownames(cross$covar)) scan_results <- perform_genome_scan(aPr, cross, kinship=kinship, method = "LOCO", addcovar = sex) } else { scan_results <- perform_genome_scan(cross = cross, -- cgit 1.4.1