Skip to content

Commit

Permalink
[Doc] Update (#175)
Browse files Browse the repository at this point in the history
* Update

* Update
  • Loading branch information
mufeili authored Mar 12, 2022
1 parent 2ad2608 commit 4ca5645
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 58 deletions.
10 changes: 10 additions & 0 deletions docs/source/api/model.gnn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ GNNOGB
------
.. automodule:: dgllife.model.gnn.gnn_ogb
:members:

NF
--
.. automodule:: dgllife.model.gnn.nf
:members:

PAGTN
-----
.. automodule:: dgllife.model.gnn.pagtn
:members:
20 changes: 20 additions & 0 deletions docs/source/api/model.zoo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ GNN OGB Predictor
.. automodule:: dgllife.model.model_zoo.gnn_ogb_predictor
:members:

Neural Fingerprint Predictor
````````````````````````````
.. automodule:: dgllife.model.model_zoo.nf_predictor
:members:

Path-Augmented Graph Transformer Predictor
``````````````````````````````````````````
.. automodule:: dgllife.model.model_zoo.pagtn_predictor
:members:

Generative Models
-----------------

Expand All @@ -77,6 +87,11 @@ DGMG
.. automodule:: dgllife.model.model_zoo.dgmg
:members:

JTNNVAE
```````
.. automodule:: dgllife.model.model_zoo.jtvae
:members:

Reaction Prediction

WLN for Reaction Center Prediction
Expand All @@ -95,3 +110,8 @@ ACNN
````
.. automodule:: dgllife.model.model_zoo.acnn
:members:

PotentialNet
````````````
.. automodule:: dgllife.model.model_zoo.potentialnet
:members:
1 change: 1 addition & 0 deletions docs/source/api/utils.complexes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Utilities in DGL-LifeSci for working with protein-ligand complexes.
:toctree: ../generated/

dgllife.utils.ACNN_graph_construction_and_featurization
dgllife.utils.PN_graph_construction_and_featurization
4 changes: 4 additions & 0 deletions docs/source/api/utils.mols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ For using featurization methods like above in creating node features:
dgllife.utils.PretrainAtomFeaturizer
dgllife.utils.AttentiveFPAtomFeaturizer
dgllife.utils.AttentiveFPAtomFeaturizer.feat_size
dgllife.utils.PAGTNAtomFeaturizer
dgllife.utils.PAGTNAtomFeaturizer.feat_size

Featurization for Edges
```````````````````````
Expand Down Expand Up @@ -164,3 +166,5 @@ For using featurization methods like above in creating edge features:
dgllife.utils.PretrainBondFeaturizer
dgllife.utils.AttentiveFPBondFeaturizer
dgllife.utils.AttentiveFPBondFeaturizer.feat_size
dgllife.utils.PAGTNEdgeFeaturizer
dgllife.utils.PAGTNEdgeFeaturizer.feat_size
2 changes: 1 addition & 1 deletion docs/source/api/utils.pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Early stopping is a standard practice for preventing models from overfitting and
class for handling it.

.. autoclass:: dgllife.utils.EarlyStopping
:members:
:members: step
35 changes: 35 additions & 0 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _cli:

Command Line Interface
======================

DGL-LifeSci provides command line interfaces that allow users
to perform modeling without any background in programming and
deep learning. In addition to installation, you will need to
clone the github repo with

.. code:: bash
git clone https://github.com/awslabs/dgl-lifesci.git
Molecular Property Prediction
-----------------------------

Go to the directory below with

.. code:: bash
cd dgl-lifesci/examples/property_prediction/csv_data_configuration/
and then follow the README file.

Reaction Prediction
-------------------

Go to the directory below with

.. code:: bash
cd dgl-lifesci/examples/reaction_prediction/rexgen_direct/
and then follow the README file.
28 changes: 6 additions & 22 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,12 @@ DGL-LifeSci: Bringing Graph Neural Networks to Chemistry and Biology
===========================================================================================

DGL-LifeSci is a python package for applying graph neural networks to various tasks in chemistry
and biology, on top of PyTorch and DGL. It provides:
and biology, on top of PyTorch, DGL, and RDKit. It covers various applications, including:

* Various utilities for data processing, training and evaluation.
* Efficient and flexible model implementations.
* Pre-trained models for use without training from scratch.

We cover various applications in our
`examples <https://github.com/awslabs/dgl-lifesci/tree/master/examples>`_, including:

* `Molecular property prediction <https://github.com/awslabs/dgl-lifesci/tree/master/examples/property_prediction>`_
* `Attention visualization <https://github.com/awslabs/dgl-lifesci/tree/master/examples/property_prediction/pubchem_aromaticity>`_
* `Generative models <https://github.com/awslabs/dgl-lifesci/tree/master/examples/generative_models>`_
* `Protein-ligand binding affinity prediction <https://github.com/awslabs/dgl-lifesci/tree/master/examples/binding_affinity_prediction>`_
* `Reaction prediction <https://github.com/awslabs/dgl-lifesci/tree/master/examples/reaction_prediction>`_

Get Started
------------

Follow the :doc:`instructions<install/index>` to install DGL.
* Molecular property prediction
* Generative models
* Reaction prediction
* Protein-ligand binding affinity prediction

.. toctree::
:maxdepth: 1
Expand All @@ -29,6 +16,7 @@ Follow the :doc:`instructions<install/index>` to install DGL.
:glob:

install/index
cli

.. toctree::
:maxdepth: 2
Expand All @@ -50,7 +38,3 @@ Free software
-------------
DGL-LifeSci is free software; you can redistribute it and/or modify it under the terms
of the Apache License 2.0. We welcome contributions. Join us on `GitHub <https://github.com/awslabs/dgl-lifesci>`_.

Index
-----
* :ref:`genindex`
26 changes: 3 additions & 23 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Install DGL-LifeSci
===================

This topic explains how to install DGL-LifeSci. We recommend installing DGL-LifeSci by using ``conda`` or ``pip``.
Installation
============

System requirements
-------------------
DGL-LifeSci works with the following operating systems:
DGL-LifeSci should work on:

* Ubuntu 16.04
* macOS X
Expand All @@ -17,15 +15,6 @@ DGL-LifeSci requires:
* `DGL 0.4.3 or later <https://www.dgl.ai/pages/start.html>`_
* `PyTorch 1.2.0 or later <https://pytorch.org/>`_

If you have just installed DGL, the first time you use it, a message will pop up as follows:

.. code:: bash
DGL does not detect a valid backend option. Which backend would you like to work with?
Backend choice (pytorch, mxnet or tensorflow):
and you need to enter ``pytorch``.

Additionally, we require **RDKit 2018.09.3** for cheminformatics. We recommend installing it with

.. code:: bash
Expand All @@ -34,15 +23,6 @@ Additionally, we require **RDKit 2018.09.3** for cheminformatics. We recommend i
Other verions of RDKit are not tested.

Install from conda
----------------------
If ``conda`` is not yet installed, get either `miniconda <https://conda.io/miniconda.html>`_ or
the full `anaconda <https://www.anaconda.com/download/>`_.

.. code:: bash
conda install -c dglteam dgllife
Install from pip
----------------

Expand Down
8 changes: 4 additions & 4 deletions python/dgllife/model/model_zoo/weave_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class WeavePredictor(nn.Module):
specifies the mean and std for constructing a normal
distribution. This argument comes into effect only when
``gaussian_expand==True``. By default, we set this to be
``[(-1.645, 0.283), (-1.080, 0.170), (-0.739, 0.134),
(-0.468, 0.118), (-0.228, 0.114), (0., 0.114),
(0.228, 0.114), (0.468, 0.118), (0.739, 0.134),
(1.080, 0.170), (1.645, 0.283)]``.
a list consisting of ``(-1.645, 0.283)``, ``(-1.080, 0.170)``,
``(-0.739, 0.134)``, ``(-0.468, 0.118)``, ``(-0.228, 0.114)``, ``(0., 0.114)``,
``(0.228, 0.114)``, ``(0.468, 0.118)``, ``(0.739, 0.134)``,
``(1.080, 0.170)``, ``(1.645, 0.283)``.
readout_activation : callable
Activation function to be used in computing graph
representations out of node representations. Default to Tanh.
Expand Down
6 changes: 3 additions & 3 deletions python/dgllife/model/readout/weave_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class WeaveGather(nn.Module):
For each tuple, the first and second element separately specifies the mean
and std for constructing a normal distribution. This argument comes into
effect only when ``gaussian_expand==True``. By default, we set this to be
``[(-1.645, 0.283), (-1.080, 0.170), (-0.739, 0.134), (-0.468, 0.118),
(-0.228, 0.114), (0., 0.114), (0.228, 0.114), (0.468, 0.118),
(0.739, 0.134), (1.080, 0.170), (1.645, 0.283)]``.
a list consisting of ``(-1.645, 0.283)``, ``(-1.080, 0.170)``, ``(-0.739, 0.134)``,
``(-0.468, 0.118)``, ``(-0.228, 0.114)``, ``(0., 0.114)``, ``(0.228, 0.114)``,
``(0.468, 0.118)``, ``(0.739, 0.134)``, ``(1.080, 0.170)``, ``(1.645, 0.283)``.
activation : callable
Activation function to apply. Default to tanh.
"""
Expand Down
2 changes: 0 additions & 2 deletions python/dgllife/utils/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ def analyze_mols(smiles=None, mols=None, num_processes=1, path_to_export=None):
'valid_proportion': 0.6666666666666666, # Proportion of valid molecules
'cano_smi': ['CCO', # Canonical SMILES for valid molecules
'CC1(C)S[C@@H]2[C@H](NC(=O)Cc3ccccc3)C(=O)N2[C@H]1C(=O)O'],
# The following items give the number of times each descriptor value appears in molecules
'atom_type_frequency': {'O': 2, 'C': 2, 'N': 1, 'S': 1},
'degree_frequency': {1: 2, 2: 2, 3: 1, 4: 1},
'total_degree_frequency': {2: 2, 4: 2, 1: 1, 3: 1},
Expand Down
6 changes: 3 additions & 3 deletions python/dgllife/utils/featurizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,9 @@ class PretrainAtomFeaturizer(object):
choice of 1-118.
chiral_types : list of Chem.rdchem.ChiralType or None
Atom chirality to consider for one-hot encoding. If None, we will use a default
choice of ``Chem.rdchem.ChiralType.CHI_UNSPECIFIED,
Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW,
Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW, Chem.rdchem.ChiralType.CHI_OTHER``.
choice, including ``Chem.rdchem.ChiralType.CHI_UNSPECIFIED``,
``Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW``,
``Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW``, ``Chem.rdchem.ChiralType.CHI_OTHER``.
Examples
--------
Expand Down

0 comments on commit 4ca5645

Please sign in to comment.