Question: Secondary Structure Analysis With Dssp In R
0
gravatar for Pooja
2.1 years ago by
Pooja0
Pooja0 wrote:

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
ADD COMMENTlink written 2.1 years ago by Pooja0

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 REPLYlink written 2.1 years ago by dimkal650
1
gravatar for Robert Ernst
2.1 years ago by
Robert Ernst60
Rotterdam, The Netherlands.
Robert Ernst60 wrote:

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 COMMENTlink written 2.1 years ago by Robert Ernst60

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

ADD REPLYlink written 2.1 years ago by Neilfws41k
0
gravatar for Neilfws
2.1 years ago by
Neilfws41k
Sydney, Australia
Neilfws41k wrote:

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 COMMENTlink written 2.1 years ago by Neilfws41k
Please log in to add an answer.

Help
Access
  • RSS
  • Stats
  • API

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.0.0
Traffic: 370 users visited in the last hour