Learn R Programming

bio3d (version 2.4-4)

write.ncdf: Write AMBER Binary netCDF files

Description

Write coordinate data to a binary netCDF trajectory file.

Usage

write.ncdf(x, trjfile = "R.ncdf", cell = NULL)

Value

Called for its effect.

Arguments

x

A numeric matrix of xyz coordinates with a frame/structure per row and a Cartesian coordinate per column.

trjfile

name of the output trajectory file.

cell

A numeric matrix of cell information with a frame/structure per row and a cell length or angle per column. If NULL cell will not be written.

Author

Barry Grant

Details

Writes an AMBER netCDF (Network Common Data Form) format trajectory file with the help of David W. Pierce's (UCSD) ncdf4 package available from CRAN.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696. https://www.unidata.ucar.edu/software/netcdf/ https://cirrus.ucsd.edu/~pierce/ncdf/ https://ambermd.org/FileFormats.php#netcdf

See Also

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

Examples

Run this code
if (FALSE) {
##-- 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")
}

Run the code above in your browser using DataLab