monarch-initiative / gpsea

A Python library for discovery of genotype-phenotype associations
https://monarch-initiative.github.io/gpsea/stable
MIT License
5 stars 1 forks source link

Allow merging `Cohort`s #294

Open ielis opened 1 month ago

ielis commented 1 month ago

We may want to overload __add__ or __or__ operators on Cohort to allow merging two cohorts, because a cohort is essentially a set of individuals. The merge can succeed as long as there is no individual with the same ID present in both cohorts.

pnrobinson commented 1 month ago

It seems to be just as easy to "extend" lists of phenopackets, so not sure that we need this additional function? @ielis

ielis commented 1 month ago

The flip side of merging phenopackets is that we must do Q/C and functional annotation to go from phenopacket -> cohort, while if we merge Cohorts, we are already past that. So, the only thing to verify is that the variants are on the same build, HPO on the same version, and the sets of individuals are disjoint.

However, it is indeed probably a low priority.