From d337809908ebb4a9f9ac8a34ec9ac01d70b4b5e5 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Mon, 24 Feb 2025 10:44:21 -0800 Subject: [PATCH 1/5] switch install to mamba --- showcase/openfe_showcase.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/showcase/openfe_showcase.ipynb b/showcase/openfe_showcase.ipynb index 94a865e..e9374f7 100644 --- a/showcase/openfe_showcase.ipynb +++ b/showcase/openfe_showcase.ipynb @@ -88,7 +88,7 @@ "if \"COLAB_RELEASE_TAG\" in os.environ:\n", " !pip install -q condacolab\n", " import condacolab\n", - " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/openfe/releases/download/v1.3.0/OpenFEforge-1.3.0-Linux-x86_64.sh\")" + " condacolab.install()" ] }, { @@ -113,6 +113,7 @@ " import condacolab\n", " import locale\n", " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + !mamba install -q openfe " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", " for _ in range(3):\n", " # Sometimes we have to re-run the check\n", From 8bf7d17b03040a34b096f86bacc873e4e1f9d943 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Tue, 25 Feb 2025 08:45:17 -0800 Subject: [PATCH 2/5] Revert "switch install to mamba" This reverts commit d337809908ebb4a9f9ac8a34ec9ac01d70b4b5e5. --- showcase/openfe_showcase.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/showcase/openfe_showcase.ipynb b/showcase/openfe_showcase.ipynb index e9374f7..94a865e 100644 --- a/showcase/openfe_showcase.ipynb +++ b/showcase/openfe_showcase.ipynb @@ -88,7 +88,7 @@ "if \"COLAB_RELEASE_TAG\" in os.environ:\n", " !pip install -q condacolab\n", " import condacolab\n", - " condacolab.install()" + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/openfe/releases/download/v1.3.0/OpenFEforge-1.3.0-Linux-x86_64.sh\")" ] }, { @@ -113,7 +113,6 @@ " import condacolab\n", " import locale\n", " locale.getpreferredencoding = lambda: \"UTF-8\"\n", - !mamba install -q openfe " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", " for _ in range(3):\n", " # Sometimes we have to re-run the check\n", From 75c1c27b9da55c9a43a4c94961b6de176f3f6a98 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Tue, 25 Feb 2025 08:54:52 -0800 Subject: [PATCH 3/5] trying again with correct formatting --- showcase/openfe_showcase.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/showcase/openfe_showcase.ipynb b/showcase/openfe_showcase.ipynb index 94a865e..137e7d8 100644 --- a/showcase/openfe_showcase.ipynb +++ b/showcase/openfe_showcase.ipynb @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "-jX9udRGehD3", "metadata": { "colab": { @@ -88,12 +88,12 @@ "if \"COLAB_RELEASE_TAG\" in os.environ:\n", " !pip install -q condacolab\n", " import condacolab\n", - " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/openfe/releases/download/v1.3.0/OpenFEforge-1.3.0-Linux-x86_64.sh\")" + " condacolab.install()" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "dlCARZ2_fAI4", "metadata": { "colab": { @@ -113,6 +113,7 @@ " import condacolab\n", " import locale\n", " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + " !mamaba install openfe\n", " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", " for _ in range(3):\n", " # Sometimes we have to re-run the check\n", From 8fc3581b5cc178f8a29cb8436d1eba6307201e4a Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Tue, 25 Feb 2025 09:02:50 -0800 Subject: [PATCH 4/5] add -q flag --- showcase/openfe_showcase.ipynb | 2 +- showcase/showcase.py | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 showcase/showcase.py diff --git a/showcase/openfe_showcase.ipynb b/showcase/openfe_showcase.ipynb index 137e7d8..ec17f4f 100644 --- a/showcase/openfe_showcase.ipynb +++ b/showcase/openfe_showcase.ipynb @@ -113,7 +113,7 @@ " import condacolab\n", " import locale\n", " locale.getpreferredencoding = lambda: \"UTF-8\"\n", - " !mamaba install openfe\n", + " !mamba -q install openfe\n", " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", " for _ in range(3):\n", " # Sometimes we have to re-run the check\n", diff --git a/showcase/showcase.py b/showcase/showcase.py new file mode 100644 index 0000000..03837cc --- /dev/null +++ b/showcase/showcase.py @@ -0,0 +1,36 @@ +import openfe +from rdkit import Chem +from rdkit.Chem import AllChem +from openfe import SmallMoleculeComponent +from openfe.setup import LomapAtomMapper +# from openfe.setup.ligand_network_planning import generate_lomap_network + +import lomap + +# Extract the contents of the sdf file and visualise it +ligands_rdmol = [ + mol for mol in Chem.SDMolSupplier("inputs/tyk2_ligands.sdf", removeHs=False) +] + +for ligand in ligands_rdmol: + AllChem.Compute2DCoords(ligand) + +Chem.Draw.MolsToGridImage(ligands_rdmol) + + +# Load ligands using RDKit +ligands_sdf = Chem.SDMolSupplier("inputs/tyk2_ligands.sdf", removeHs=False) + +# Now pass these to form a list of Molecules +ligand_mols = [SmallMoleculeComponent(sdf) for sdf in ligands_sdf] + +mapper = LomapAtomMapper() +lomap_mapping = next(mapper.suggest_mappings(ligand_mols[0], ligand_mols[4])) + +lomap_network = lomap.generate_lomap_network( + molecules=ligand_mols, + scorer=openfe.lomap_scorers.default_lomap_score, + mappers=[ + LomapAtomMapper(), + ], +) From a0f123535a9725085cc8dd83b15ccfe8cca278ca Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Tue, 25 Feb 2025 12:20:14 -0800 Subject: [PATCH 5/5] remove showcase script --- showcase/showcase.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 showcase/showcase.py diff --git a/showcase/showcase.py b/showcase/showcase.py deleted file mode 100644 index 03837cc..0000000 --- a/showcase/showcase.py +++ /dev/null @@ -1,36 +0,0 @@ -import openfe -from rdkit import Chem -from rdkit.Chem import AllChem -from openfe import SmallMoleculeComponent -from openfe.setup import LomapAtomMapper -# from openfe.setup.ligand_network_planning import generate_lomap_network - -import lomap - -# Extract the contents of the sdf file and visualise it -ligands_rdmol = [ - mol for mol in Chem.SDMolSupplier("inputs/tyk2_ligands.sdf", removeHs=False) -] - -for ligand in ligands_rdmol: - AllChem.Compute2DCoords(ligand) - -Chem.Draw.MolsToGridImage(ligands_rdmol) - - -# Load ligands using RDKit -ligands_sdf = Chem.SDMolSupplier("inputs/tyk2_ligands.sdf", removeHs=False) - -# Now pass these to form a list of Molecules -ligand_mols = [SmallMoleculeComponent(sdf) for sdf in ligands_sdf] - -mapper = LomapAtomMapper() -lomap_mapping = next(mapper.suggest_mappings(ligand_mols[0], ligand_mols[4])) - -lomap_network = lomap.generate_lomap_network( - molecules=ligand_mols, - scorer=openfe.lomap_scorers.default_lomap_score, - mappers=[ - LomapAtomMapper(), - ], -)