Code Monkey home page Code Monkey logo

ccdutils's Introduction

CodeFactor PYPi GitHub ccdutils documentation ccdutils tests

pdbeccdutils

Installation instructions

  • pdbeccdutils requires RDKit to be installed. The official RDKit documentation has installation instructions for a variety of platforms. For linux/mac OS this is most easily done using the anaconda python with commands similar to:

    conda create -n rdkit-env rdkit python=3.9
    conda activate rdkit-env
  • Once you have installed RDKit, as described above then install pdbeccdutils using pip:

    pip install pdbeccdutils

Features

  • gemmi CCD read/write.
  • Generation of 2D depictions (No image available generated if the flattening cannot be done) along with the quality check.
  • Generation of 3D conformations.
  • Fragment library search (PDBe hand currated library, ENAMINE, DSI).
  • Chemical scaffolds (Murcko scaffold, Murcko general, BRICS).
  • Lightweight implementation of parity method by Jon Tyzack.
  • RDKit molecular properties per component.
  • UniChem mapping.

TODO list

  • Add more unit/regression tests to get higher code coverage.
  • Further improvements of the documentation.

Documentation

The documentation depends on the following packages:

  • sphinx
  • sphinx_rtd_theme
  • myst-parser
  • sphinx-autodoc-typehints

Note that sphinx needs to be a part of the virtual environment, if you want to generate documentation by yourself. Otherwise it cannot pick rdkit module. sphinx_rtd_theme is a theme providing nice ReadtheDocs mobile friendly style.

  • Generate .rst files to be included as a part of the documentation. Inside the directory pdbeccdutils/doc run the following commands to generate documentation.
  • Alternatively, use the myst-parser package to get the Markdown working.

Use the following to generate initial markup files to be used by sphinx. This needs to be used when adding another sub-packages.

sphinx-apidoc -f -o /path/to/output/dir ../pdbeccdutils/

Use this to re-generate the documentation from the doc/ directory:

make html

ccdutils's People

Contributors

lpravda avatar osmart avatar otienoanyango avatar qiyuan7 avatar roshkjr avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccdutils's Issues

Invalid CIF for missing values in _pdbe_chem_comp_substructure.substructure_inchis

Recent changes (made after 11th March) to ccdutils have caused the PDBe chemical component definition CIF files for porphyrin-containing components to become unreadable by programs that use the PDBeCIF parser. Please see the comment below for a minimal test program that shows the problem.

Using HEM as an example ftp://ftp.ebi.ac.uk/pub/databases/msd/pdbechem_v2/H/HEM/HEM.cif

We have tracked down the problem to the _pdbe_chem_comp_substructure category. In HEM.cif this now reads:

loop_
_pdbe_chem_comp_substructure.comp_id
_pdbe_chem_comp_substructure.substructure_name
_pdbe_chem_comp_substructure.id
_pdbe_chem_comp_substructure.substructure_type
_pdbe_chem_comp_substructure.substructure_smiles
_pdbe_chem_comp_substructure.substructure_inchis
_pdbe_chem_comp_substructure.substructure_inchikeys
HEM MurckoScaffold S1 scaffold 'C1=CC2=[N+]3C1=Cc1ccc4n1[Fe@SP3-2]31n3c(ccc3=CC3=[N+]1C(=C4)C=C3)=C2' 'InChI=1S/C20H12N4.Fe/c1-2-14-10-16-5-6-18(23-16)12-20-8-7-19(24-20)11-17-4-3-15(22-17)9-13(1)21-14;/h1-12H;/q-2;+2' XVFTZEQSXCJEIQ-UHFFFAOYSA-N
HEM porphin-like F1 fragment C1~C~C2~C~C3~C~C~C(~C~C4~C~C~C(~C~C5~C~C~C(~C~C~1~N~2)~N~5)~N~4)~N~3 '' ''
HEM pyrrole F2 fragment 'c1cc[nH]c1' InChI=1S/C4H5N/c1-2-4-5-3-1/h1-5H KAESVJOAVNADME-UHFFFAOYSA-N

HEM.cif download 6th Feb 2023 had :

loop_
_pdbe_chem_comp_substructure.comp_id                      
_pdbe_chem_comp_substructure.substructure_name            
_pdbe_chem_comp_substructure.id                           
_pdbe_chem_comp_substructure.substructure_type            
_pdbe_chem_comp_substructure.substructure_smiles          
_pdbe_chem_comp_substructure.substructure_inchis          
_pdbe_chem_comp_substructure.substructure_inchikeys       
HEM MurckoScaffold S1 scaffold     C1=CC2=[N+]3C1=Cc1ccc4n1[Fe-2]31n3c(ccc3=CC3=[N+]1C(=C4)C=C3)=C2 InChI=1S/C20H12N4.Fe/c1-2-14-10-16-5-6-18(23-16)12-20-8-7-19(24-20)11-17-4-3-15(22-17)9-13(1)21-14;/h1-12H;/q-2;+2 XVFTZEQSXCJEIQ-UHFFFAOYSA-N
HEM   porphin-like F1 fragment C1~C~C2~C~C3~C~C~C(~C~C4~C~C~C(~C~C5~C~C~C(~C~C~1~N~2)~N~5)~N~4)~N~3                                                                                                                  .                           .
HEM        pyrrole F2 fragment                                                           c1cc[nH]c1                                                                                  InChI=1S/C4H5N/c1-2-4-5-3-1/h1-5H KAESVJOAVNADME-UHFFFAOYSA-N

The problem is in the line with substructure_name 'porphin-like' that lacks substructure_inchis. This now
uses two single quotes '' for the missing value. This is not valid CIF - missing values should be either . or ?

Deploy to PyPI on tag creation

Currently CI only runs unit tests and sphinx doc generation.

Need to upload the wheel to PyPI on release/tag creation.

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.