
findRelatives(gtdata, nmeivec = c(1:2), q = NULL, epsilon = 0.01, quiet = FALSE, OddsVsNull = 1000, OddsVsNextBest = 100, twoWayPenalty = log(10), doTwoWay = TRUE, vsIDs = NULL, gkinCutOff = NULL, kinshipMatrix = NULL)
(2) it reports likelihood, allowing for more rigorous inferences
If 'gtdata' are provided as a matrix (or 'databel' matrix), genotypes should be coded as 0, 1, or 2; each SNP corresponds to a column and each ID is a row. 'q' corresponds to the frequency of 'effect' (aka 'coded') allele, which is also equivalent to the mean(SNP)/2.0 provided coding is correct.
'nmeivec' is a sequence of integers, e.g. c(1,2) will test for parent-offspring pairs and pairs separated by two meioses (sibs, grandparent-grandchild, etc.). If 'nmeivec' does not contain '0' as its first element, it will be automatically added (testing for twins). Also, nmeivec will be updated with c(nmeivec,max(nmeivec)+1,100) to allow for thesting of testing vs. 'null' (unrelated, 100) and 'most distant' specified by user (max(nmeivec)).
While one may be interested to test only a sub-set of the data for relationships, it is recommended to provide 'q' estimated using all data available (see example).
'gkinCutOff' allows use of genomic kinship matrix (computed internally) to pre-screen pairs to be tested. Use of this option with value '-1' is recommended: in this case threshod is set to 0.5^(max(nmeivec)+2). If not NULL, only pairs passing gkinCutOff are tested with the likelihood procedure.
After likelihood estimation, inference on relationship is made. Releationship (in terms of number of meioses) is 'guessed' if odds of likelihoods under the meiotic distance providing max likelihood and under the 'null' (maximal meiotic distance tested + 100) is greater than 'OddsVsNull' parameter AND odds max-lik vs. the next-best meiotic distance is greater than 'OddsVsNextBest' parameter.
require(GenABEL.data)
data(ge03d2.clean)
df <- ge03d2.clean[,autosomal(ge03d2.clean)]
df <- df[,sort(sample(1:nsnps(df),1000))]
eaf <- summary(gtdata(df))$"Q.2"
### donotrun
## Not run:
# relInfo <- findRelatives(df[27:30,],q=eaf)
# relInfo
# # look only for 1st and 2nd degree relatives
# relInfo1 <- findRelatives(df[27:30],q=eaf,gkinCutOff=-1,nmeivec=c(1,2,3))
# relInfo1
# relInfoVS <- findRelatives(df[27:30,],q=eaf,nmeivec=c(1:6),vsIDs=idnames(df[27:30,])[1:2])
# relInfoVS
# ## End(Not run)
### end norun
Run the code above in your browser using DataLab