Miscelaneous functions
Chemfiles.FormatMetadata
— TypeMetadata associated with one of the format Chemfiles can read/write
name::String
: Name of the formatextension::Union{Nothing, String}
: Extension associated with the format, ornothing
if there is no extension associated.description::String
: Extended user-facing description of the formatreference::String
: URL pointing to the format definition/referenceread::Bool
: Is reading files in this format implemented?write::Bool
: Is writing files in this format implemented?memory::Bool
: Does this format support in-memory IO?positions::Bool
: Does this format support storing atomic positions?velocities::Bool
: Does this format support storing atomic velocities?unit_cell::Bool
: Does this format support storing unit cell information?atoms::Bool
: Does this format support storing atom names or types?bonds::Bool
: Does this format support storing bonds between atoms?residues::Bool
: Does this format support storing residues?
Chemfiles.add_configuration
— Methodadd_configuration(path::String)
Read configuration data from the file at path
.
By default, chemfiles reads configuration from any file name .chemfilesrc
in the current directory or any parent directory. This function can be used to add data from another configuration file.
This function will fail if there is no file at path
, or if the file is incorectly formatted. Data from the new configuration file will overwrite any existing data.
Chemfiles.clear_errors
— Methodclear_errors()
Clear any error messages stored by the chemfiles runtime.
Chemfiles.format_list
— Methodformat_list() -> Vector{Chemfiles.FormatMetadata}
Get the full list of formats supported by Chemfiles, and associated metadata
Chemfiles.guess_format
— Methodguess_format(path::String) -> String
Get the format that chemfiles would use to read a file at the given path
.
The format is mostly guessed from the path extension, chemfiles only tries to read the file to distinguish between CIF and mmCIF files. Opening the file using the returned format string might still fail. For example, it will fail if the file is not actually formatted according to the guessed format; or the format/compression combination is not supported (e.g. XTC / GZ
will not work since the XTC reader does not support compressed files).
The returned format is represented in a way compatible with the various Trajectory
constructors, i.e. "<format name> [/ <compression>]"
, where compression is optional.
Chemfiles.last_error
— Methodlast_error() -> String
Get the last error message from the chemfiles runtime.
Chemfiles.set_warning_callback
— Methodset_warning_callback(callback::Function)
Set the global warning callback
to be used for each warning event.
The callback
function must take a String
and return nothing.