saveSystems()

Description

saveSystems() is a function that can be used to save the system in a file. The function will save the center of masses and states of all the input systems for each frame.

The function can use several file format to store the data. Extensive details on the formats available can be read in the related tutorial.

The function only generates a file and does not have any other output.

Argument, keywords and outputs

Input(s) / Argument(s)

Name Flag  Type Description
Systems   class System or list of class System Instances of the system classes containing the molecules to save in a file.
File path  file_path= str (Opt.) Path and name of the file to generate. File extension should be .xml, .h5 or .csv. By default, the name is autogenerated as “date_hour.csv” (e.g. 20201201_012345.csv)
Format format= str (Opt.) File extension and format to use for the output file. Should be “.xml”, “.h5” or “.csv”. Default is ‘.csv’

Examples

Save 1 system with auto name and format

The following example will save one instance of the System class, system_A, in a file with automatically generated name (using date formatting: YYMMDD_HHMMSS) and automatically picked extension/format (default: .csv)

import mllpa

mllpa.saveSystems(system_A)

Save 2 systems with a given name

The following example will save 2 instances of the System class, system_A and system_B, in a file named saved_systems.xml.

mllpa.saveSystems([system_A, system_B], file_path="saved_systems.xml")

Save 2 systems with auto name but given format

The following example will save 2 instances of the System class, system_A and system_B, in a file with automatically generated name (using date formatting: YYMMDD_HHMMSS) but with the chosen format HDF5 (.h5).

mllpa.saveSystems([system_A, system_B], format=".h5")

The following tutorial(s) detail further the use of the saveSystems() function: