简体   繁体   English

是否有R函数返回比对的DNA序列的比对分数?

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

I want to take two strings (DNA Sequences) and generate an alignment score. 我想取两个字符串(DNA序列)并生成比对得分。 I found the DECIPHER package but that only let me generate the alignment, not the alignment score. 我找到了DECIPHER软件包,但这只让我生成了比对,而不是比对得分。 I also tried using "Biostrings", but I was unable to generate the score. 我也尝试使用“ Biostrings”,但无法生成分数。

Thanks for your help! 谢谢你的帮助!

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

I'm looking for something like this 我正在寻找这样的东西

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

In Biostrings I did 在《 生物弦》中,我做了

> 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

by following the vignette on pairwise sequence alignment linked from the page above. 通过按照上面页面链接的关于成对序列比对的小插图进行操作。

I also discovered 我也发现

> 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM