Identifying mutations between haplotypes using haploNet (pegas) in R
1
1
Entering edit mode
6.1 years ago

I think this might be an easy question, but I could not solve it after reading the pegas documentation. I want to plot an haplotype network using a FASTA file and identify which mutations are separatting the distinct haplotypes.

Example:

fa <- read.FASTA("example.fa")
haps <- haplotype(fa)
haps50 <- subset(haps, minfreq = 50)
(network <- haploNet(haps50))

plot(network, size = attr(network, "freq"),show.mutation=1,labels=T)

enter image description here

How can I identify the position of the mutation in my FASTA file that is separating for example haplotype XX from V?

Extra question: Would it be also possible to know for example, what is the haplotype sequence of one of the haplotypes? For example haplotype V, which is quite frequent?

R pegas haplotypes phylogenetics • 2.9k views
ADD COMMENT
2
Entering edit mode
5.8 years ago
Jie Ping ▴ 40

Yes! We can get the sequence of each haplotype by using function diffHaplo in R package pegas.

For example,

1. generate test data

data(woodmouse)
x <- woodmouse[sample(15, size = 110, replace = TRUE),]
h <- haplotype(x)
(net <- haploNet(h))

Haplotype network with:
15 haplotypes
14 links
54 alternative links
link lengths between 2 and 14 steps
Now, we have 15 haplotypes.

2. get the sequence

as.data.frame(diffHaplo(h,1:15))

The sequences are as follows:
pos I II III IV V VI VII VIII IX X XI XII XIII XIV II.1
1 30 T T T T T T T T C T T T T T T
2 33 C C C C C C C C C T C C C C C
3 35 A A A A A A A G A A A A A A A
4 36 T T T T T T C T T T T T T C T
5 42 C C C T C C C C C C C C C C C
6 51 C T C T C C C C T C T C C C T
7 54 A G A A A A A A A A A A A A G
8 60 T T T T C T T T T T T T T T T
......

ADD COMMENT
0
Entering edit mode

Hi Jie Ping, I run into this answer and I´m currently analyzing haplotypes with pegas. I have the following doubt, maybe you could help me. Why is the diffHaplo() function returning the last haplotype as II.1 if when we call h its calls the last haplotype as XV? I´ll appreciate very much your answer!

ADD REPLY

Login before adding your answer.

Traffic: 1869 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6