Coder Social home page Coder Social logo

csbg-lsu / bionoinet Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 13.0 204.88 MB

Pytorch implementation of BionoiNet, which is a deep learning-based software to classify ligand-binding sites.

License: MIT License

Python 98.53% Shell 1.47%
binding-sites convolutional-neural-network deep-neural-network structural-biology drug-design deep-learning

bionoinet's Introduction

BionoiNet

BionoiNet is a deep learning-based framework for ligand-binding site classification. It transforms 3-d structures of ligand-binding sites into 2-d images, and then these images are processed by a deep neural network (DNN) to generate classification results. The pipeline of BionoiNet is shown below:

The 2-d images of ligand-binding sites are generated using the Bionoi software and the DNN is implemented with the APIs of Pytorch. The datasets are divided into 5 folds for cross-validation and the sequence identity between the training and validation sets is less than 20%.

Dependency

Install the dependency package using this file: dependency/environment.yml. This denpendency file is exported by Anaconda. To install the environment:

conda env create -f environment.yml

Folders

  • bionoi: a software that transforms ligand-binding sites (.mol2 files) into Voronoi diagrams.
  • bionoi_autoencoder: autoencoder that trained on Bionoi images in an un-supervised manner. The trained autoencoder can be used to produce latent space vectors of Bionoi images for machine learning applications.
  • bionoi_cnn_homology_reduced: a convolutional neural network (CNN) trained on the Voronoi representations of ligand-binding sites for classification.
  • dependency: dependency python packages.
  • homology_reduced_folds: files containing folds such that the sequence identity between train and validation is less than 20%.
  • lecacy: codes produced during research, not used in final version.

Usage

  1. Unzip the .mol2 files located at /homology_reduced_folds/mols.zip.
  2. Download this repository and put it where you extract the .mol2 files. The layout of the project should be like following:
    .
    ├── BionoiNet
    └── homology_reduced_mols      
        ├── control
            ├── fold_1   
            ├── fold_2
            ├── ...
            └── fold_5
        ├── heme
            ├── fold_1   
            ├── fold_2
            ├── ...
            └── fold_5
        └── nucleotide
            ├── fold_1   
            ├── fold_2
            ├── ...
            └── fold_5
  1. Run Bionoi by executing /bionoi/img_gen.sh to transform .mol2 files to images.
  2. Train the convolutional neural network (CNN) at /bionoi_cnn_homology_reduced/ for cross-validation:
python homology_reduced_cnn_cv_resnet18.py -op control_vs_nucleotide -root_dir ../../bionoi_output/residue_type/ -batch_size 32 -result_file_suffix 1st
  1. Grab a cup of coffee and wait for results.

Citation

If you find this work useful, please cite our papers in your work :)

Shi W, Lemoine JM, Shawky MA, Singha M, Pu L, Yang S, Ramanujam J, Brylinski M. (2020) BionoiNet: Ligand-binding site classification with off-the-shelf deep neural network. Bioinformatics 36 (10): 3077-3083.

Feinstein J, Shi W, Ramanujam J, Brylinski M. Bionoi: A Voronoi Diagram-Based Representation of Ligand-Binding Sites in Proteins for Machine Learning Applications. Methods Mol Biol. 2021;2266:299-312. doi: 10.1007/978-1-0716-1209-5_17. PMID: 33759134.

bionoinet's People

Contributors

jofeinstein avatar shiwentao00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bionoinet's Issues

ModuleNotFoundError: No module named 'cv2'

After I installed biopandas by pip install biopandas, I faced with the error when running img_gen.sh:

colorby:
residue_type
input directory:
../../homology_reduced_mols/control/fold_1
output directory:
../../bionoi_output/residue_type/homology_reduced_mols/control/
pop directory:
../../pop_folder/homology_reduced_mols/
profile directory:
../../profile_folder/homology_reduced_mols/

1a5iA00-1.mol2
Matplotlib is building the font cache using fc-list. This may take a moment.
Fontconfig warning: ignoring UTF-8: not a valid region tag
Traceback (most recent call last):
  File "bionoi.py", line 16, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'
1b25C00-1.mol2
Traceback (most recent call last):
  File "bionoi.py", line 16, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

I tried to install opencv by using conda (conda install opencv) but it is conflicted:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - cycler==0.10.0=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0']
  - h5py==2.9.0 -> python[version='<3|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0']
  - imageio==2.5.0=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - mkl_fft==1.0.12=py36ha843d7b_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - mkl_random==1.0.2=py36hd81dba3_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - numpy==1.16.3=py36h7e9f1db_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - pandas==0.24.2=py36he6710b0_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - pillow==6.0.0=py36h34e0f95_0 -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.7,<3.8.0a0']
  - pip==19.1.1=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.11,<3.12.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - pyqt==5.9.2=py36h05f1152_2 -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']
  - python-dateutil==2.8.0=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0']
  - pytorch==1.0.1=cuda92py36h65efead_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0']
  - pywavelets==1.0.3=py36hdd07704_1 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - scipy==1.2.1=py36h7c811a0_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - setuptools==41.0.1=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - torchvision==0.2.1=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
  - wheel==0.33.4=py36_0 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.11,<3.12.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']

Your python: python==3.6.8=h0371630_0

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

Please show me the version of opencv and how it was installed so that I can install it. Thank you very much.

p/s: I found 3 ways:

  1. Use conda: conda install -c conda-forge opencv
  2. pip install opencv-python
  3. from source: https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html

./img_gen.sh: line 24: ${#mol}-9: substring expression < 0

I run img_gen at bionoi/ folder. I faced the error:

colorby:
residue_type
input directory:
../../homology_reduced_mols/*/*
output directory:
../../bionoi_output/residue_type/homology_reduced_mols/*/
pop directory:
../../pop_folder/homology_reduced_mols/
profile directory:
../../profile_folder/homology_reduced_mols/

README.md alignment.py bionoi.py cmaps colorscale.py dependency example_output img_gen.sh legacy log output testfiles
./img_gen.sh: line 24: ${#mol}-9: substring expression < 0

Please help me to solve it. Thank you very much.

No such file or directory: '../../bionoi_output/residue_type/control/fold_1'

When I run python homology_reduced_cnn_cv_resnet18.py -op control_vs_nucleotide -root_dir ../../bionoi_output/residue_type/ -batch_size 32 -result_file_suffix 1st after finishing running Bionoi by executing /bionoi/img_gen.sh to transform .mol2 files to images, it threw an error:

Traceback (most recent call last):
  File "homology_reduced_cnn_cv_resnet18.py", line 766, in <module>
    num_workers=4)
  File "homology_reduced_cnn_cv_resnet18.py", line 464, in gen_loaders
    mean, std = dataset_statistics(root_dir, op)
  File "homology_reduced_cnn_cv_resnet18.py", line 486, in dataset_statistics
    dataset = BionoiDatasetCV(op=op, root_dir=data_dir, folds=[1,2,3,4,5], transform=transform)
  File "homology_reduced_cnn_cv_resnet18.py", line 376, in __init__
    self.list_of_files_list.append([os.path.join(folder_dir, name) for name in os.listdir(folder_dir) if os.path.isfile(os.path.join(folder_dir, name))])
FileNotFoundError: [Errno 2] No such file or directory: '../../bionoi_output/residue_type/control/fold_1'

Please help me to solve it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.