reference
#
Utilities for automatically selecting 'reference' atoms for alignment.
Functions:
-
queries_to_idxs
–Find the indices of those atoms matched by a set of atom queries.
-
select_ligand_idxs
–Returns the indices of the reference atoms that may be used to align ligands.
-
select_receptor_idxs
–Select possible protein atoms for Boresch-style restraints using the method
-
check_receptor_idxs
–Check if the specified receptor atoms meet the criteria for use in Boresch-style
-
select_protein_cavity_atoms
–Select the alpha carbon atoms that define the binding cavity of the protein based
queries_to_idxs
#
queries_to_idxs(
topology: Topology, queries: Iterable[str]
) -> tuple[int, ...]
Find the indices of those atoms matched by a set of atom queries.
Parameters:
-
topology
(Topology
) –The ligand to query.
-
queries
(Iterable[str]
) –The atom selection queries.
Returns:
-
tuple[int, ...]
–The indices of the matched atoms.
Source code in femto/fe/reference.py
select_ligand_idxs
#
select_ligand_idxs(
ligand_1: Topology,
ligand_2: Topology | None,
method: LigandReferenceMethod,
ligand_1_queries: tuple[str, str, str] | None = None,
ligand_2_queries: tuple[str, str, str] | None = None,
) -> tuple[
tuple[int, int, int], tuple[int, int, int] | None
]
Returns the indices of the reference atoms that may be used to align ligands.
Notes
- Some methods, e.g.
chen
, select reference atoms based on the two ligands meaning they can only be used in RBFE calculations, whereas others, e.g.baumann
, select reference atoms based on a single ligand.
Parameters:
-
ligand_1
(Topology
) –The first ligand.
-
ligand_2
(Topology | None
) –The second ligand.
-
method
(LigandReferenceMethod
) –The method to use to select the reference atoms if none are specified.
-
ligand_1_queries
(tuple[str, str, str] | None
, default:None
) –Three (optional) selection queries to use to manually select atoms from the first ligand.
-
ligand_2_queries
(tuple[str, str, str] | None
, default:None
) –Three (optional) selection queries to use to manually select atoms from the second ligand
Returns:
-
tuple[tuple[int, int, int], tuple[int, int, int] | None]
–The indices of the first and second ligand respectively. No offset is applied to the second ligand indices so a query of
"idx. 1"
would yield0
rather thann_ligand_1_atoms
.
Source code in femto/fe/reference.py
select_receptor_idxs
#
select_receptor_idxs(
topology: Topology | Trajectory,
ligand_ref_idxs: tuple[int, int, int],
) -> tuple[int, int, int]
Select possible protein atoms for Boresch-style restraints using the method outlined by Baumann et al [1].
References
[1] Baumann, Hannah M., et al. "Broadening the scope of binding free energy calculations using a Separated Topologies approach." (2023).
Parameters:
-
topology
(Topology | Trajectory
) –The topology containing the receptor and ligands.
-
ligand_ref_idxs
(tuple[int, int, int]
) –The indices of the three ligands atoms that will be restrained.
Returns:
-
tuple[int, int, int]
–The indices of the three atoms to use for the restraint
Source code in femto/fe/reference.py
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
|
check_receptor_idxs
#
check_receptor_idxs(
topology: Topology | Trajectory,
receptor_idxs: tuple[int, int, int],
ligand_ref_idxs: tuple[int, int, int],
) -> bool
Check if the specified receptor atoms meet the criteria for use in Boresch-style restraints as defined by Baumann et al [1].
References
[1] Baumann, Hannah M., et al. "Broadening the scope of binding free energy calculations using a Separated Topologies approach." (2023).
Parameters:
-
topology
(Topology | Trajectory
) –The system topology.
-
receptor_idxs
(tuple[int, int, int]
) –The indices of the three receptor atoms that will be restrained.
-
ligand_ref_idxs
(tuple[int, int, int]
) –The indices of the three ligand atoms that will be restrained.
Returns:
-
bool
–True if the atoms meet the criteria, False otherwise.
Source code in femto/fe/reference.py
select_protein_cavity_atoms
#
Select the alpha carbon atoms that define the binding cavity of the protein based on their distance to ligand atoms.
Parameters:
-
protein
(Topology
) –The protein.
-
ligands
(list[Topology]
) –The ligands to consider.
-
cutoff
(Quantity
) –Residues further than this distance from a ligand will be excluded.
Returns:
-
str
–The AMBER style query that will select the reference atoms of the protein.