VolumeMaker module

class VolumeMaker.PointCloudSurface(device='cpu')[source]

Bases: Module

__init__(device='cpu')[source]

Constructor for the CloudPointSurface class, which builds the main PyUUL object for cloud surface.

Parameters

device (torch.device) – The device on which the model should run. E.g. torch.device(“cuda”) or torch.device(“cpu:0”)

forward(coords, radius, maxpoints=5000, external_radius_factor=1.4)[source]

Function to calculate the surface cloud point representation of macromolecules

Parameters
  • coords (torch.Tensor) – Coordinates of the atoms. Shape ( batch, numberOfAtoms, 3 ). Can be calculated from a PDB file using utils.parsePDB

  • radius (torch.Tensor) – Radius of the atoms. Shape ( batch, numberOfAtoms ). Can be calculated from a PDB file using utils.parsePDB and utils.atomlistToRadius

  • maxpoints (int) – number of points per macromolecule in the batch

  • external_radius_factor=1.4 – multiplicative factor of the radius in order ot define the place to sample the points around each atom. The higher this value is, the smoother the surface will be

Returns

surfacePointCloud – surface point cloud representation of the macromolecules in the batch. Shape ( batch, channels, numberOfAtoms, 3)

Return type

torch.Tensor

training: bool
class VolumeMaker.PointCloudVolume(device='cpu')[source]

Bases: Module

__init__(device='cpu')[source]

Constructor for the CloudPointSurface class, which builds the main PyUUL object for volumetric point cloud.

Parameters

device (torch.device) – The device on which the model should run. E.g. torch.device(“cuda”) or torch.device(“cpu:0”)

forward(coords, radius, maxpoints=5000)[source]

Function to calculate the volumetric cloud point representation of macromolecules

Parameters
  • coords (torch.Tensor) – Coordinates of the atoms. Shape ( batch, numberOfAtoms, 3 ). Can be calculated from a PDB file using utils.parsePDB

  • radius (torch.Tensor) – Radius of the atoms. Shape ( batch, numberOfAtoms ). Can be calculated from a PDB file using utils.parsePDB and utils.atomlistToRadius

  • maxpoints (int) – number of points per macromolecule in the batch

Returns

PointCloudVolume – volume point cloud representation of the macromolecules in the batch. Shape ( batch, channels, numberOfAtoms, 3)

Return type

torch.Tensor

training: bool
class VolumeMaker.Voxels(device=device(type='cpu'), sparse=True)[source]

Bases: Module

__init__(device=device(type='cpu'), sparse=True)[source]

Constructor for the Voxels class, which builds the main PyUUL object.

Parameters
  • device (torch.device) – The device on which the model should run. E.g. torch.device(“cuda”) or torch.device(“cpu:0”)

  • sparse (bool) – Use sparse tensors calculation when possible

forward(coords, radius, channels, numberchannels=None, resolution=1, cubes_around_atoms_dim=5, steepness=10, function='sigmoid')[source]

Voxels representation of the macromolecules

Parameters
  • coords (torch.Tensor) – Coordinates of the atoms. Shape ( batch, numberOfAtoms, 3 ). Can be calculated from a PDB file using utils.parsePDB

  • radius (torch.Tensor) – Radius of the atoms. Shape ( batch, numberOfAtoms ). Can be calculated from a PDB file using utils.parsePDB and utils.atomlistToRadius

  • channels (torch.LongTensor) – channels of the atoms. Atoms of the same type shold belong to the same channel. Shape ( batch, numberOfAtoms ). Can be calculated from a PDB file using utils.parsePDB and utils.atomlistToChannels

  • numberchannels (int or None) – maximum number of channels. if None, max(atNameHashing) + 1 is used

  • cubes_around_atoms_dim (int) – maximum distance in number of voxels for which the contribution to occupancy is taken into consideration. Every atom that is farer than cubes_around_atoms_dim voxels from the center of a voxel does no give any contribution to the relative voxel occupancy

  • resolution (float) – side in A of a voxel. The lower this value is the higher the resolution of the final representation will be

  • steepness (float or int) – steepness of the sigmoid occupancy function.

  • function ("sigmoid" or "gaussian") – occupancy function to use. Can be sigmoid (every atom has a sigmoid shaped occupancy function) or gaussian (based on Li et al. 2014)

Returns

volume – voxel representation of the macromolecules in the batch. Shape ( batch, channels, x,y,z), where x,y,z are the size of the 3D volume in which the macromolecules have been represented

Return type

torch.Tensor

training: bool