Skip to content

Commit

Permalink
Merge pull request #107 from DeepRank/rename_package
Browse files Browse the repository at this point in the history
Rename package and repo
  • Loading branch information
gcroci2 authored Jun 21, 2022
2 parents 36fda7c + 29bee5f commit 4e88237
Show file tree
Hide file tree
Showing 96 changed files with 227 additions and 233 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*__pycache__*

# distribution
deeprank_gnn.egg-info
DeepRank_GNN.egg-info
deeprankcore.egg-info
deeprank-core.egg-info
build/*
dist/*

Expand Down
10 changes: 5 additions & 5 deletions CITATION.CFF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: DeepRank-GNN
title: deeprank-core
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand All @@ -21,11 +21,11 @@ authors:
identifiers:
- type: url
value: ''
description: 'https://github.com/DeepRank/Deeprank-GNN'
repository-code: 'https://github.com/DeepRank/Deeprank-GNN'
url: 'https://deeprank-gnn.readthedocs.io/'
description: 'https://github.com/DeepRank/deeprank-core'
repository-code: 'https://github.com/DeepRank/deeprank-core'
url: 'https://deeprank-core.readthedocs.io/'
abstract: >-
DeepRank-GNN allows ranking of Protein-protein
deeprank-core allows ranking of Protein-protein
Interface using a graph representation of the
contact residues. Graphs of such interfaces are
used to train graph neural network for the
Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# DeepRank-GNN
# deeprank-core

[![Build Status](https://github.com/DeepRank/deeprank-gnn-2/actions/workflows/ci-pipeline.yml/badge.svg)](https://github.com/DeepRank/deeprank-gnn-2/actions)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f3f98b2d1883493ead50e3acaa23f2cc)](https://app.codacy.com/gh/DeepRank/DeepRank-GNN?utm_source=github.com&utm_medium=referral&utm_content=DeepRank/DeepRank-GNN&utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/DeepRank/deeprank-gnn-2/badge.svg?branch=main)](https://coveralls.io/github/DeepRank/deeprank-gnn-2?branch=main)
[![Build Status](https://github.com/DeepRank/deeprank-core/actions/workflows/ci-pipeline.yml/badge.svg)](https://github.com/DeepRank/deeprank-core/actions)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f3f98b2d1883493ead50e3acaa23f2cc)](https://app.codacy.com/gh/DeepRank/deeprank-core?utm_source=github.com&utm_medium=referral&utm_content=DeepRank/deeprank-core&utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/DeepRank/deeprank-core/badge.svg?branch=main)](https://coveralls.io/github/DeepRank/deeprank-core?branch=main)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5705564.svg)](https://doi.org/10.5281/zenodo.5705564)

![alt-text](./deeprank_gnn.png)
![alt-text](./deeprankcore.png)

## Installation

### Dependencies

Before installing DeepRank-GNN you need to install:
Before installing deeprank-core you need to install:

* [pytorch](https://pytorch.org/): `conda install pytorch -c pytorch`. Note that by default the CPU version of pytorch will be installed, but you can also customize that installation following the instructions on pytorch website.
* [pytorch_geometric](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html): `conda install pyg -c pyg` (recommended).
* [msms](https://ssbio.readthedocs.io/en/latest/instructions/msms.html): `conda install -c bioconda msms`. *For MacOS with M1 chip users*: you can follow [these instructions](https://ssbio.readthedocs.io/en/latest/instructions/msms.html).
* [reduce](https://github.com/rlabduke/reduce) Follow the instructions in the README

### DeepRank-GNN installation
### deeprank-core installation

[//]: # (Once the dependencies installed, you can install the latest release of DeepRank-GNN using the PyPi package manager:)
[//]: # (Once the dependencies installed, you can install the latest release of deeprank-core using the PyPi package manager:)

[//]: # (```)
[//]: # (pip install DeepRank-GNN)
[//]: # (pip install deeprankcore)
[//]: # (```)

You can get all the new developments by cloning the repo and installing the code with

```
git clone https://github.com/DeepRank/deeprank-gnn-2
cd deeprank-gnn-2
git clone https://github.com/DeepRank/deeprank-core
cd deeprankcore
pip install -e ./
```

[//]: # (The documentation can be found here : https://deeprank-gnn.readthedocs.io/)
[//]: # (The documentation can be found here : https://deeprank-core.readthedocs.io/)

## Generate Graphs

The process of generating graphs is called preprocessing. In order to do so, one needs query objects, describing how the graphs should be built.

```python
from deeprank_gnn.preprocess import preprocess
from deeprank_gnn.models.query import ProteinProteinInterfaceResidueQuery
from deeprank_gnn.feature import bsa, pssm, amino_acid, biopython
from deeprankcore.preprocess import preprocess
from deeprankcore.models.query import ProteinProteinInterfaceResidueQuery
from deeprankcore.feature import bsa, pssm, amino_acid, biopython

feature_modules = [bsa, pssm, amino_acid, biopython]

Expand Down Expand Up @@ -75,10 +75,10 @@ Using the graph interaction network is rather simple :


```python
from deeprank_gnn.NeuralNet import NeuralNet
from deeprank_gnn.DataSet import HDF5DataSet
from deeprank_gnn.ginet import GINet
from deeprank_gnn.models.metrics import OutputExporter, ScatterPlotExporter
from deeprankcore.NeuralNet import NeuralNet
from deeprankcore.DataSet import HDF5DataSet
from deeprankcore.ginet import GINet
from deeprankcore.models.metrics import OutputExporter, ScatterPlotExporter

database = './hdf5/1ACB_residue.hdf5'

Expand Down Expand Up @@ -191,6 +191,6 @@ nn.train(nepoch=50)

## h5x support

After installing `h5xplorer` (https://github.com/DeepRank/h5xplorer), you can execute the python file `deeprank_gnn/h5x/h5x.py` to explorer the connection graph used by DeepRank-GNN. The context menu (right click on the name of the structure) allows to automatically plot the graphs using `plotly` as shown below.
After installing `h5xplorer` (https://github.com/DeepRank/h5xplorer), you can execute the python file `deeprankcore/h5x/h5x.py` to explorer the connection graph used by deeprank-core. The context menu (right click on the name of the structure) allows to automatically plot the graphs using `plotly` as shown below.

![alt-text](./h5_deeprank_gnn.png)
![alt-text](./h5_deeprankcore.png)
File renamed without changes
6 changes: 3 additions & 3 deletions deeprank_gnn/DataSet.py → deeprankcore/DataSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import h5py
import copy
from ast import literal_eval
from deeprank_gnn.community_pooling import community_detection, community_pooling
from deeprankcore.community_pooling import community_detection, community_pooling


_log = logging.getLogger(__name__)
Expand Down Expand Up @@ -140,9 +140,9 @@ def __init__( # pylint: disable=too-many-arguments
node_feature (str or list, optional): consider all pre-computed node features ("all")
or some defined node features (provide a list, example: ["type", "polarity", "bsa"]).
The complete list can be found in deeprank_gnn/domain/features.py
The complete list can be found in deeprankcore/domain/features.py
edge_feature (list, optional): the complete list can be found in deeprank_gnn/domain/features.py.
edge_feature (list, optional): the complete list can be found in deeprankcore/domain/features.py.
Defaults to ["dist"], distance.
clustering_method (str, optional): perform node clustering ('mcl', Markov Clustering,
Expand Down
26 changes: 13 additions & 13 deletions deeprank_gnn/GraphGenMP.py → deeprankcore/GraphGenMP.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import h5py
from tqdm import tqdm

from deeprank_gnn.preprocess import preprocess
from deeprank_gnn.models.query import ProteinProteinInterfaceResidueQuery
from deeprank_gnn.tools.score import get_all_scores
import deeprank_gnn.feature.amino_acid
import deeprank_gnn.feature.atomic_contact
import deeprank_gnn.feature.biopython
import deeprank_gnn.feature.bsa
import deeprank_gnn.feature.pssm
from deeprankcore.preprocess import preprocess
from deeprankcore.models.query import ProteinProteinInterfaceResidueQuery
from deeprankcore.tools.score import get_all_scores
import deeprankcore.feature.amino_acid
import deeprankcore.feature.atomic_contact
import deeprankcore.feature.biopython
import deeprankcore.feature.bsa
import deeprankcore.feature.pssm


_log = logging.getLogger(__name__)
Expand Down Expand Up @@ -55,14 +55,14 @@ def __init__( # pylint: disable=too-many-arguments, too-many-locals
"""

self._feature_modules = [
deeprank_gnn.feature.amino_acid,
deeprank_gnn.feature.atomic_contact,
deeprank_gnn.feature.bsa,
deeprankcore.feature.amino_acid,
deeprankcore.feature.atomic_contact,
deeprankcore.feature.bsa,
]
if pssm_path is not None:
self._feature_modules.append(deeprank_gnn.feature.pssm)
self._feature_modules.append(deeprankcore.feature.pssm)
if biopython:
self._feature_modules.append(deeprank_gnn.feature.biopython)
self._feature_modules.append(deeprankcore.feature.biopython)

# get the list of PDB names
pdbs = list(filter(lambda x: x.endswith(".pdb"), os.listdir(pdb_path)))
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions deeprank_gnn/NeuralNet.py → deeprankcore/NeuralNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import torch.nn.functional as F
from torch_geometric.data import DataLoader

# deeprank_gnn import
from deeprank_gnn.models.metrics import MetricsExporterCollection, MetricsExporter
from deeprank_gnn.DataSet import DivideDataSet, PreCluster
# deeprankcore import
from deeprankcore.models.metrics import MetricsExporterCollection, MetricsExporter
from deeprankcore.DataSet import DivideDataSet, PreCluster

_log = logging.getLogger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from deeprank_gnn.models.amino_acid import AminoAcid
from deeprank_gnn.models.polarity import Polarity
from deeprankcore.models.amino_acid import AminoAcid
from deeprankcore.models.polarity import Polarity

alanine = AminoAcid(
"Alanine",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
import logging
import numpy
from deeprank_gnn.models.structure import Atom, Residue
from deeprank_gnn.models.forcefield.patch import PatchActionType
from deeprank_gnn.tools.forcefield.top import TopParser
from deeprank_gnn.tools.forcefield.patch import PatchParser
from deeprank_gnn.tools.forcefield.residue import ResidueClassParser
from deeprank_gnn.tools.forcefield.param import ParamParser
from deeprank_gnn.models.error import UnknownAtomError
from deeprankcore.models.structure import Atom, Residue
from deeprankcore.models.forcefield.patch import PatchActionType
from deeprankcore.tools.forcefield.top import TopParser
from deeprankcore.tools.forcefield.patch import PatchParser
from deeprankcore.tools.forcefield.residue import ResidueClassParser
from deeprankcore.tools.forcefield.param import ParamParser
from deeprankcore.models.error import UnknownAtomError

logging.getLogger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Optional

import numpy
from deeprank_gnn.models.graph import Graph
from deeprank_gnn.models.variant import SingleResidueVariant
from deeprank_gnn.models.structure import Atom, Residue
from deeprank_gnn.domain.feature import (FEATURENAME_AMINOACID, FEATURENAME_VARIANTAMINOACID,
from deeprankcore.models.graph import Graph
from deeprankcore.models.variant import SingleResidueVariant
from deeprankcore.models.structure import Atom, Residue
from deeprankcore.domain.feature import (FEATURENAME_AMINOACID, FEATURENAME_VARIANTAMINOACID,
FEATURENAME_SIZE, FEATURENAME_POLARITY,
FEATURENAME_SIZEDIFFERENCE, FEATURENAME_POLARITYDIFFERENCE,
FEATURENAME_HYDROGENBONDDONORS, FEATURENAME_HYDROGENBONDDONORSDIFFERENCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import logging
import numpy
from scipy.spatial import distance_matrix
from deeprank_gnn.models.structure import Atom
from deeprank_gnn.models.graph import Graph, Edge
from deeprank_gnn.models.contact import ResidueContact, AtomicContact
from deeprank_gnn.domain.feature import (FEATURENAME_EDGEDISTANCE, FEATURENAME_EDGEVANDERWAALS,
from deeprankcore.models.structure import Atom
from deeprankcore.models.graph import Graph, Edge
from deeprankcore.models.contact import ResidueContact, AtomicContact
from deeprankcore.domain.feature import (FEATURENAME_EDGEDISTANCE, FEATURENAME_EDGEVANDERWAALS,
FEATURENAME_EDGECOULOMB, FEATURENAME_COVALENT)
from deeprank_gnn.domain.forcefield import atomic_forcefield, COULOMB_CONSTANT, EPSILON0, MAX_COVALENT_DISTANCE
from deeprank_gnn.models.forcefield.vanderwaals import VanderwaalsParam
from deeprank_gnn.models.error import UnknownAtomError
from deeprankcore.domain.forcefield import atomic_forcefield, COULOMB_CONSTANT, EPSILON0, MAX_COVALENT_DISTANCE
from deeprankcore.models.forcefield.vanderwaals import VanderwaalsParam
from deeprankcore.models.error import UnknownAtomError


_log = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.ResidueDepth import get_surface, residue_depth
from Bio.PDB.HSExposure import HSExposureCA
from deeprank_gnn.domain.feature import FEATURENAME_RESIDUEDEPTH, FEATURENAME_HALFSPHEREEXPOSURE
from deeprank_gnn.models.structure import Atom, Residue
from deeprank_gnn.models.graph import Graph
from deeprankcore.domain.feature import FEATURENAME_RESIDUEDEPTH, FEATURENAME_HALFSPHEREEXPOSURE
from deeprankcore.models.structure import Atom, Residue
from deeprankcore.models.graph import Graph


logging.getLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions deeprank_gnn/feature/bsa.py → deeprankcore/feature/bsa.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
import freesasa
from deeprank_gnn.models.graph import Graph
from deeprank_gnn.models.structure import Residue, Atom
from deeprank_gnn.domain.feature import FEATURENAME_BURIEDSURFACEAREA
from deeprankcore.models.graph import Graph
from deeprankcore.models.structure import Residue, Atom
from deeprankcore.domain.feature import FEATURENAME_BURIEDSURFACEAREA


logging.getLogger(__name__)
Expand Down
10 changes: 5 additions & 5 deletions deeprank_gnn/feature/pssm.py → deeprankcore/feature/pssm.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Optional
import numpy
from deeprank_gnn.models.variant import SingleResidueVariant
from deeprank_gnn.domain.amino_acid import amino_acids
from deeprank_gnn.models.structure import Residue, Atom
from deeprank_gnn.models.graph import Graph
from deeprank_gnn.domain.feature import (FEATURENAME_PSSM, FEATURENAME_PSSMDIFFERENCE,
from deeprankcore.models.variant import SingleResidueVariant
from deeprankcore.domain.amino_acid import amino_acids
from deeprankcore.models.structure import Residue, Atom
from deeprankcore.models.graph import Graph
from deeprankcore.domain.feature import (FEATURENAME_PSSM, FEATURENAME_PSSMDIFFERENCE,
FEATURENAME_PSSMWILDTYPE, FEATURENAME_PSSMVARIANT,
FEATURENAME_INFORMATIONCONTENT)

Expand Down
6 changes: 3 additions & 3 deletions deeprank_gnn/feature/sasa.py → deeprankcore/feature/sasa.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List
import numpy
import freesasa
from deeprank_gnn.models.structure import Residue, Atom
from deeprank_gnn.models.graph import Node, Graph
from deeprank_gnn.domain.feature import FEATURENAME_SASA
from deeprankcore.models.structure import Residue, Atom
from deeprankcore.models.graph import Node, Graph
from deeprankcore.domain.feature import FEATURENAME_SASA


def add_features_for_residues(structure: freesasa.Structure, # pylint: disable=c-extension-no-member
Expand Down
2 changes: 1 addition & 1 deletion deeprank_gnn/foutnet.py → deeprankcore/foutnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from torch_geometric.nn.inits import uniform
from torch_geometric.nn import max_pool_x

from deeprank_gnn.community_pooling import get_preloaded_cluster, community_pooling
from deeprankcore.community_pooling import get_preloaded_cluster, community_pooling


class FoutLayer(torch.nn.Module):
Expand Down
4 changes: 2 additions & 2 deletions deeprank_gnn/ginet.py → deeprankcore/ginet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from torch_geometric.nn.inits import uniform
from torch_geometric.nn import max_pool_x

# deeprank_gnn import
from deeprank_gnn.community_pooling import get_preloaded_cluster, community_pooling
# deeprankcore import
from deeprankcore.community_pooling import get_preloaded_cluster, community_pooling


class GINetConvLayer(torch.nn.Module):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from deeprank_gnn.tools.visualization import hdf5_to_networkx, plotly_3d, plotly_2d
from deeprankcore.tools.visualization import hdf5_to_networkx, plotly_3d, plotly_2d
import plotly.offline as py

def tsne_graph(grp, method):
Expand Down
1 change: 0 additions & 1 deletion deeprank_gnn/h5x/h5x.py → deeprankcore/h5x/h5x.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from h5xplorer.h5xplorer import h5xplorer
import h5x_menu

#baseimport = '/home/nico/Documents/projects/deeprank/DeepRank-GNN/deeprank_gnn/h5x/baseimport.py'
baseimport = os.path.dirname(
os.path.abspath(__file__)) + "/baseimport.py"
app = h5xplorer(h5x_menu.context_menu,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy

from deeprank_gnn.models.polarity import Polarity
from deeprankcore.models.polarity import Polarity


class AminoAcid:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC
from deeprank_gnn.models.pair import Pair
from deeprank_gnn.models.structure import Residue, Atom
from deeprankcore.models.pair import Pair
from deeprankcore.models.structure import Residue, Atom

class Contact(Pair, ABC):
pass
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions deeprank_gnn/models/graph.py → deeprankcore/models/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import numpy
import h5py

from deeprank_gnn.models.structure import Atom, Residue
from deeprank_gnn.models.contact import Contact
from deeprank_gnn.models.grid import MapMethod, Grid, GridSettings
from deeprank_gnn.domain.storage import (
from deeprankcore.models.structure import Atom, Residue
from deeprankcore.models.contact import Contact
from deeprankcore.models.grid import MapMethod, Grid, GridSettings
from deeprankcore.domain.storage import (
HDF5KEY_GRAPH_SCORE,
HDF5KEY_GRAPH_NODENAMES,
HDF5KEY_GRAPH_NODEFEATURES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import h5py
import itertools
from scipy.signal import bspline
from deeprank_gnn.domain.storage import (
from deeprankcore.domain.storage import (
HDF5KEY_GRID_POINTS,
HDF5KEY_GRID_X,
HDF5KEY_GRID_Y,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4e88237

Please sign in to comment.