10 Mixed models - Solutions
Run a sliding window test using the mixed model and make a QQ plot.
seqResetFilter(seqData, verbose=FALSE)
iterator <- SeqVarWindowIterator(seqData, windowSize=5000, windowShift=2000, verbose=FALSE)
assoc <- assocTestAggregate(iterator, nullmod, test="Burden", AF.max=0.1, weight.beta=c(1,1))
## # of selected samples: 100
head(assoc$results)
## chr start end n.site n.alt n.sample.alt Score Score.SE
## 1 1 966001 971000 1 3 3 -0.08539608 0.14196049
## 2 1 982001 987000 1 9 9 -0.22241847 0.23151042
## 3 1 1022001 1027000 0 0 0 NA NA
## 4 1 1262001 1267000 0 0 0 NA NA
## 5 1 1468001 1473000 1 1 1 -0.08038066 0.08682407
## 6 1 1732001 1737000 0 0 0 NA NA
## Score.Stat Score.pval Est Est.SE PVE
## 1 -0.6015483 0.5474749 -4.237435 7.044214 0.004020670
## 2 -0.9607277 0.3366891 -4.149825 4.319460 0.010255530
## 3 NA NA NA NA NA
## 4 NA NA NA NA NA
## 5 -0.9257877 0.3545563 -10.662800 11.517543 0.009523144
## 6 NA NA NA NA NA
head(assoc$variantInfo)
## [[1]]
## variant.id chr pos allele.index n.obs freq MAC weight
## 1 1 1 970546 1 100 0.015 3 1
##
## [[2]]
## variant.id chr pos allele.index n.obs freq MAC weight
## 1 2 1 985900 1 100 0.045 9 1
##
## [[3]]
## [1] variant.id chr pos allele.index n.obs
## [6] freq MAC weight
## <0 rows> (or 0-length row.names)
##
## [[4]]
## [1] variant.id chr pos allele.index n.obs
## [6] freq MAC weight
## <0 rows> (or 0-length row.names)
##
## [[5]]
## variant.id chr pos allele.index n.obs freq MAC weight
## 1 5 1 1472676 1 100 0.005 1 1
##
## [[6]]
## [1] variant.id chr pos allele.index n.obs
## [6] freq MAC weight
## <0 rows> (or 0-length row.names)
qqPlot(assoc$results$Score.pval)
seqClose(gds)