magnusdv / quickped

An online pedigree tool for research applications. Build pedigrees interactively and store as images or text files in ped format. QuickPed also computes a variety of relatedness coefficients and offers verbal descriptions of pairwise relationships.
https://magnusdv.shinyapps.io/quickped
GNU General Public License v3.0
23 stars 3 forks source link

Removing individuals #5

Closed thoree closed 1 year ago

thoree commented 2 years ago

I am not allowed to remove individuals 201, 202 and 203 in the pedigree below: image

magnusdv commented 2 years 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!

magnusdv commented 1 year ago

This feature was rewritten in QuickPed 3.0.0, splitting the "Remove individuals" in two: