kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

refineqtl can give min(diff(a)) warnings #78

Closed kbroman closed 5 years ago

kbroman commented 5 years ago

It was reported in the R/qtl discussion group that refineqtl() can give a bunch of warnings about min(diff(a)), like this:

In min(diff(a)) : no non-missing arguments to min; returning Inf

I suspect this is in the case of a chromosome with a single marker, in which case diff(a) would be length 0. Here's an example:

data(fake.bc)
fake.bc <- fake.bc[c(2,5),]
fake.bc <- drop.markers(fake.bc, markernames(fake.bc, chr=2)[-1])
fake.bc <- calc.genoprob(fake.bc)
qtl <- makeqtl(fake.bc, chr=c(2,5), pos=c(0, 10), what="prob")
rqtl <- refineqtl(fake.bc, qtl=qtl, method="hk")