GlobalChem: Your Chemical Knowledge Graph
  • Welcome to the GlobalChem Documentation!
  • Quick Start
  • Extensions
  • API
    • GlobalChem
    • Graph Algorithm
  • Mother Nature
    • Mother Nature Commands
    • Discord Roles
  • Cheminformatics
    • SMILES Validation
    • Decoding Fingeringprints and SMILES to IUPAC
    • SMILES to PDF And Back
    • Drug Design Filters
    • Deep Layer Scatter
    • Identifier SMARTS
    • Protonating SMILES
    • Sunbursting SMILES
    • Visualizing SMARTS
    • One-Hot Encoding SMILES
    • Principal Component Analysis SMILES
    • GlobalChem Graph to Networkx Graph
    • Amino Acid Sequence to SMILES
    • Scaffold Graph Adapter
  • Bioinformatics
    • GlobalChem Protein
    • GlobalChem RNA
    • GlobalChem DNA
    • GlobalChem Bacteria
    • GlobalChem Monoclonal Antibody
  • Quantum Chemistry
    • Z-Matrix Store
    • Psi4Parser & Orbital Visualizer
  • ForceFields
    • GlobalChem Molecule
    • CGenFF Molecule
    • GAFF2 Molecule
    • CGenFF Dissimilarity Score
  • Development Operations
    • Open Source Database Monitor
  • Graphing Templates
    • Plotly
Powered by GitBook
On this page
  1. Cheminformatics

Visualizing SMARTS

PreviousSunbursting SMILESNextOne-Hot Encoding SMILES

Last updated 3 years ago

This mainly comes from the REST service provided by the SMARTS plus group at the University of Hamburg:

Imports

from global_chem_extensions import GlobalChemExtensions

cheminformatics = GlobalChemExtensions().cheminformatics()

Visualize the SMILES

molecule = cheminformatics.visualize_smarts(
'[#6]-[#7]1-[#6](-[#6]=[#6]-[#6]-1=[#8])=[#8]'
)

molecule

Algorithm

The code is pretty simple using the base url and passing in the SMARTs string:

 self.base_url = "https://smarts.plus/smartsview/download_rest?"
 self.url = self.base_url + f"smarts={self.smarts_pattern}"

To run the code:

from global_chem_extensions import GlobalChemExtensions

molecule = GlobalChemExtensions.visualize_smarts(
'[#6]-[#7]1-[#6](-[#6]=[#6]-[#6]-1=[#8])=[#8]'
)

molecule

From here we can analyze different parts of the SMARTs string and test different things out.

The breakdown of the string:

SMARTS.plus
Logo