[R-sig-ME] prunePed in MCMCglmm
David Duffy
David.Duffy at qimr.edu.au
Wed Feb 5 00:56:52 CET 2014
On Tue, 4 Feb 2014, Adam Hayward wrote:
> Hi all,
>
> I'm having problems using the prunePed function in the MCMCglmm package and
> wondered if anyone else had come across a similar issue.
>
> The result is that I end up with a "prunedpedigree" file which contains
> 5,161 records- one for each phenotyped individual, giving their dam and
> sire. However, it does not provide additional records for the parentage of
> their parents or other informative relatives.
ISTM prunePed() doesn't work if the individual IDs are factors (numeric
and character are OK). With keep=FALSE, prunePed() reduces to this loop:
nind <- length(ind.keep) + 1
while (length(ind.keep) != nind) {
nind <- length(ind.keep)
ind.keep <- union(na.omit(c(unlist(pedigree[, 2:3][match(ind.keep,
pedigree[, 1]), ]))), ind.keep)
}
pedigree <- pedigree[sort(match(ind.keep, pedigree[, 1])),]
which fails for factor IDs in the union of the parental IDs with the
existing set of individual IDs. This was a bit confusing in that the
BTped example uses factor IDs.
Cheers, David Duffy.
| David Duffy (MBBS PhD)
| email: David.Duffy at qimrberghofer.edu.au ph: INT+61+7+3362-0217 fax: -0101
| Genetic Epidemiology, QIMR Berghofer Institute of Medical Research
| 300 Herston Rd, Brisbane, Queensland 4006, Australia GPG 4D0B994A
More information about the R-sig-mixed-models
mailing list