library(devtools) # make sure devtools is installed
install_github("jtlovell/qtlTools")
library(qtlTools) # make sure qtl is installed

library(qtlTools)
data(multitrait)
cross <- multitrait
cross <- calc.genoprob(cross)
phes <- phenames(cross)[1:20]
s1 <- scanone(cross, pheno.col = phes, method = "hk")
perms <- scanone(cross, pheno.col = phes, method = "hk",
n.perm = 100, verbose=F)
cis<-calcCis(cross, s1.output = s1, perm.output = perms)
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5)
Dear John, i am getting an error message while using the script below.
> library(devtools) > library(qtlTools) > library(qtl) > library(plyr) > data(multitrait) > cross<-multitrait > cross<-calc.genoprob(cross) > phes <- c("X3.Hydroxypropyl", "X3.Butenyl", "X3.Methylsulfinylpropyl", + "X5.Methylsulfinylpentyl", "X6.Methylthiohexyl", + "X4.Benzoyloxybutyl", "Quercetin.deoxyhexosyl.dihexoside") > stepout<-lapply(phes, function(i) { + stepwiseqtl(cross, pheno.col=i, method="hk", max.qtl=4, + additive.only=TRUE, penalties = c(2.5,3.5,1.5), verbose=F) + }) > names(stepout)<-phes > models.out<-stepout > cis<-lapply(models.out, function(x) { + calcCis(mod=x, qtlnames=x$altname, ci.method="bayes", prob=0.99, returnChr=TRUE, returnMaxLod=TRUE, expandtomarkers=T) + }) > cis.df<-ldply(cis, data.frame) > colnames(cis.df)[1]<-"phe" > segmentsOnMap(cross=cross, phe=cis.df$phe, chr=cis.df$chr, l = cis.df$lowposition, h =cis.df$highposition, + lwd = 8, segSpread=.1) Error in `$<-.data.frame`(`*tmp*`, "x", value = c(0, 1)) : replacement has 2 rows, data has 3 In addition: Warning messages: 1: In m$pos >= tem$l[tem$phe == j] : longer object length is not a multiple of shorter object length 2: In m$pos <= tem$h[tem$phe == j] : longer object length is not a multiple of shorter object length 3: In m$pos >= tem$l[tem$phe == j] : longer object length is not a multiple of shorter object length 4: In m$pos <= tem$h[tem$phe == j] : longer object length is not a multiple of shorter object length