Traffic: 317 ip/hr
Question: Secondary Structure Analysis with DSSP in R
 
0
 
 

Hi all,

I would like to run DSSP in R using Bio3D package. I tried the following code.But I got error. I am using windows os.

library("bio3d")
pdb <- read.pdb("1CRN")
x <- dssp(pdb, exepath="C:/dssp/dssp.exe")

Error in file(con, "r") : cannot open the connection
 

what is the error that you got? a good idea is to google for the error messages, in the context of the library you're trying to use. most of the time you'll get an answer.

log in to reply • written 14 months ago by dimkal  63018

2 answers

 
1
 
 

I don't know the package/software. But when i google on "bio3d dssp" I find this information:

  1. I think you have to set the path to the .exe, not the location of the .exe it self. So:

    x <- dssp(pdb, exepath="C:/dssp/")

  2. And secondly: "Call the dssp function with this directory as the exepath argument. The value of the exepath argument must end in / (on Linux/Unix/MacOS) or (on Microsoft Windows). Also note that every in an R string constant needs to be doubled, e.g. on Microsoft Windows you will probably need to write something like exepath="C:\path\to\file\" Source: http://www.seehuhn.de/blog/90

Good luck!

 

You do not need to double-backslash when quoting file paths in R.

log in to reply • written 14 months ago by Neilfws ♦♦ 35,29012051
 
 
0
 
 

This error message means that R cannot open a file. The question is, which file?

In my case, running bio3d on Ubuntu, I saw the same error message plus something extra:

In addition: Warning message:
In file(con, "r") :
  cannot open file '/tmp/RtmphuZYHy/file1e5e7dbf452f': No such file or directory

Looking in /tmp/RtmphuZYHy there was indeed no such file, but there were other files with similar names which seemed to be derived from PDB files.

The mystery was solved by examining the code for the dssp() function, which you can do simply by typing "dssp". The first few lines:

function (pdb, exepath = "", resno = TRUE) 
{
    infile <- tempfile()
    outfile <- tempfile()
    write.pdb(pdb, file = infile)
    system(paste(exepath, "dssp -c ", infile, " ", outfile, sep = ""), 
        ignore.stderr = TRUE)
....

The version of DSSP on my machine does not have the "-c" switch (which used to mean "create output in pre-1995 format"). Trying to run it outside of R with that switch gives an error. I will bet that your version of DSSP has the same issue.

So in summary: the dssp() function calls DSSP incorrectly (with an obsolete switch), therefore no output file is written, hence the error message.

To fix this, you will have to edit the code for that function. I'd also suggest filing a bug report with the authors of bio3d, if there is not one already.

 
Log in to add a post