Miscelaneous functions

Chemfiles.FormatMetadataType

Metadata associated with one of the format Chemfiles can read/write

  • name::String: Name of the format

  • extension::Union{Nothing, String}: Extension associated with the format, or nothing if there is no extension associated.

  • description::String: Extended user-facing description of the format

  • reference::String: URL pointing to the format definition/reference

  • read::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?

source
Chemfiles.add_configurationMethod
add_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.

source
Chemfiles.format_listMethod
format_list() -> Vector{Chemfiles.FormatMetadata}

Get the full list of formats supported by Chemfiles, and associated metadata

source
Chemfiles.guess_formatMethod
guess_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.

source
Chemfiles.set_warning_callbackMethod
set_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.

source