Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: Run flake8
run: |
tox -e flake8
- name: Run doc test
run: |
tox -e docs
- name: Run test-suite
run: |
tox -e py
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/

docs/source/api/
29 changes: 19 additions & 10 deletions chemicalx/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@

from class_resolver import Resolver

from .batchgenerator import * # noqa:F401,F403
from .contextfeatureset import * # noqa:F401,F403
from .datasetloader import ( # noqa:F401,F403
DatasetLoader,
DrugCombDatasetLoader,
DrugCombDbDatasetLoader,
)
from .drugfeatureset import * # noqa:F401,F403
from .drugpairbatch import * # noqa:F401,F403
from .labeledtriples import * # noqa:F401,F403
from .batchgenerator import BatchGenerator
from .contextfeatureset import ContextFeatureSet
from .datasetloader import DatasetLoader, DrugCombDatasetLoader, DrugCombDbDatasetLoader
from .drugfeatureset import DrugFeatureSet
from .drugpairbatch import DrugPairBatch
from .labeledtriples import LabeledTriples

__all__ = [
"BatchGenerator",
"ContextFeatureSet",
"DrugFeatureSet",
"DrugPairBatch",
"LabeledTriples",
# Datasets
"dataset_resolver",
"DatasetLoader",
"DrugCombDatasetLoader",
"DrugCombDbDatasetLoader",
]

dataset_resolver = Resolver.from_subclasses(base=DatasetLoader)
47 changes: 33 additions & 14 deletions chemicalx/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
"""Models for ChemicalX."""

from class_resolver import Resolver # noqa:F401,F403
from class_resolver import Resolver

from .base import UnimplementedModel # noqa:F401,F403
from .caster import * # noqa:F401,F403
from .deepcci import * # noqa:F401,F403
from .deepddi import * # noqa:F401,F403
from .deepdds import * # noqa:F401,F403
from .deepdrug import * # noqa:F401,F403
from .deepsynergy import * # noqa:F401,F403
from .epgcnds import * # noqa:F401,F403
from .gcnbmp import * # noqa:F401,F403
from .matchmaker import * # noqa:F401,F403
from .mhcaddi import * # noqa:F401,F403
from .mrgnn import * # noqa:F401,F403
from .ssiddi import * # noqa:F401,F403
from .base import UnimplementedModel
from .caster import CASTER
from .deepcci import DeepCCI
from .deepddi import DeepDDI
from .deepdds import DeepDDS
from .deepdrug import DeepDrug
from .deepsynergy import DeepSynergy
from .epgcnds import EPGCNDS
from .gcnbmp import GCNBMP
from .matchmaker import MatchMaker
from .mhcaddi import MHCADDI
from .mrgnn import MRGNN
from .ssiddi import SSIDDI

__all__ = [
"model_resolver",
# Base models
"UnimplementedModel",
# Implementations
"CASTER",
"DeepCCI",
"DeepDDI",
"DeepDDS",
"DeepDrug",
"DeepSynergy",
"EPGCNDS",
"GCNBMP",
"MatchMaker",
"MHCADDI",
"MRGNN",
"SSIDDI",
]

model_resolver = Resolver.from_subclasses(base=UnimplementedModel)
4 changes: 2 additions & 2 deletions chemicalx/models/deepsynergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
class DeepSynergy(torch.nn.Module):
r"""The DeepSynergy model from [deepsynergy]_.

.. [deepsynergy] `"DeepSynergy: Predicting Anti-Cancer Drug Synergy with Deep Learning"
<https://academic.oup.com/bioinformatics/article/34/9/1538/4747884>`_
.. [deepsynergy] `DeepSynergy: Predicting Anti-Cancer Drug Synergy with Deep Learning
<https://academic.oup.com/bioinformatics/article/34/9/1538/4747884>`_
"""

def __init__(
Expand Down
6 changes: 3 additions & 3 deletions chemicalx/models/epgcnds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class EPGCNDS(torch.nn.Module):
r"""The EPGCN-DS model from [epgcnds]_.

.. [epgcnds] `"Structure-Based Drug-Drug Interaction Detection
via Expressive Graph Convolutional Networks and Deep Sets"
<https://ojs.aaai.org/index.php/AAAI/article/view/7236>`_ paper.
.. [epgcnds] `Structure-Based Drug-Drug Interaction Detection
via Expressive Graph Convolutional Networks and Deep Sets
<https://ojs.aaai.org/index.php/AAAI/article/view/7236>`_
"""

def __init__(self, in_channels: int, hidden_channels: int = 32, out_channels: int = 16):
Expand Down
16 changes: 13 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
SPHINXBUILD = sphinx-build
SPHINXPROJ = chemicalx
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -m sphinx
SPHINXPROJ = ChemicalX
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)"
14 changes: 0 additions & 14 deletions docs/requirements_1.txt

