struct Chem::DCD::Info

Overview

Gather, check and annotate types registering a format

Defined in:

chem/formats/dcd.cr
chem/register_format.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_dcd(io : IO) : self #

[View source]
def self.read(input : IO | Path | String, format : Chem::DCD.class) : self #

[View source]
def self.read(input : IO | Path | String, format) : self #

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.


[View source]
def self.read(path : IO | Path | String) : self #

[View source]

Instance Method Detail

def buffer : Bytes #

Reusable buffer for reading each frame positions. Size should be sizeof(Float32) * n_atoms * 3.


[View source]
def bytesize : Int64 #

DCD header bytesize.


[View source]
def cell_block_bytesize : Int32 #

Number of bytes used for the cell block in each frame, or 0 if not periodic.


[View source]
def charmm_version : Int32 #

CHARMM version of the DCD content.


[View source]
def 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 self with the given fields updated.


[View source]
def dim : Int32 #

Number of spatial dimensions (either 3 or 4).


[View source]
def encoding : Encoding #

Encoding (byte order and marker type) of the DCD content.


[View source]
def first_frame_bytesize : Int32 #

Number of bytes occupied by the first frame (which may include fixed atoms).


[View source]
def fixed_positions : Slice(Spatial::Vec3) #

Atom positions for constrained/fixed atoms. Free positions are set to NaN.


[View source]
def frame_byte_offset(index : Int) : Int64 #

Returns the byte offset of the frame at index.


[View source]
def frame_bytesize : Int32 #

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.


[View source]
def marker_bytesize : Int32 #

Number of bytes of a block marker.


[View source]
def n_atoms : Int32 #

Number of atoms in the system.


[View source]
def n_frames : Int32 #

Number of frames in the trajectory.


[View source]
def n_free_atoms : Int32 #

Number of free atoms (not fixed) in the system. Equal to n_atoms if no atom is fixed.


[View source]
def periodic : Bool #

Whether the DCD content uses periodic boundaries (includes unit cell).


[View source]
def periodic? : Bool #

Returns true if the DCD content is periodic (includes unit cell), else false.


[View source]
def title : String | Nil #

The title in the DCD content, if present.


[View source]