This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Haplotypic diversity with pegas package error

Hello,

I'm trying to use haploNet function of {pegas} to plot a haplotype network, but i`m having an error. I can't build a haplotype net with the following script:

library(pegas)
S<- read.dna(file = "C:/Users/.....file.fasta", format ="fasta")
h<-haplotype(S)
net<-haploNet(h)
plot(h)

Error :

Error in integrate(L_jm, 0, 1, j = i, m = M) : non-finite function value
r haplotypic diversity genomic phylogeny

Did you manage to run it with example data provided with the package?

Yes, I used it, but there is no fault. I would like to calculate the haplotypic diversity of 100 aligned bacterial genomes. (fasta file)

I am struggling with the same issue. Did you get it solved?

I think it could be caused by the sequences being to long perhaps?

I also ran into this issue ... you should check and see if your distance matrix has any NA's in it. if fa is your DNAbin, d <- dist.dna(fa) wh.na <- is.na(d) tablewh.na)

Purging sequences that gave NAs in the distance matrix solved my problem. John

0 answers

No answers yet.

Log in to answer this question.