This file was deleted.

5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
"jupyter_sphinx",
"sphinx_autodoc_typehints",
"sphinx_automodapi.automodapi",
]

source_suffix = ".rst"
Expand All @@ -45,7 +48,7 @@

html_logo = "_static/img/chemicalx.jpg"
html_static_path = ["_static"]
html_context = {"css_files": ["_static/css/custom.css"]}
# html_context = {"css_files": ["_static/css/custom.css"]}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seemed to break the build locally but I guess it's working on RTD? I'd rather skip this since local testing is important

rst_context = {"chemicalx": chemicalx}

add_module_names = False
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:github_url: https://github.com/AstraZeneca/chemicalx

ChemicalX Documentation
===============================
=======================



Expand Down
94 changes: 8 additions & 86 deletions docs/source/modules/root.rst
Original file line number Diff line number Diff line change
@@ -1,94 +1,16 @@
ChemicalX
==================

=========
.. contents:: Contents
:local:


Data Structures and Loaders
--------------------

.. autoclass:: chemicalx.data.drugfeatureset.DrugFeatureSet
:members:
:undoc-members:

.. autoclass:: chemicalx.data.labelset.LabelSet
:members:
:undoc-members:

.. autoclass:: chemicalx.data.contextfeatureset.ContextFeatureSet
:members:
:undoc-members:

.. autoclass:: chemicalx.data.datasetloader.DatasetLoader
:members:
:undoc-members:

.. autoclass:: chemicalx.data.batchgenerator.BatchGenerator
:members:
:undoc-members:

.. autoclass:: chemicalx.data.drugpairbatch.DrugPairBatch
:members:
:undoc-members:
---------------------------
.. automodapi:: chemicalx.data
:no-heading:
:headings: --

Pair Scoring Models
--------------------



.. autoclass:: chemicalx.models.caster.CASTER
:members:
:undoc-members:


.. autoclass:: chemicalx.models.deepcci.DeepCCI
:members:
:undoc-members:


.. autoclass:: chemicalx.models.deepddi.DeepDDI
:members:
:undoc-members:


.. autoclass:: chemicalx.models.deepdds.DeepDDS
:members:
:undoc-members:


.. autoclass:: chemicalx.models.deepdrug.DeepDrug
:members:
:undoc-members:

.. autoclass:: chemicalx.models.deepsynergy.DeepSynergy
:members:
:undoc-members:

.. autoclass:: chemicalx.models.epgcnds.EPGCNDS
:members:
:undoc-members:

.. autoclass:: chemicalx.models.gcnbmp.GCNBMP
:members:
:undoc-members:

.. autoclass:: chemicalx.models.matchmaker.MatchMaker
:members:
:undoc-members:

.. autoclass:: chemicalx.models.mhcaddi.MHCADDI
:members:
:undoc-members:

.. autoclass:: chemicalx.models.mrgnn.MRGNN
:members:
:undoc-members:

.. autoclass:: chemicalx.models.ssiddi.SSIDDI
:members:
:undoc-members:




.. automodapi:: chemicalx.models
:no-heading:
:headings: --
15 changes: 6 additions & 9 deletions docs/source/notes/installation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Installation
============

The installation of ChemicalX requires the presence of certain prerequisites. These are described in great detail in the installation description of PyTorch Geometric. Please follow the instructions laid out `here <https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html>`_. You might also take a look at the `readme file <https://github.com/AstraZeneca/chemicalx>`_ of the ChemicalX repository. The torch-scatter binaries are provided for Python version <= 3.9.

**PyTorch 1.10.0**
Expand All @@ -21,20 +20,18 @@ where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu111` dependin

The package itself can be installed via pip:

.. code-block:: none
.. code-block:: shell

$ pip install chemicalx
$ pip install chemicalx

Upgrade your outdated ChemicalX version by using:

.. code-block:: none

$ pip install chemicalx --upgrade
.. code-block:: shell

$ pip install chemicalx --upgrade

To check your current package version just simply run:

.. code-block:: none

$ pip freeze | grep chemicalx
.. code-block:: shell

$ pip freeze | grep chemicalx
4 changes: 1 addition & 3 deletions docs/source/notes/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ Introduction by example
=======================

Overview
=======================
--------------------------------------------------------------------------------

========
We shortly overview the fundamental concepts and features of **ChemicalX** through simple examples. These are the following:

.. contents::
Expand Down
Loading