Cannot read pdb file from local directory

Issue #380 resolved
Shayan Monabbati created an issue

I would like to do an nma on a local pdf file. I have tried both:

library(bio3d) myFileNames = list.files(path="MacintoshHD/Users/shayan/Downloads/bio3d/inst/examples/final.casp", pattern=".pdb", full.names = TRUE)

pdbs = pdbaln(myFileNames)

and

xyz <- NULL for(i in myFileNames) { xyz = rbind(xyz, read.pdb(myFileNames)$xyz) }

the first method returns "Error in if (substr(file, 1, 4) == "http") { : missing value where TRUE/FALSE needed" and the second does not do anything.

Ultimately, I want to store the pdf file as a variable so i can proceed with

modes <- nma(pdb)

Comments (6)

  1. Xinqiu Yao

    Hi Shayan,

    It seems there is something wrong in the file path. Can you display the content of myFileNames by simply typing myFileNames? Are files listed all correct?

  2. Xinqiu Yao

    That means either the folder you referred to has no file with extension '.pdb' or the command you used in 'list.files' has an error (e.g. Did you actually want /MacintoshHD/Users...?)

  3. Shayan Monabbati reporter

    So i tried using getwd(R.home()) and it shows the correct path name for the working directory it searches. Turns out the correct file path is /Users/shayan/... (ignore the MacintoshHD and put '/' before and after folder names)

  4. Log in to comment