#generating an alignment file:
cat(">Population1_sequence1",
"TTATAGGTAGCTTCGATATTG",
">Population2_sequence1",
"TTA---GTAGCTTCGAAATTG",
">Population3_sequence1",
"TTA---GTA---TCG---TAG",
">Population4_sequence1",
"TTATAGGTA---TCG---TTG",
">Population5_sequence1",
"TTA------------AAATTG",
file = "ex1.fas", sep = "")
# Reading the alignment directly from file:
FindHaplo(input="ex1.fas")
# Reading the alignment from an object:
library(ape)
example1<-read.dna(file="ex1.fas",format="fasta")
FindHaplo(align=example1)Run the code above in your browser using DataLab