是否有 returns 比对 DNA 序列比对得分的 R 函数?

Is there an R function that returns the alignment score of aligned DNA sequences?

我想获取两个字符串(DNA 序列)并生成比对分数。我找到了 DECIPHER 包,但它只让我生成比对,而不是比对分数。我也尝试使用 "Biostrings",但无法生成分数。

感谢您的帮助!

string1 <- "ACAGT"
string2 <- "CCAGTA"

我正在寻找这样的东西

t <- FunctionThatWouldReturnAlignmentScore(string1, string2)
print(t) # this returns 2

Biostrings 我做到了

> aln = pairwiseAlignment(pattern = c("succeed", "precede"), subject = "supersede")
> aln
Global PairwiseAlignmentsSingleSubject (1 of 2)
pattern: succ--eed
subject: supersede
score: -33.99738
> score(aln)
[1] -33.99738 -25.11710

按照上面页面链接的 pairwise sequence alignment 上的小插图进行操作。

我也发现了

> dist = stringDist(DNAStringSet(c(string1, string2)))
> methods(class=class(dist))
[1] as.matrix   coerce      format      initialize  labels      print
[7] show        slotsFromS3
see '?methods' for accessing help and source code
> as.matrix(dist)
  1 2
1 0 2
2 2 0