This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Position specific scoring matrix, protr package

I'm trying to calculate "PSSM feature" using protr package. I tried to adapt the example in the documentation to fit my data, but I always get an error.

Here is my code:

x <- readFASTA('P08195.fasta')[[1]]
dbpath <- tempfile("tempdb", fileext = ".fasta")
invisible(file.copy(from = system.file('P08195.fasta'),to = dbpath) )

pssmmat <- extractPSSM(seq = x, database.path = dbpath)
pssmfeature <- extractPSSMFeature(pssmmat)
head(pssmfeature)

Here is the error message:

Warning message in readLines(file):
"incomplete final line found on 'P08195.fasta'"
Warning message in file(con, "r"):
"cannot open file 'C:\Users\Adham\AppData\Local\Temp\RtmpaGM54r\protrPSIBlast433023ad2ce8.pssm': No such file or directory"
Error in file(con, "r"): cannot open the connection
Traceback:

1. extractPSSM(seq = x, database.path = dbpath)
2. readLines(PSSMfile)
3. file(con, "r")

I'm not so familiar with R since I use Python mainly. How can I solve this issue?

r pssm protr

1 answer

found the solution: the error came from system.file('P08195.fasta') , I just removed it , the correct code is:

x <- readFASTA('P08195.fasta')[[1]]
dbpath <- tempfile("tempdb", fileext = ".fasta")
invisible(file.copy('P08195.fasta',to = dbpath) )
pssmmat <- extractPSSM(seq = x, database.path = dbpath)
pssmfeature <- extractPSSMFeature(pssmmat)
head(pssmfeature)

Log in to answer this question.