emmanuelparadis / pegas

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

Extracting the frequencies from a "haplotype.loci" object #66

Closed awshort closed 2 years ago

awshort commented 2 years ago

Dear Dr. Paradis,

I am trying to change the size of the haplotype symbols in my plot based on the haplotype frequencies. However, I am having trouble extract the frequencies from my "haplotype.loci" object. I believe this is due to differences between a "haplotype.loci" object and a "haplotype" object and I was wondering if there was any way to extract the frequencies using either summary or some other function from the pegas package?

I am sorry for asking such a basic question and I greatly appreciate your help.

Sincerely,

Aidan Short

emmanuelparadis commented 2 years ago

Dear Aidan,

You can get these frequencies with:

hap <- haplotype(..... # your "loci" object
attr(hap, "freq")

You're correct that the code works differently for these two classes. The functions for "loci" objects are still in development. Best, Emmanuel

awshort commented 2 years ago

Dear Emmanuel,

Thank you so much!

Sincerely, Aidan