Closed thoree closed 1 year ago
Thanks, I agree this looks like a bug.
The command pedtools::removeIndividuals(x, ids)
which works behind the scenes here, is not very advanced: it removes ids
and all their descendants. In your example that leaves an empty pedigree, hence the error message.
The problem of removing individuals (so that the result is a proper pedigree) is surprisingly confusing in general. For instance, suppose you remove individual 203 in your example. What should be the result? Here are 3 possibilities:
The last strategy, i.e., removing all descendants, is the one currently adopted by removeIndividuals()
.
As your example shows, the implementation clearly has room for improvement. I'll look into it!
This feature was rewritten in QuickPed 3.0.0, splitting the "Remove individuals" in two:
I am not allowed to remove individuals 201, 202 and 203 in the pedigree below: