read.ncdf(trjfile, headonly = FALSE, verbose = TRUE, time = FALSE, first = NULL, last = NULL, stride = 1, cell = FALSE, at.sel = NULL)
first
and last
have the
time unit ps; Otherwise the unit is the frame number. last
time or frame number; If NULL or
equal to -1, read until the end of the file(s). stride
frame(s) headonly
is FALSE return cell
information only. Otherwise, return header or coordinates.Read coordinate data from a binary netCDF trajectory file.
Reads a AMBER netCDF format trajectory file with the help of David W. Pierce's (UCSD) ncdf4 package available from CRAN.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696. http://www.unidata.ucar.edu/software/netcdf/ http://cirrus.ucsd.edu/~pierce/ncdf/ http://ambermd.org/formats.html#netcdf
See AMBER documentation for netCDF format description.
NetCDF binary trajectory files are supported by the AMBER modules sander, pmemd and ptraj. Compared to formatted trajectory files, the binary trajectory files are smaller, higher precision and significantly faster to read and write.
NetCDF provides for file portability across architectures, allows for backwards compatible extensibility of the format and enables the files to be self-describing. Support for this format is available in VMD.
If you experience problems reading your trajectory file with read.ncdf() consider first reading your file into VMD and from there exporting a new DCD trajectory file with the 'save coordinates' option. This new file should be easily read with read.dcd().
##-- Read example trajectory file trtfile <- system.file("examples/hivp.dcd", package="bio3d") trj <- read.dcd(trtfile)NATOM = 198 NFRAME= 117 ISTART= 0 last = 117 nstep = 117 nfile = 117 NSAVE = 1 NDEGF = 0 version 24 Reading (x100) |======================================================================| 100%## Write to netCDF format write.ncdf(trj, "newtrj.nc") ## Read trj trj <- read.ncdf("newtrj.nc")[1] "Reading file newtrj.nc" [1] "Produced by program: bio3d" [1] "File conventions AMBER version 1.0" [1] "Frames: 117" [1] "Atoms: 198"