Skip to content

Commit

Permalink
Short protein-ligand complex test implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
ijpulidos committed Aug 14, 2024
1 parent 42f2a59 commit ccbdaf6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
30 changes: 27 additions & 3 deletions feflow/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ def ty2_protein():
@pytest.fixture(scope="session")
def tyk2_ligand_ejm_54():
filepath = files("feflow.tests.data").joinpath("tyk2_lig_ejm_54.sdf")
return gufe.SmallMoleculeComponent.from_pdb_file(str(filepath))
return gufe.SmallMoleculeComponent.from_sdf_file(str(filepath))


@pytest.fixture(scope="session")
def tyk2_ligand_ejm_46():
filepath = files("feflow.tests.data").joinpath("tyk2_lig_ejm_46.sdf")
return gufe.SmallMoleculeComponent.from_pdb_file(str(filepath))
return gufe.SmallMoleculeComponent.from_sdf_file(str(filepath))


# Systems fixtures
Expand All @@ -105,6 +105,23 @@ def toluene_vacuum_system(toluene):
def toluene_solvent_system(toluene, solvent_comp):
return gufe.ChemicalSystem({"ligand": toluene, "solvent": solvent_comp})

@pytest.fixture
def tyk2_lig_ejm_46_complex(tyk2_protein, tyk2_ligand_ejm_46, solvent_comp):
return gufe.ChemicalSystem({
"protein": tyk2_protein,
"ligand": tyk2_ligand_ejm_46,
"solvent": solvent_comp
})


@pytest.fixture
def tyk2_lig_ejm_54_complex(tyk2_protein, tyk2_ligand_ejm_54):
return gufe.ChemicalSystem({
"protein": tyk2_protein,
"ligand": tyk2_ligand_ejm_54,
"solvent": solvent_comp
})


# Settings fixtures

Expand Down Expand Up @@ -243,5 +260,12 @@ def broken_mapping(benzene, toluene):
def mapping_tyk2_54_to_46(tyk2_ligand_ejm_54, tyk2_ligand_ejm_46):
"""
Mapping object from ligand ejm_54 to ejm_46 for the Tyk2 dataset.
It generates the mapping on runtime using the Kartograf mapper.
"""
return NotImplementedError
from kartograf import KartografAtomMapper

atom_mapper = KartografAtomMapper()
mapping_obj = next(atom_mapper.suggest_mappings(tyk2_ligand_ejm_54, tyk2_ligand_ejm_46))

return mapping_obj
22 changes: 20 additions & 2 deletions feflow/tests/test_nonequilibrium_cycling.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,30 @@ def test_create_execute_gather_toluene_to_toluene(
# TODO: We could also generate a plot with the forward and reverse works and visually check the results.
# TODO: Potentially setup (not run) a protein-ligand system

def test_tyk2_complex (self, protocol_short, tyk2_protein, tyk2_ligand_ejm_54, tyk2_ligand_ejm_46, mapping_tyk2_54_to_46 , tmpdir):
def test_tyk2_complex(self, protocol_short, tyk2_lig_ejm_54_complex, tyk2_lig_ejm_46_complex, mapping_tyk2_54_to_46, tmpdir):
"""
Run the protocol with single transformation between ligands ejm_54 and ejm_46
from the tyk2 dataset.
"""
return NotImplementedError
dag = protocol_short.create(
stateA=tyk2_lig_ejm_54_complex,
stateB=tyk2_lig_ejm_46_complex,
name="Short protein-ligand complex transformation",
mapping=mapping_tyk2_54_to_46,
)

with tmpdir.as_cwd():
shared = Path("shared")
shared.mkdir()
scratch = Path("scratch")
scratch.mkdir()

dagresult = execute_DAG(
dag, shared_basedir=shared, scratch_basedir=scratch,
)

# Check that the dag was executed correctly
assert dagresult.ok(), f"DAG was not executed correctly."

@pytest.mark.parametrize("method, backend", partial_charges_config())
def test_partial_charge_assignation(
Expand Down

0 comments on commit ccbdaf6

Please sign in to comment.