Solution Builder

molcube.solution_builder.SolutionBuilderProject

class SolutionBuilderProject(client=None, update_format='tqdm')

Bases: BaseProject

A class for creating and manipulating solution builder projects.

This class extends BaseProject and provides methods for various stages of solution system generation, including project creation, solvation settings, and downloads.

Parameters:
  • client (APIClient | None)

  • update_format ('iter' | 'tqdm')

create_project(title, ref_project_id)

Create a new solution builder project.

Parameters:
  • title (str) – The title of the new project.

  • ref_project_id (str) – The ID of the associated reference project. (PDB Reader or Bioconjugate Modeler)

Returns:

True if project creation was successful, False otherwise.

Return type:

bool

Raises:

ValueError – If the reference project is not found or is not a supported project type.

Example

sbuilder.create_project(title=”my_solution_project”, ref_project_id=ref_project_id)

download_project(filename='solution.tar.gz')

Download the entire project as a compressed file.

Parameters:

filename (str) – Name of the file to save the project as. Defaults to ‘solution.tar.gz’.

Returns:

None

Return type:

None

download_system(filename='system.pdb')

Download the complete system PDB file.

Parameters:

filename (str) – Name of the file to save the system PDB as. Defaults to ‘system.pdb’.

Returns:

None

Return type:

None

generate_system(boxShape='cubic', margin=10.0, boxSize=None, ions='kcl', ionConc=0.15, neutralize=False, temperature=310.0, useHmr=False, mdEngines=['openmm'], minimization=False)

Generate the complete solution system.

Parameters:
  • boxShape (str, optional) – Shape of the simulation box. Defaults to “cubic”.

  • margin (float, optional) – Margin size for the box. Defaults to 10.0.

  • boxSize (float, optional) – Set box size for the box. Defaults to None.

  • ions (str, optional) – Type of ions to use. Defaults to “kcl”.

  • ionConc (float, optional) – Ion concentration. Defaults to 0.15.

  • neutralize (bool, optional) – Whether to neutralize the system (ion-related option). Defaults to False.

  • temperature (float, optional) – Temperature for the system in Kelvin. Defaults to 310.0.

  • useHmr (bool, optional) – Whether to use hydrogen mass repartitioning. Defaults to False.

  • mdEngines (list[str], optional) – List of molecular dynamics engines to use. Defaults to [‘openmm’].

  • minimization (bool, optional) – Whether to perform energy minimization. Defaults to False.

Returns:

True if system generation was successful, False otherwise.

Return type:

bool

Raises:

ValueError – If an unsupported MD engine is requested for the project force field, or if boxSize is smaller than the minimum size required by the solute.

Example

sbuilder.generate_system(mdEngines=[‘openmm’, ‘gromacs’])