pedigree.shrink.RdShrink pedigree object to specified bit size with priority placed on trimming uninformative subjects. The algorithm is useful for getting a pedigree condensed to a minimally informative size for algorithms or testing that are limited by size of the pedigree.
pedigree.shrink(ped, avail, affected = NULL, maxBits = 16)
# S3 method for class 'pedigree.shrink'
print(x, ...)Pedigree object created by the pedigree function,
vector of binary availability status (0/1), i.e. having data, or sample available
vector of binary affected status (0/1/NA). If NULL, uses first column of the pedigree object affected matrix.
Optional, the bit size for which to shrink the pedigree
pedigree.shrink object used in method functions
optional arguments passed to internal functions
Iteratively remove subjects from the pedigree. The random removal of members was previously controlled by a seed argument, but we remove this, forcing users to control randomness outside the function. First remove uninformative subjects, i.e., unavailable (not genotyped) with no available descendants. Next, available terminal subjects with unknown phenotype if both parents available. Last, iteratively shrinks pedigrees by preferentially removing individuals (chosen at random if there are multiple of the same status): 1. Subjects with unknown affected status, 2. Subjects with unaffected affected status 3. Affected subjects.
data(sample.ped)
pedAll <- pedigree(sample.ped$id, sample.ped$father, sample.ped$mother,
sample.ped$sex, affected=cbind(sample.ped$affected, sample.ped$avail),
famid=sample.ped$ped)
ped1 <- pedAll['1']
pedigree.shrink(ped1, maxBits=12, avail=ped1$affected[,2])
#> Pedigree Size:
#> N.subj Bits
#> Original 41 46
#> Only Informative 28 29
#> Trimmed 13 11
#>
#> Unavailable subjects trimmed:
#> 101 102 107 108 111 113 121 122 123 131 132 134 139
#>
#> Informative subjects trimmed:
#> 141 140 130 126 125 129 133 116