deepdrivemd.models.keras_cvae.utils

Functions

sparse_to_dense(h5_file, dataset_name, ...)

Convert sparse COO formatted contact maps to dense.

deepdrivemd.models.keras_cvae.utils.sparse_to_dense(h5_file: Union[str, pathlib.Path], dataset_name: str, initial_shape: Tuple[int, int], final_shape: Union[Tuple[int, int, int], Tuple[int, int]]) npt.ArrayLike

Convert sparse COO formatted contact maps to dense.

Parameters
  • h5_file (PathLike) – The HDF5 file containing contact maps.

  • dataset_name (str) – The dataset name containing the contact map indices.

  • initial_shape (Tuple[int, int]) – The shape of the contact map saved in the HDF5 file.

  • final_shape (Union[Tuple[int, int, int], Tuple[int, int]]) – The final shape of the contact map incase adding an extra dimension is necessary e.g. (D, D, 1) where D is the number of residues or the cropping shape.

Returns

npt.ArrayLike – The output array of contact maps of shape (N, D, D) or (N, D, D, 1) depending on final_shape where N is the number of contact maps in the HDF5 file.