error using addint function for mqm

24 views
Skip to first unread message

Atoosa Samani

unread,
Mar 2, 2023, 5:12:39 PM3/2/23
to R/qtl discussion
Hi all,

I am getting this error for when I run addint for MQM. how should I fix it.

Error in model.frame.default(formula = pheno ~ Xadjustment$sexpgmcovar,  :
  variable lengths differ (found for 'Xadjustment$sexpgmcovar')

Atoosa Samani

unread,
Mar 2, 2023, 5:25:19 PM3/2/23
to R/qtl discussion
I have a qtl on sex linkage group. when I remove that qtl from the the formula, it works. but otherwise it doesn't.

Karl Broman

unread,
Mar 2, 2023, 5:32:26 PM3/2/23
to R/qtl discussion
It’s hard to tell from the limited information you’ve provided. Could you show at least the code you have used? 

It can be very hard to resolve this sort of problem without access to the data.

karl

Atoosa Samani

unread,
Mar 2, 2023, 5:36:39 PM3/2/23
to R/qtl discussion
thank you for your response. here is the code and the error massage.

qtl<- makeqtl(cross, chr=c(6,11,19,'X',8,5,1,3), pos=c(19.2, 474,68.7,344,268,538,1123,438))
formula_col_23_1 <- y~q1:q2+q1:q3+q1:q4+q1:q5+q1:q6+q1:q7+q1:q8
out.fq_col_23_1 <- fitqtl(cross, pheno.col = 23, qtl, formula=formula_col_23_1)
summary(out.fq_col_23_1)

addint(cross, pheno.col = 23, qtl = qtl, formula=formula_col_23_1, covar = Covariate)

Error in model.frame.default(formula = pheno ~ Xadjustment$sexpgmcovar,  :
  variable lengths differ (found for 'Xadjustment$sexpgmcovar')
In addition: Warning message:
In addint(cross, pheno.col = 23, qtl = qtl, formula = formula_col_23_1,  :
  Dropping 31 individuals with missing phenotypes.

Karl Broman

unread,
Mar 3, 2023, 10:26:11 AM3/3/23
to R/qtl discussion
I was able to reproduce the problem with the `fake.f2` dataset. It seems that `addint()` is not subsetting the data properly.

In the meantime, if you remove individuals with missing phenotype, you can probably get things to work.

Covariate_sub <- Covariate[!is.na(cross$pheno[,23]), ]
cross_sub <- subset(cross, ind=!is.na(cross$pheno[,23]))
qtl<- makeqtl(cross_sub, chr=c(6,11,19,'X',8,5,1,3), pos=c(19.2, 474,68.7,344,268,538,1123,438))

addint(cross_sub, pheno.col = 23, qtl = qtl, formula=formula_col_23_1, covar = Covariate_sub)

karl
Reply all
Reply to author
Forward
0 new messages