I am trying to use adegent in R for calculating the Tajima's D. I have a DNA.bin object containing my sequences from different populations. The sequences are of varying length because of the SNP and indels in them. I get the following error when I run the tajima.test function:
Error in as.matrix.DNAbin(x) :
DNA sequences in list not of the same length.
How could one deal with calculating Tajima's D for sequences of different length?
The input requires that the sequences be aligned, i.e., all sites are homologous. Think of it this way: how will you know which site an insertion or deletion corresponds to in other sequences if they are not aligned? Additionally, if sequences are not the same length, how would you calculate the number of segregating sites or pi?