Cannot read pdb file from local directory
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)
-
-
reporter typing myFileNames shows character(0)
-
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...?)
-
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)
-
- changed status to resolved
-
- changed version to v2.3 [devel]
- Log in to comment
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?