ΒΆ, template=None)[source]ΒΆ

Load an atom array or stack from a structure file without the need to manually instantiate a File object.

Internally this function uses a File object, based on the file extension. Trajectory files furthermore require specification of the template parameter.

file_path : str

The path to structure file.

template : AtomArray or AtomArrayStack or file-like object or str, optional

Only required when reading a trajectory file.

array : AtomArray or AtomArrayStack

If the file contains multiple models, an AtomArrayStack is returned, otherwise an AtomArray is returned.


If the file format (i.e. the file extension) is unknown.


If a trajectory file is loaded without specifying the template parameter.