snp.dprime
class encapsulates results returned by
ld.snp
(--- routine to calculate D', $r^2$ and LOD of a
snp.matrix-class
object, given
a range and a depth) and is based on a list of three
named matrices. The lower right triangle of the snp.dprime object returned by ld.snp
always consists zeros. This is delibrate. The associated plotting routine
would not normally access those elements either.
snp.dprime
class is a list of 3 named
matrices dprime
, rsq2
or r
, lod
, and an attribute
snp.names
for the list of snps involved. (Note that if $x$ snps
are involved, the row numbers of the 3 matrices are $(x-1)$).
Only one of r
or rsq2
is present.plot.snp.dprime
.data(testdata)
snps20.20 <- Autosomes[11:20,11:20]
obj.snp.dprime <- ld.snp(snps20.20)
class(obj.snp.dprime)
summary(obj.snp.dprime)
## Not run:
# # The following isn't executable-as-is example, so these illustrations
# # are commented out to stop R CMD check from complaining:
#
# > d<- ld.snp(all, 3, 10, 15)
# rows = 48, cols = 132
# ... Done
# > d
# $dprime
# [,1] [,2] [,3]
# [1,] 1 1 1
# [2,] 1 1 1
# [3,] 1 1 1
# [4,] 1 1 0
# [5,] 1 0 0
#
# $rsq2
# [,1] [,2] [,3]
# [1,] 1.0000000 0.9323467 1.0000000
# [2,] 0.9285714 1.0000000 0.1540670
# [3,] 0.9357278 0.1854481 0.9357278
# [4,] 0.1694915 1.0000000 0.0000000
# [5,] 0.1694915 0.0000000 0.0000000
#
# $lod
# [,1] [,2] [,3]
# [1,] 16.793677 11.909686 16.407120
# [2,] 10.625650 15.117962 2.042668
# [3,] 12.589586 2.144780 12.589586
# [4,] 2.706318 16.781859 0.000000
# [5,] 2.706318 0.000000 0.000000
#
# attr(,"class")
# [1] "snp.dprime"
# attr(,"snp.names")
# [1] "dil118" "dil119" "dil5904" "dil121" "dil5905" "dil5906"
#
# ## End(Not run)
Run the code above in your browser using DataLab