# Gaps and Ns will match any character
seq <- c(A="ATGGC", B="ATGGG", C="ATGGG", D="AT--C", E="NTGGG")
d <- pairwiseEqual(seq)
rownames(d) <- colnames(d) <- seq
d
# Ignore only Ns, so that gaps are not treated as matching any character
d <- pairwiseEqual(seq, ignore="N")
rownames(d) <- colnames(d) <- seq
d
Run the code above in your browser using DataLab