r2fast {GenABEL} | R Documentation |
Given a set of SNPs, computes a matrix of r2
r2fast(data, snpsubset, cross.snpsubset, idsubset)
data |
object of snp.data-class |
snpsubset |
Index, character or logical vector with subset of SNPs to run analysis on.
If missing, all SNPs from data are used for analysis. |
cross.snpsubset |
Parameter allowing parallel implementation. Not to be used normally. If supplied together with snpsubset, the r2 for all pairs between snpsubset and cross.snpsubset computed. |
idsubset |
Index, character or logical vector with subset of IDs to run analysis on.
If missing, all people from data are used for analysis. |
The function is based on slightly modified code of Hao et al.
A (Nsnps X Nsnps) matrix giving r2 values between a pairs of SNPs above the diagonal and number of SNP genotype measured for both SNPs below the diagonal
Yurii Aulchenko
Hao K, Di X, Cawley S. (2006) LdCompare: rapid computation of single- and multiple-marker r2 and genetic coverage. Bioinformatics, 23: 252-254.
data(ge03d2) # r2s using r2fast a <- r2fast(ge03d2,snps=c(1:10)) # r2s using package genetics b <- LD(as.genotype(ge03d2[,1:10]))$"R^2" # see that the r2s are not exactly the same cor(a[upper.tri(a)],b[upper.tri(b)]) plot(a[upper.tri(a)],b[upper.tri(b)])