read.ncdf {bio3d}R Documentation

Read AMBER Binary netCDF files

Description

Read coordinate data from a binary netCDF trajectory file.

Usage

read.ncdf(trjfile, headonly = FALSE, verbose = TRUE)

Arguments

trjfile name of trajectory file to read.
headonly logical, if TRUE only trajectory header information is returned. If FALSE only trajectory coordinate data is returned.
verbose logical, if TRUE print details of the reading process.

Details

Reads a AMBER netCDF format trajectory file with the help of David W. Pierce's (UCSD) ncdf package available from CRAN.

Value

Either a list of trajectory header data or a numeric matrix of xyz coordinates with a frame/structure per row and a Cartesian coordinate per column.

Note

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().

Author(s)

Barry Grant

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696. http://www.unidata.ucar.edu/packages/netcdf/ http://cirrus.ucsd.edu/~pierce/ncdf/ http://amber.scripps.edu/netcdf/nctraj.html

See Also

read.dcd, write.ncdf, read.pdb, write.pdb, atom.select

Examples

## Not run: 
##-- Read example trajectory file
trtfile <- system.file("examples/hivp.dcd", package="bio3d")
trj <- read.dcd(trtfile)

## Write to netCDF format
write.ncdf(trj, "newtrj.nc")

## Read trj
trj <- read.ncdf("newtrj.nc")
## End(Not run)

[Package bio3d version 1.0-6 Index]