File IO
MDToolbox.mdload
— Methodmdload(filename::AbstractString; index=nothing, top::TrjArray=nothing) -> ta::TrjArray
Function for reading bimolecular structure files or molecular dynamics trajectories. This function automatically detects files types from the filename extension of input filename
. Currently, PDB, PSF, DCD, NetCDF, and namdbin(namd restart file) formats are available. For reading subset atoms from the trajectory files, the user can specify atom indices as index::AbstractVector{Int}
. Returns a TrjArray variable ta
.
If the user wants to attach a topology information read from PSF, PDB, or other files to MD trajectory, the user can give an addtional option top=ta:TrjArray
. If the option is given the topology information is applied.
Example
julia> ta = mdload("1ake.psf")
-julia> ta = mdload("1ake.dcd", top=ta)
MDToolbox.mdsave
— Methodmdsave(filename::AbstractString, ta::TrjArray)
Function for writing bimolecular structure files or molecular dynamics trajectories. This function automatically detects files types from the filename extension of input filename
. Currently, PDB, PSF, NetCDF, and namdbin(namd restart file) formats are available.
Example
julia> ta = TrjArray(xyz=randn(100, 9))
-julia> ta = mdsave("1ake.nc", ta)