![](/img/trans.png)
[英]How to improve the performance of an R function that returns coordinates for aligned sequences?
[英]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
在《 生物弦》中,我做了
> 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
通過按照上面頁面鏈接的關於成對序列比對的小插圖進行操作。
我也發現
> 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.