emmanuelparadis / pegas

Population and Evolutionary Genetics Analysis System
GNU General Public License v2.0
27 stars 10 forks source link

Computing the frequencies of haplotypes for each population from "loci" objects #67

Closed awshort closed 2 years ago

awshort commented 2 years ago

Dear Emmanuel,

Sorry to bother you with more questions about getting information from loci objects as I know the functions for "loci" objects are still in development. However, I am trying to color the haplotype symbols in my plot based on the haplotype frequencies for each population from my "loci" object and I wanted to ask whether you know of a way to compute the frequencies of haplotypes for each population from a "loci" object like the haploFreq function does for "DNAbin" objects?

Thank you for your help!

Sincerely, Aidan Short

emmanuelparadis commented 2 years ago

Dear Aidan, There's no direct tool/function to do this (as I know). One difficulty is that for diploid data, a single individual may have two haplotypes, so you need to duplicate the population variable.

awshort commented 2 years ago

Dear Emmanuel,

Got it, I figured that might be the case. Thank you for your response! I will try a few things and if I figure something out I will post it here just in case anyone else has the same question.

Thank you!

Aidan