Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: matsu323
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Size: 193 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

DeepRank-GNN

Build Status Codacy Badge Coverage Status DOI

alt-text

Installation

Before installing DeepRank-GNN you need to install pytorchgeometric according to your needs. You can find detailled instructions here : * pytorchgeometric : https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html

By default the CPU version of pytorch will be installed but you can also customize that installation following the instructions at: * pytorch : https://pytorch.org/

Once the dependencies installed, you can install the latest release of DeepRank-GNN using the PyPi package manager:

pip install DeepRank-GNN

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

git clone https://github.com/DeepRank/Deeprank-GNN cd DeepRank-GNN pip install -e ./

The documentation can be found here : https://deeprank-gnn.readthedocs.io/

Generate Graphs

All the graphs/line graphs of all the pdb/pssm stored in data/pdb/ and data/pssm/ with the GenGraph.py script. This will generate the hdf5 file graph_residue.hdf5 which contains the graph of the different conformations.

```python from GraphGenMP import GraphHDF5

pdbpath = './data/pdb' pssmpath = './data/pssm' ref = './data/ref'

GraphHDF5(pdbpath=pdbpath,refpath=ref,pssmpath=pssmpath, graphtype='residue',outfile='graph_residue.hdf5') ```

Graph Interaction Network

Using the graph interaction network is rather simple :

```python from deeprankgnn.NeuralNet import NeuralNet from deeprankgnn.ginet import GINet

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

NN = NeuralNet(database, GINet, nodefeature=['type', 'polarity', 'bsa', 'depth', 'hse', 'ic', 'pssm'], edgefeature=['dist'], target='irmsd', index=range(400), batch_size=64, percent=[0.8, 0.2])

NN.train(nepoch=250, validate=False) NN.plot_scatter() ```

Custom GNN

It is also possible to define new network architecture and to specify the loss and optimizer to be used during the training.

```python

def normalizedcut2d(edgeindex, pos): row, col = edgeindex edgeattr = torch.norm(pos[row] - pos[col], p=2, dim=1) return normalizedcut(edgeindex, edgeattr, num_nodes=pos.size(0))

class CustomNet(torch.nn.Module): def init(self): super(Net, self).init() self.conv1 = SplineConv(d.numfeatures, 32, dim=2, kernelsize=5) self.conv2 = SplineConv(32, 64, dim=2, kernel_size=5) self.fc1 = torch.nn.Linear(64, 128) self.fc2 = torch.nn.Linear(128, 1)

def forward(self, data):
    data.x = F.elu(self.conv1(data.x, data.edge_index, data.edge_attr))
    weight = normalized_cut_2d(data.edge_index, data.pos)
    cluster = graclus(data.edge_index, weight)
    data = max_pool(cluster, data)

    data.x = F.elu(self.conv2(data.x, data.edge_index, data.edge_attr))
    weight = normalized_cut_2d(data.edge_index, data.pos)
    cluster = graclus(data.edge_index, weight)
    x, batch = max_pool_x(cluster, data.x, data.batch)

    x = scatter_mean(x, batch, dim=0)
    x = F.elu(self.fc1(x))
    x = F.dropout(x, training=self.training)
    return F.log_softmax(self.fc2(x), dim=1)

device = torch.device('cuda' if torch.cuda.isavailable() else 'cpu') model = NeuralNet(database, CustomNet, nodefeature=['type', 'polarity', 'bsa', 'depth', 'hse', 'ic', 'pssm'], edgefeature=['dist'], target='irmsd', index=range(400), batchsize=64, percent=[0.8, 0.2]) model.optimizer = torch.optim.Adam(model.parameters(), lr=0.01) model.loss = MSELoss()

model.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.

alt-text

Owner

  • Login: matsu323
  • Kind: user

GitHub Events

Total
Last Year

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • s-weigand/setup-conda v1 composite
  • styfle/cancel-workflow-action 0.4.0 composite
setup.py pypi
  • BioPython *
  • chart-studio *
  • freesasa *
  • h5py *
  • markov-clustering *
  • matplotlib *
  • networkx *
  • numpy *
  • pdb2sql *
  • python-louvain *
  • scipy *
  • sklearn *
  • torch >=1.5.0
  • torch-cluster *
  • torch-geometric *
  • torch-scatter *
  • torch-sparse *
  • torch-spline-conv *
  • tqdm *