我写了这段代码:
library(Biostrings)
setwd("C:/Users/User/Documents/SaturdayProject/mDNK/monkeys")
data <- list.files()
tab <- matrix(0, 33, 33, TRUE, NULL)
i <- 1
j <- 1
for (file in data){
d1 <- paste( unlist(read.delim(file)), collapse='')
for (file1 in data){
d2 <- paste( unlist(read.delim(file1)), collapse='')
ack1 <- pid(pairwiseAlignment(d1,d2, scoreOnly = TRUE), type = "PID1")
ack2 <- pid(pairwiseAlignment(d2,d1, scoreOnly = TRUE), type = "PID1")
###print(mean(ack1,ack2))
tab[i,j] <- mean(ack1, ack2)
j <- j + 1
print(tab)
}
j <- 1
i <- i + 1
}
print("end")
但是我得到了:
错误(函数(类,fdef,mtable)):无法找到 签名“数字”的函数“ pid”的继承方法
没有pid的话效果很好。