pylipid.api.LipidInteraction.save_data

LipidInteraction.save_data(item, save_dir=None)[source]

Assisting function for saving data.

This function saves a couple of unprocessed interaction data to local disc. These data include:

  • Duration: a python dictionary with residue IDs as its keys, which stores the durations of all contacts for residues.

  • Occupancy: a python dictionary with residue IDs as its keys, which stores the lipid occupancy from each trajectory for residues.

  • Lipid Count: a python dictionary with residue IDs as its keys, which stores the averaged lipid count from each trajectory for residues.

  • CorrCoef : a numpy ndarray that stores the interaction correlation matrix of residues.

  • Duration BS: a python dictionary with binding site IDs as its keys, which stores the durations of all contacts for binding sites.

  • Occupancy BS: a python dictionary with binding site IDs as its keys, which stores the lipid occupancy from each trajectory for binding sites.

  • Dataset: a pandas.DataFrame object that stores interaction data for residues by row. The interaction data, including interaction with the residue and with the binding site to which the residue belongs, can be accessed easily.

The python dictionary objects and numpy ndarray objects are saved to local disc in pickle, whereas the pandas.DataFrame is saved in csv format.

The data will be saved under the directory specified by save_dir. If None is given, a directory of Dataset_{lipid} will be created under the root directory initiated at the begining of the calculation and used to store the dataset.

Parameters
  • item ({"Dataset", "Duration", "Occupancy", "Lipid Count", "CorrCoef", "Duration BS", "Occupancy BS"}) – The interaction data to save.

  • save_dir (str, optional, default=None) – The directory for saving the data. By default, the data are saved in Dataset_{lipid} under the root directory defined at the initialization of LipidInteraction.