struct
Chem::DCD::Info
- Chem::DCD::Info
- Struct
- Value
- Object
Overview
Gather, check and annotate types registering a format
Defined in:
chem/formats/dcd.crchem/register_format.cr
Constructors
- .from_dcd(io : IO) : self
- .read(input : IO | Path | String, format : Chem::DCD.class) : self
-
.read(input : IO | Path | String, format) : self
FIXME Make it compile time error.
- .read(path : IO | Path | String) : self
Instance Method Summary
-
#buffer : Bytes
Reusable buffer for reading each frame positions.
-
#bytesize : Int64
DCD header bytesize.
-
#cell_block_bytesize : Int32
Number of bytes used for the cell block in each frame, or 0 if not periodic.
-
#charmm_version : Int32
CHARMM version of the DCD content.
-
#copy_with(buffer : Bytes = @buffer, bytesize : Int64 = @bytesize, charmm_version : Int32 = @charmm_version, dim : Int32 = @dim, encoding : Encoding = @encoding, fixed_positions : Slice(Spatial::Vec3) = @fixed_positions, n_atoms : Int32 = @n_atoms, n_frames : Int32 = @n_frames, n_free_atoms : Int32 = @n_free_atoms, periodic : Bool = @periodic, title : String | Nil = @title) : self
Returns a copy of
selfwith the given fields updated. -
#dim : Int32
Number of spatial dimensions (either 3 or 4).
-
#encoding : Encoding
Encoding (byte order and marker type) of the DCD content.
-
#first_frame_bytesize : Int32
Number of bytes occupied by the first frame (which may include fixed atoms).
-
#fixed_positions : Slice(Spatial::Vec3)
Atom positions for constrained/fixed atoms.
-
#frame_byte_offset(index : Int) : Int64
Returns the byte offset of the frame at index.
-
#frame_bytesize : Int32
Number of bytes of a frame.
-
#marker_bytesize : Int32
Number of bytes of a block marker.
-
#n_atoms : Int32
Number of atoms in the system.
-
#n_frames : Int32
Number of frames in the trajectory.
-
#n_free_atoms : Int32
Number of free atoms (not fixed) in the system.
-
#periodic : Bool
Whether the DCD content uses periodic boundaries (includes unit cell).
-
#periodic? : Bool
Returns true if the DCD content is periodic (includes unit cell), else false.
-
#title : String | Nil
The title in the DCD content, if present.
Constructor Detail
FIXME Make it compile time error. Should raise if format is not registered or format is incompatible with open_type. Better create an override with the other formats, and leave this as a fallback.
Instance Method Detail
Reusable buffer for reading each frame positions.
Size should be sizeof(Float32) * n_atoms * 3.
Number of bytes used for the cell block in each frame, or 0 if not periodic.
Returns a copy of self with the given fields updated.
Number of bytes occupied by the first frame (which may include fixed atoms).
Atom positions for constrained/fixed atoms. Free positions are set to NaN.
Returns the byte offset of the frame at index.
Number of bytes of a frame. It may be less than the first frame's bytesize as the second frame and after include free atoms only.
Number of free atoms (not fixed) in the system. Equal to n_atoms if no atom is fixed.
Returns true if the DCD content is periodic (includes unit cell), else false.