emmanuelparadis / pegas

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

Get differences between haplotypes #46

Closed jcgrenier closed 4 years ago

jcgrenier commented 4 years ago

Hello @emmanuelparadis ,

I have another question, we are trying to get the labels on the edges that are linking two haplotypes together in the network file. We are actually working an add-on that will use your resulting haplotype network object. Would there be any way to get the specific mutation differentiating two haplotypes?

Thanks a lot for your help!

JC

emmanuelparadis commented 4 years ago

Hi JC,

The structure is explained in ?haploNet. You can also have a look at the structure of the objects, for instance:

net <- haploNet(... # or rmst(....
str(net)
jcgrenier commented 4 years ago

Thanks for the reply!

I looked at it, I also looked at the attributes of the objects. In fact, we would be interested to recover the distance between two haplotypes and the specific mutations. Could you point us how to do this? Do we need to get back to the DNAbin object?

Thanks a lot for your help and the quick reply!

JC

emmanuelparadis commented 4 years ago

The function diffHaplo will help you for this: it takes two haplotypes (or DNA sequences) and outputs a data frame with the differences. Since you get the haplotype network, you don't need to look at all pairs of haplotypes, just the pairs connected by the links (i.e., the rows the haploNet object).

jcgrenier commented 4 years ago

Oh! OK! I see, thanks a lot Emmanuel!

Have a great day! JC