AFES Simulator (Relative) ========================= The Alchemical Free Energy Simulator (AFES) uses the same :py:class:`SimulatorProject ` helper as the other simulators. Searching for projects, creating a simulator project (``create_project()``), checking status, and downloading results are described in :doc:`md_simulator` (see :ref:`afes-status-downloads`). Free Energy Simulator --------------------- For Free Energy and Quick Free Energy references, the simulator helper detects the selection mode from the reference project. Supported Free Energy simulator modes are: * AMBER Relative Binding: Select morphs. * GROMACS Relative Binding: Select morphs. * BLaDE Relative Binding: Select groups. The first ligand force field is selected automatically when the reference contains one or more force fields. You can inspect or change it explicitly:: sim.list_available_ligand_force_fields() sim.set_ligand_force_field("gaff_fast") The following inspection methods are available: * ``list_available_ligand_force_fields()``: For Free Energy references, returns the force-field keys stored in ``reference_options.selectedForceFields``. * ``set_ligand_force_field(ligand_force_field)``: Returns ``str`` with the selected ligand force field key. * ``get_free_energy_profile()``: Returns ``SimulatorFreeEnergyProfile`` with program, application, mode, selection kind, force fields, and defaults. * ``show_free_energy_profile()``: Prints the profile and returns ``SimulatorFreeEnergyProfile``. * ``get_free_energy_options()``: Returns ``SimulatorFreeEnergyOptions`` with selectable items by ligand force field. * ``format_free_energy_options()``: Returns ``str`` containing the formatted option summary. * ``show_free_energy_options()``: Prints all selectable items and returns ``SimulatorFreeEnergyOptions``. * ``list_available_free_energy_items()``: Returns ``list[str]`` for morphs, or ``list[SimulatorFreeEnergyGroupOption]`` for BLaDE groups. * ``show_available_free_energy_items()``: Prints selectable items with zero-based indices and returns the same value as ``list_available_free_energy_items()``. AMBER/GROMACS Relative Binding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Relative-binding AMBER and GROMACS references select morphs. The displayed morph labels are one-based labels such as ``"1-2"``. Example:: free_energy_ref_id = "completed-free-energy-rb-project-id" sim = molcube.create_simulator_project() assert sim.create_project( title="afes_rb", ref_id=free_energy_ref_id, ) sim.show_free_energy_profile() sim.show_available_free_energy_items() sim.add_free_energy_selection([0, 1]) sim.show_free_energy_selection() assert sim.run_simulation() The following selection methods are available: * ``add_free_energy_selection(indices)``: Add items by displayed zero-based index. Returns ``list[str]`` for selected morphs, or ``list[int]`` for selected BLaDE group indices. * ``delete_free_energy_selection(indices)``: Remove items by displayed zero-based index. Returns ``list[str]`` for selected morphs, or ``list[int]`` for selected BLaDE group indices. * ``set_free_energy_selection(values)``: Replace the selection with explicit values. Returns ``list[str]`` for selected morphs, or ``list[int]`` for selected BLaDE group indices. * ``get_free_energy_selection()``: Returns ``SimulatorFreeEnergySelectionState`` with selected values, selected force field, readiness, and missing inputs. * ``format_free_energy_selection()``: Returns ``str`` containing the formatted selection summary. * ``show_free_energy_selection()``: Prints the current selection and returns ``SimulatorFreeEnergySelectionState``. * ``clear_free_energy_selection()``: Clears the current selection and returns ``SimulatorFreeEnergySelectionState``. Morph core details are loaded automatically for AMBER/GROMACS relative-binding references. This data includes start/end ligand names, core atom indices, raw SVGs, and highlighted SVGs. The following arguments are available for the ``show_morph_core_detail`` method: * morph (str | int): Display morph label such as ``"1-2"``, raw morph label, or zero-based list index. * ligand_force_field (str | None): Ligand force field to inspect. Defaults to the selected force field. Example:: sim.show_morph_core_detail("1-2") sim.show_morph_core_detail(0) Run arguments ~~~~~~~~~~~~~ The following arguments are available for ``run_free_energy()`` and ``run_simulation()`` when using Free Energy references: * trials (int): Number of trials. (default: ``1``) Return: * bool: ``True`` when the simulator project is submitted successfully. BLaDE Relative Binding ~~~~~~~~~~~~~~~~~~~~~~ BLaDE relative-binding references select ligand groups. Each group entry contains a ``groupIndex`` and ligand names. Example:: blade_ref_id = "completed-blade-rb-project-id" sim = molcube.create_simulator_project() assert sim.create_project( title="blade_rb", ref_id=blade_ref_id, ) sim.show_available_free_energy_items() sim.add_free_energy_selection([0]) assert sim.run_simulation(trials=1) You can inspect group data directly:: groups = sim.list_available_groups() sim.set_free_energy_selection([groups[0]["groupIndex"]]) The following list methods are available: * ``list_available_morphs(ligand_force_field)``: Returns ``list[str]`` with display morph labels such as ``"1-2"``. * ``list_available_ligands(ligand_force_field)``: Returns ``list[str]`` with ligand file names. * ``list_available_groups(ligand_force_field=None)``: Returns ``list[SimulatorFreeEnergyGroupOption]`` with ``groupIndex`` and ``ligandNames``.