Skip to content

Commit

Permalink
Merge pull request #34 from chabrault/patch-22
Browse files Browse the repository at this point in the history
Fix bug: add precise QTL peak position in qtl.df
  • Loading branch information
Timothée Flutre authored Dec 12, 2019
2 parents 26022dd + 5efbc98 commit a647401
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/qtl.R
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,11 @@ MIMQTL <- function(cross, numeric.chr.format=FALSE,
}

QTLest <- temp
tmp <- strsplit(QTLest$Terms, split="@")
QTLest$linkage.group <- suppressWarnings(as.numeric(unlist(lapply(tmp, `[`, 1))))
QTLest$position <- suppressWarnings(as.numeric(unlist(lapply(tmp, `[`, 2))))
## Add a column for further order purpose
QTLest$ord <- seq(from=1, to=nrow(QTLest), by=1)
if(all(QTLest$df == "NO QTL")){
QTLest[,c(1:ncol(QTLest))] <- NA
}

## Refine QTL location
refine <- list()
if (all(qtl == "NO QTL")) { # if Null model
Expand All @@ -623,6 +619,8 @@ MIMQTL <- function(cross, numeric.chr.format=FALSE,
refine <- qtl::refineqtl(cross, pheno.col=pheno.col, qtl=qtl,
formula=form, method=method, verbose=verbose,
keeplodprofile=TRUE)
QTLest$position <- refine$pos
QTLest$linkage.group <- refine$chr
}

## Confidence intervals
Expand Down Expand Up @@ -662,7 +660,6 @@ MIMQTL <- function(cross, numeric.chr.format=FALSE,
CI <- temp4
CI[,c(2:6)] <- suppressWarnings(lapply(CI[,c(2:6)], as.character))
CI[,c(2:6)] <- suppressWarnings(lapply(CI[,c(2:6)], as.numeric))
CI$position <- round(CI$position, digits=1) # position is rounded in QTLest

## QTL table
if(all(apply(QTLest, 1, is.na)) & all(apply(CI[-1], 1, is.na))){
Expand Down

0 comments on commit a647401

Please sign in to comment.