Secondary Structure Analysis With Dssp In R
2
0
Entering edit mode
12.7 years ago
Pooja • 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
r secondary • 7.6k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
3
Entering edit mode
12.7 years ago
Neilfws 49k

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.

ADD COMMENT
1
Entering edit mode
12.7 years ago
Robert Ernst ▴ 60

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!

ADD COMMENT
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2660 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6