项目作者: psykhi

项目描述 :
Sequence alignment algorithms
高级语言: Go
项目地址: git://github.com/psykhi/sequencing.git
创建时间: 2018-01-07T18:52:10Z
项目社区:https://github.com/psykhi/sequencing

开源协议:

下载


This package contains implementation of 4 dynamic programming algorithms:

Levenshtein distance

  1. d := LevenshteinDistance([]byte("kitten"), []byte("sitting"), nil, nil)
  2. //d ==3

Needleman-Wunsch

The NW implementation requires the user to provide a similarity function that can return the similarity between two points

  1. func similarity(a byte, b byte) int {
  2. if a == b {
  3. return 1
  4. }
  5. return -1
  6. }
  7. a := []byte("ABCDEF")
  8. b := []byte("ABCCDEF")
  9. z, w := NeedlemanWunsch(a, b, -1, similarity, f)