Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dataviz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
micromamba install -n dataviz --file devtools/conda-envs/${{ matrix.os }}/simulation.yaml
micromamba install -n dataviz --file devtools/conda-envs/${{ matrix.os }}/modeling.yaml
micromamba install -n dataviz --file devtools/conda-envs/${{ matrix.os }}/spectrum.yaml

python -m pip install -e ./drugforge-data --no-deps
python -m pip install -e ./drugforge-modeling --no-deps
python -m pip install -e ./drugforge-cli --no-deps
Expand All @@ -81,7 +81,7 @@ jobs:
python -m pip install -e ./drugforge-simulation --no-deps
python -m pip install -e ./drugforge-spectrum --no-deps
micromamba list

- name: Test OE License & Write License to File
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This fork is now developed and maintained independently by the [Chodera Lab](htt

## Intro

All pandemics are global health threats. Our best defense is a healthy global antiviral discovery community with a robust pipeline of open discovery tools.
All pandemics are global health threats. Our best defense is a healthy global antiviral discovery community with a robust pipeline of open discovery tools.

The toolkit in this repo is a batteries-included drug discovery pipeline being actively developed in a transparent open-source way, with a focus on computational chemistry and informatics support for medicinal chemistry.
The toolkit in this repo is a batteries-included drug discovery pipeline being actively developed in a transparent open-source way, with a focus on computational chemistry and informatics support for medicinal chemistry.


## Getting Started
Expand All @@ -27,7 +27,7 @@ Install the `drugforge` subpackages and begin to explore! The drugforge [documen

There are a range of workflows and tooling to use split into several namespace subpackages by theme.

**Warning:** The implementation of drugforge-ML is still in the works and will be available in the next release. If you want to use ML scoring please refer to the original version of this code under [asapdiscovery](https://github.com/asapdiscovery/asapdiscovery).
**Warning:** The implementation of drugforge-ML is still in the works and will be available in the next release. If you want to use ML scoring please refer to the original version of this code under [asapdiscovery](https://github.com/asapdiscovery/asapdiscovery).

`drugforge-alchemy`: Free energy calculations using [OpenFE](https://openfree.energy/) and [Alchemiscale](https://docs.alchemiscale.org/en/latest/). See [tutorial](https://drugforge.readthedocs.io/en/latest/tutorials/running_alchemical_free_energy_calculations.html) and CLI [guide](https://asapdiscovery.readthedocs.io/en/latest/guides/using_asap_alchemy_cli.html)

Expand Down
7 changes: 4 additions & 3 deletions devtools/conda-envs/macos-latest/alchemy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ channels:
dependencies:
- alchemiscale-client
- bokeh
- cinnabar
- cinnabar ~=0.5.0
- click
- gufe
- gufe ~=1.6.0
- importlib_resources # manually added. More info at https://github.com/conda-forge/openmmforcefields-feedstock/pull/26
- kartograf
- lomap2
- networkx
- numpy
- openeye-toolkits
- openfe ~=1.0
- openfe ~=1.4
- openff-toolkit
- openff-models
- openff-qcsubmit
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/macos-latest/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- conda-forge
dependencies:
- click
- pytest
- pytest
7 changes: 4 additions & 3 deletions devtools/conda-envs/ubuntu-latest/alchemy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ channels:
dependencies:
- alchemiscale-client
- bokeh
- cinnabar
- cinnabar ~=0.5.0
- click
- gufe
- gufe ~=1.6.0
- importlib_resources # manually added. More info at https://github.com/conda-forge/openmmforcefields-feedstock/pull/26
- kartograf
- lomap2
- networkx
- numpy
- openeye-toolkits
- openfe ~=1.0
- openfe ~=1.4
- openff-toolkit
- openff-models
- openff-qcsubmit
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/ubuntu-latest/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- conda-forge
dependencies:
- click
- pytest
- pytest
2 changes: 1 addition & 1 deletion devtools/conda-envs/ubuntu-latest/simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ dependencies:
- multimethod

# ML
- mtenn >=0.6.3
- mtenn >=0.6.3
1 change: 0 additions & 1 deletion devtools/conda-envs/ubuntu-latest/spectrum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,3 @@ dependencies:
- moto
- boto3
- multimethod

2 changes: 1 addition & 1 deletion devtools/conda-envs/ubuntu-latest/workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
# drugforge {all the other packages}
click
pydantic
unittest
unittest
8 changes: 4 additions & 4 deletions devtools/detect_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
from pathlib import Path


def get_imports_from_file(file_path: str) -> Set[Tuple[str, str]]:
def get_imports_from_file(file_path: str) -> set[tuple[str, str]]:
"""
Extract import names and their submodules from a Python file.
Returns set of tuples (package, submodule).
"""
imports = set()

try:
with open(file_path, 'r', encoding='utf-8') as f:
with open(file_path, encoding='utf-8') as f:
tree = ast.parse(f.read())

for node in ast.walk(tree):
Expand All @@ -49,7 +49,7 @@ def get_imports_from_file(file_path: str) -> Set[Tuple[str, str]]:
return imports


def find_all_imports_with_files(directory: str) -> Dict[str, Dict[str, Set[str]]]:
def find_all_imports_with_files(directory: str) -> dict[str, dict[str, set[str]]]:
"""
Find all unique imports and their submodules in Python files.

Expand Down Expand Up @@ -132,4 +132,4 @@ def main(directory: str, output: str, packages_only: bool):


if __name__ == "__main__":
main()
main()
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Compiling drugforge's Documentation

For the docs to compile properly, you will need to have the full drugforge environment installed.
For the docs to compile properly, you will need to have the full drugforge environment installed.

The docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/master/).
To install the needed dependencies, you can run:

```bash
mamba env update -f docs/requirements.yaml -n YOUR_DRUGFORGE_ENVIRONMENT_NAME
mamba env update -f docs/requirements.yaml -n YOUR_DRUGFORGE_ENVIRONMENT_NAME
```

You can then build the docs with:
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Welcome to drugforge's documentation!
=========================================
<img src="_static/drugforge_logo.png" width="200">

All pandemics are global health threats. Our best defense is a healthy global antiviral discovery community with a robust pipeline of open discovery tools.
All pandemics are global health threats. Our best defense is a healthy global antiviral discovery community with a robust pipeline of open discovery tools.

The toolkit in this repo is a batteries-included drug discovery pipeline being actively developed in a transparent open-source way, with a focus on computational chemistry and informatics support for medicinal chemistry.

Expand All @@ -15,7 +15,7 @@ drugforge is not designed as a one size fits all solution for drug discovery, ra
```

```{warning}
The implementation of drugforge-ML is still in the works and will be available in the next release. If you want to use ML scoring please refer to the original version of this code under [asapdiscovery](https://github.com/asapdiscovery/asapdiscovery).
The implementation of drugforge-ML is still in the works and will be available in the next release. If you want to use ML scoring please refer to the original version of this code under [asapdiscovery](https://github.com/asapdiscovery/asapdiscovery).
```

The `drugforge` toolkit is focused around the following core competencies, organised into submodules:
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Note that the Docker image assumes that your OpenEye license is located at `~/.O
Developer installation from source
----------------------------------

To install `drugforge` from source, you will need to clone the repository, create a compatible base environment with mamba (or conda), we recommend using only the dependencies for `drugforge` for this step.
To install `drugforge` from source, you will need to clone the repository, create a compatible base environment with mamba (or conda), we recommend using only the dependencies for `drugforge` for this step.
Install the development dependencies/utils (such as openeye-toolkits, pytest, ipython, etc.).
And finally, install all the subpackages with `pip` using an editable install (so changes get automatically updated). This needs a for loop and compatibility config mode.
You can do this using the following commands:
Expand Down
6 changes: 1 addition & 5 deletions drugforge-alchemy/drugforge/alchemy/cli/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,7 @@ def run(

import pandas
import rich
from drugforge.alchemy.cli.utils import (
get_cpus,
print_header,
pull_from_postera,
)
from drugforge.alchemy.cli.utils import get_cpus, print_header, pull_from_postera
from drugforge.alchemy.schema.prep_workflow import AlchemyPrepWorkflow
from drugforge.data.readers.molfile import MolFileFactory
from drugforge.modeling.schema import PreppedComplex
Expand Down
4 changes: 2 additions & 2 deletions drugforge-alchemy/drugforge/alchemy/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import rich

if TYPE_CHECKING:
from cinnabar import FEMap
from drugforge.alchemy.schema.fec import FreeEnergyCalculationNetwork
from drugforge.data.schema.ligand import Ligand
from cinnabar import FEMap


def print_header(console: "rich.Console"):
Expand Down Expand Up @@ -68,8 +68,8 @@ def upload_to_postera(
from drugforge.data.services.postera.manifold_data_validation import (
rename_output_columns_for_manifold,
)
from drugforge.workflows.postera.postera_uploader import PosteraUploader
from drugforge.data.services.services_config import PosteraSettings
from drugforge.workflows.postera.postera_uploader import PosteraUploader

# mock an enum to specify which columns are allowed
class AlchemyResults(str, Enum):
Expand Down
2 changes: 1 addition & 1 deletion drugforge-alchemy/drugforge/alchemy/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import pandas as pd
import panel
import plotmol
from drugforge.data.schema.ligand import Ligand
from bokeh.models import Band, ColumnDataSource, Range1d, Whisker
from cinnabar import stats
from drugforge.data.schema.ligand import Ligand
from openff.units import unit
from rdkit import Chem
from rdkit.Chem import Draw
Expand Down
3 changes: 2 additions & 1 deletion drugforge-alchemy/drugforge/alchemy/schema/_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from collections import Counter
from typing import TYPE_CHECKING
from gufe.serialization.json import JSONCodec

from alchemiscale import ScopedKey
from gufe.serialization.json import JSONCodec

if TYPE_CHECKING:
from drugforge.data.schema.ligand import Ligand
Expand Down
2 changes: 2 additions & 0 deletions drugforge-alchemy/drugforge/alchemy/schema/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def to_file(self, filename: str):
Write the model to JSON file.
"""
from gufe.tokenization import JSON_HANDLER

from ._util import SCOPEDKEY_CODEC

JSON_HANDLER.add_codec(SCOPEDKEY_CODEC)
Expand All @@ -30,6 +31,7 @@ def from_file(cls, filename: str):
Load the model from a JSON file
"""
from gufe.tokenization import JSON_HANDLER

from ._util import SCOPEDKEY_CODEC

JSON_HANDLER.add_codec(SCOPEDKEY_CODEC)
Expand Down
4 changes: 2 additions & 2 deletions drugforge-alchemy/drugforge/alchemy/schema/fec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
from typing import TYPE_CHECKING, Any, Literal, Optional, Union, Dict
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Union

import gufe
import openfe
Expand Down Expand Up @@ -300,7 +300,7 @@ class AlchemiscaleResults(_BaseResults):
)

@validator("network_key", pre=True)
def convert_to_scoped_key(cls, value: Union[Dict, ScopedKey]) -> ScopedKey:
def convert_to_scoped_key(cls, value: Union[dict, ScopedKey]) -> ScopedKey:
# if we have a dict convert it to a ScopedKey
if isinstance(value, dict):
return ScopedKey(**value)
Expand Down
6 changes: 2 additions & 4 deletions drugforge-alchemy/drugforge/alchemy/schema/prep_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
ProtomerExpander,
)
from drugforge.data.operators.state_expanders.stereo_expander import StereoExpander
from drugforge.data.operators.state_expanders.tautomer_expander import (
TautomerExpander,
)
from drugforge.modeling.schema import PreppedComplex
from drugforge.data.operators.state_expanders.tautomer_expander import TautomerExpander
from drugforge.data.schema.ligand import Ligand
from drugforge.docking.schema.pose_generation import (
OpenEyeConstrainedPoseGenerator,
RDKitConstrainedPoseGenerator,
)
from drugforge.modeling.schema import PreppedComplex
from pydantic.v1 import Field
from rich import pretty
from rich.padding import Padding
Expand Down
2 changes: 1 addition & 1 deletion drugforge-alchemy/drugforge/alchemy/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from drugforge.alchemy.schema.prep_workflow import AlchemyPrepWorkflow
from drugforge.alchemy.utils import AlchemiscaleHelper
from drugforge.data.readers.molfile import MolFileFactory
from drugforge.modeling.schema import PreppedComplex
from drugforge.data.schema.ligand import Ligand, write_ligands_to_multi_sdf
from drugforge.data.testing.test_resources import fetch_test_file
from drugforge.docking.schema.pose_generation import OpenEyeConstrainedPoseGenerator
from drugforge.modeling.schema import PreppedComplex
from gufe.protocols import Context, ProtocolUnit, ProtocolUnitFailure


Expand Down
7 changes: 2 additions & 5 deletions drugforge-alchemy/drugforge/alchemy/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@
import rich
from alchemiscale import AlchemiscaleClient
from alchemiscale.models import ScopedKey
from click.testing import CliRunner
from drugforge.alchemy.cli.cli import alchemy
from drugforge.alchemy.schema.fec import (
FreeEnergyCalculationFactory,
FreeEnergyCalculationNetwork,
)
from drugforge.alchemy.schema.prep_workflow import (
AlchemyDataSet,
AlchemyPrepWorkflow,
)
from drugforge.alchemy.schema.prep_workflow import AlchemyDataSet, AlchemyPrepWorkflow
from drugforge.data.services.cdd.cdd_api import CDDAPI
from drugforge.data.testing.test_resources import fetch_test_file
from click.testing import CliRunner
from openfe.setup import LigandNetwork
from rdkit import Chem

Expand Down
8 changes: 2 additions & 6 deletions drugforge-alchemy/drugforge/alchemy/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ def get_cdd_data(protocol_name: str):
]
return pandas.DataFrame(data)

monkeypatch.setattr(
drugforge.alchemy.predict, "download_cdd_data", get_cdd_data
)
monkeypatch.setattr(drugforge.alchemy.predict, "download_cdd_data", get_cdd_data)

molecules = get_cdd_molecules(
protocol_name="my-protocol",
Expand Down Expand Up @@ -410,9 +408,7 @@ def get_cdd_data(protocol_name: str):
]
return pandas.DataFrame(data)

monkeypatch.setattr(
drugforge.alchemy.predict, "download_cdd_data", get_cdd_data
)
monkeypatch.setattr(drugforge.alchemy.predict, "download_cdd_data", get_cdd_data)

molecules = get_cdd_molecules(
protocol_name="my-protocol",
Expand Down
3 changes: 1 addition & 2 deletions drugforge-alchemy/drugforge/alchemy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
from drugforge.alchemy.schema.forcefield import ForceFieldParams
from openmm.app import ForceField, Modeller, PDBFile


if TYPE_CHECKING:
from drugforge.modeling.schema import PreppedComplex, PreppedTarget
from drugforge.data.schema.ligand import Ligand
from drugforge.data.schema.target import PreppedTarget
from drugforge.modeling.schema import PreppedComplex, PreppedTarget


def create_protein_only_system(input_pdb_path: str, ff_params: ForceFieldParams):
Expand Down
4 changes: 1 addition & 3 deletions drugforge-cli/drugforge/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
def cli(help="Command-line interface for drugforge"): ...


from drugforge.workflows.docking_workflows.cli import ( # noqa: F401, E402, F811
docking,
)
from drugforge.workflows.docking_workflows.cli import docking # noqa: F401, E402, F811

cli.add_command(docking)

Expand Down
2 changes: 1 addition & 1 deletion drugforge-cli/drugforge/cli/tests/test_meta_cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import traceback

import pytest
from drugforge.cli.cli import cli
from click.testing import CliRunner
from drugforge.cli.cli import cli


def click_success(result):
Expand Down
2 changes: 1 addition & 1 deletion drugforge-data/drugforge/data/backend/openeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any, Dict, List, Optional, Union # noqa: F401
from warnings import warn

from drugforge.data.schema.schema_base import MoleculeFilter
from openeye import ( # noqa: F401
oechem,
oedepict,
Expand All @@ -17,7 +18,6 @@
oespruce,
oeszybki,
)
from drugforge.data.schema.schema_base import MoleculeFilter

# exec on module import

Expand Down
Loading
Loading