/bionoi

Conversion of biomolecules to Voronoi diagrams

Primary LanguagePython

Bionoi

Conversion of biomolecules to Voronoi diagrams.

Description

bionoi constructs the voronoi diagram (VD) of protein binding site/pocket or ligand structure based on the 3D or 2D coordinate structure.

Requirements

  1. Python 3
  2. numpy 1.14+
  3. scipy 0.18+
  4. Pandas 0.19+
  5. scikit-spatial 0.12.0
  6. matplotlib 2.0.2+
  7. biopandas ; eg : pip/conda install biopandas

Getting started

  1. copy/download the code from GitHub
  2. If input is a 3D coordinate of protein/ligand, it will be projected to 2D plane
  3. Run main.py with a .mol2 file (see Examples)

File description

  • bionoi.py: main function used to convert 3-d molecule to 2-D Voronoi Diagram.

  • alignment.py: funtions used by bionoi.py to align the molecue to principle axis.

  • main.py: main function that uses bionoi.py to convert a specified mol2 file into Voronoi Diagram. See run options in help.

usage:
python main.py -mol ./mol/4v94E.mol2 -out ./imgs/ -dpi 120 -alpha 0.5 -size 256 -direction 0 -rot_angle 0 -flip 0
  • extract_mols.sh: a script that extracts .mol2 files that have the same direction from the origin .mol2 file folder.
   usage:
   ./extract_mols.sh
  • split_folder_binary_classification.py: take the folder generated by extract_mols.sh, then generate a new folder containing .mol2 files for binary classification. The new folder contains 3 sub-folders: train, val and test.
   usage:
   python split_folder_binary_classification.py -opMode control_vs_heme
   python split_folder_binary_classification.py -opMode control_vs_nucleotide
  • split_folder_cv.py: split the folder gernerated by extract_mols.sh, then gernerate a new folder containing .mol2 files to perform k-fold cross-validation for binary classification.
   usage: 
   python split_folder_cv.py -opMode control_vs_heme
   python split_folder_cv.py -opMode control_vs_nucleotide
  • img_gen.py: take the .mol2 files and generate images for each of them. User can specify options to control number of images generated for each .mol2 file:
run options:
-opMode: operation mode, specifies which classification task to generate images for.  
-proDirect: projecting direction. 0 to projecting from all 6 directions. 1, 2, 3, 4, 5 and 6 specifies 1 of the 6 directions.  
-rotAngle2D: rotating angles of generated images. 0 for all angles. 1, 2, 3, 4 correspond to 0, 90, 180, 270 degrees.    
-flip: flipping options of generated images. 0 for all options. 1,2 correspond to original and flipping up-side-down.  

See help for more info about other options.

   usage: 
   python img_gen.py -opMode control_vs_heme -proDirect 1 -rotAngle2D 1 -flip 1
  • info_gen.py: generate files for finial analysis.
   usage: 
   python info_gen.py

Examples

create a 2D image using mol2 file in 2D or 3D format.

An example of voronoi image of ATP-binding site protein pocket colored by atom types:

eg_image

chaperonin (4v94, chain E) z Contributors:

Rajiv Gandhi Govindaraj, Jeffrey Lemoine, Limeng Pu, Ye Fang, Wentao Shi and Michal Brylinski.