projectglow / glow

An open-source toolkit for large-scale genomic analysis
https://projectglow.io
Apache License 2.0
264 stars 111 forks source link

Phenotypes and Covariates not automatically filtered to match genotype table #401

Open williambrandler opened 3 years ago

williambrandler commented 3 years ago

When performing genetic association studies, the methods assume that the genotypes and phenotypes/covariates match 1:1. But usually the genotypes are a subset of the full sample set in the phenotypes and covariates files.

Right now the solution is the extract the sample IDs using glow.wgr.get_sample_ids, convert this list to a pandas dataframe, add an index, then inner join to the phenotypes / covariates, and back to a spark dataframe and sort on the index (at least until delta lake adds ingest order preservation functionality).

This filtering should either be performed on the fly or there should be explicit recommendations / notebooks to show how to do it in the docs