ChEMBL Structure Pipeline

repository·master·Indexed 42 days ago

https://github.com/chembl/chembl_structure_pipeline

A toolkit for chemical structure curation, providing standardized protocols for molecule standardization and salt stripping. Features include the `standardizer.standardize_molblock` and `standardizer.get_parent_molblock` functions for processing MolBlocks, and `checker.check_molblock` for assessing structure quality via penalty scores.

Tokens
1.1K
Snippets
4
Records
4
Agent score
4%

What's inside ChEMBL Structure Pipeline

  1. Install the ChEMBL Structure Pipeline

    master

    You can install the chembl_structure_pipeline package using pip or conda. Alternatively, you can install it from source.

    Using pip:

    pip install chembl_structure_pipeline

    Using conda:

    conda install -c conda-forge chembl_structure_pipeline

    From source:

    git clone https://github.com/chembl/ChEMBL_Structure_Pipeline.git
    pip install ./ChEMBL_Structure_Pipeline
    pip install chembl_structure_pipeline
  2. Get the parent compound using `standardizer.get_parent_molblock`

    master

    Use standardizer.get_parent_molblock to extract the parent molecule from a given MolBlock. This function returns a tuple containing the parent MolBlock and an additional object (likely metadata or status).

    from chembl_structure_pipeline import standardizer
    
    o_molblock = """
      Mrv1810 07121910262D          
    
      3  1  0  0  0  0            999 V2000
       -5.2331    1.1053    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
       -4.5186    1.5178    0.0000 N   0  3  0  0  0  0  0  0  0  0  0  0
       -2.8647    1.5789    0.0000 Cl  0  5  0  0  0  0  0  0  0  0  0  0
      1  2  1  0  0  0  0
    M  CHG  2   2   1   3  -1
    M  END
    """
    
    parent_molblock, _ = standardizer.get_parent_molblock(o_molblock)
  3. Check a compound's quality using `checker.check_molblock`

    master

    The checker.check_molblock function assesses the quality of a chemical structure. It identifies specific features or issues that may require revision. For each issue found, it returns a description and a penalty score between 0 and 9, where higher scores indicate more critical issues.

    from chembl_structure_pipeline import checker
    
    o_molblock = """ 
      Mrv1810 02151908462D           
     
      4  3  0  0  0  0            999 V2000 
        2.2321    4.4196    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0 
        3.0023    4.7153    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0 
        1.4117    4.5059    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0 
        1.9568    3.6420    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0 
      1  2  1  1  0  0  0 
      1  3  1  0  0  0  0 
      1  4  1  0  0  0  0 
    M  END 
    """
    
    issues = checker.check_molblock(o_molblock)
  4. Standardise a compound using `standardizer.standardize_molblock`

    master

    Use the standardizer.standardize_molblock function to apply ChEMBL protocols for standardising and salt stripping molecules. It accepts a MolBlock string as input and returns the standardised MolBlock string.

    from chembl_structure_pipeline import standardizer
    
    o_molblock = """
      Mrv1810 07121910172D          
    
      4  3  0  0  0  0            999 V2000
       -2.5038    0.4060    0.0000 C   0  0  3  0  0  0  0  0  0  0  0  0  0
       -2.5038    1.2310    0.0000 O   0  5  0  0  0  0  0  0  0  0  0  0
       -3.2182   -0.0065    0.0000 N   0  3  0  0  0  0  0  0  0  0  0  0
       -1.7893   -0.0065    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      1  2  1  0  0  0  0
      1  3  1  0  0  0  0
      1  4  1  4  0  0  0
    M  CHG  2   2  -1   3   1
    M  END
    """
    
    std_molblock = standardizer.standardize_molblock(o_molblock)