I’m struggling to load the BLOSUM62 matrix in R, that I know it should be inside the package Biostrings
. I’m new in R, I’m following an exercise that uses this matrix without problems, while when I try to compile I get the error
dataset not found
I tried to reinstall Biostring but I cannot fix it.
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("Biostrings")
library(Biostrings)
data("BLOSUM62")
In data(“BLOSUM62”) : dataset ‘BLOSUM62’ not found
I also tried to download the matrix from NCBI I load it correctly from a .txt and convert it into a 25×25 matrix
BLOSUM62=read.table("BLOSUM62.txt", header = TRUE)
BLOSUM62 <- data.matrix(BLOSUM62)
and it works, but then I should compare it with another dataset (from the exercise did it in class) I get the error
Gene <- msa(Geneseq, substitutionMatrix = "blosum", method = "ClustalW")
cs <- msaConservationScore(Gene, BLOSUM62)
Error in msaConservationScore.matrix(mat, …) :
substitution matrix is not in proper format
How can I solve it?