brentp / peddy

genotype :: ped correspondence check, ancestry check, sex check. directly, quickly on VCF
MIT License
129 stars 39 forks source link

Ancestry composition #89

Open RoniHaas opened 1 year ago

RoniHaas commented 1 year ago

Hello,

I would appreciate your help with a question about ancestry composition.

Peddy assigns a single ancestry to each individual and gives the corresponding probability (which is the highest) for that prediction. I was wondering if there is a way to know what are the probabilities for ancestries with lower probabilities for the same individual.

For example, if Peddy predicts for an individual an AMR ancestry with a probability of 0.7, can I know what is the prediction for the left 0.3?

My goal is to create a plot, based on that idea for example: image

Thank you!

brentp commented 1 year ago

Hi, this could be done by not simply taking the max here: https://github.com/brentp/peddy/blob/master/peddy/pca.py#L82 I would accept a PR that reports the other probabilities. The interpretation would not be the same as admixture, but might be informative as a proxy.