I have 20 DNA sequences from 4 sampling location, 5 individual each location. I would like to make haplotype network using R studio. Based on the analysis, It was written that I have 8 haplotypes. However, I cannot give different color for each location, especially when there are sharing haplotype between locations.
Here is my script
library("ape")
library("pegas")
read.dna("FIKS YA.fasta", format="fasta") -> Naso
Naso
NasoHaps <- haplotype(Naso)
NasoHaps
NasoNet <- haploNet(NasoHaps)
pop <- rep(paste0("pop", 1:4), each = 5)
region <- rep(c("regA", "regB", "regC", "regD"), each = 5)
table(region, pop)
h <- haplotype(Naso)
h
d <- dist.dna(NasoHaps, "N")
nt <- rmst(d, quiet = TRUE)
nt
plot(nt)
This is the output
Could anyone help me how to distinguish each haplotype based on the sampling locations and give them different color based on sampling locations? please note: these instructions are ambiguos
pop <- rep(paste0("pop", 1:4), each = 5)
region <- rep(c("regA", "regB", "regC", "regD"), each = 5)