Chemical Structure Generator

Overview

CSG: Chemical Structure Generator

CSG Demo

A simple Chemical Structure Generator.

Requirements

  • Python 3 (>= v3.8)
  • PyQt5 (optional; >= v5.15.0 required for graphical front-end)
  • Matplotlib (>= v3.3.1)

Install Dependencies

Change to the source directory and type the following command:

pip install -r requirements.txt

Workaround for macOS Big Sur on the Apple M1 chip

The required version of PyQt5 cannot be installed using pip on M1 MacBooks (tested on the MacBook Air) as of the time of writing. A workaround for this is as follows:

  • Make sure you have installed Homebrew.

  • Run the following commands for PyQt5 v5.15.4 running on Python 3.9 (replace versions in the command appropriately):

    brew install pyqt5
    mv /opt/homebrew/Cellar/pyqt@5/5.15.4_2/lib/python3.9/site-packages/* /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/
    
  • Install matplotlib using pip:

    pip3 install matplotlib
    
  • Run CSG:

    ./csg.py
    

Usage

Usage: csg.py [OPTION]
    Generate simple chemical structures.

Options:
    --cli           Run in the terminal
    --help,   -h    Show this help message and exit
    --version -V    Show version information and exit

License

Copyright © 2020-2021 Jithin Renji, Kannan MD, Pranav Pujar

CSG is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CSG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CSG. If not, see https://www.gnu.org/licenses/.

Comments
  • Polishing of CSG

    Polishing of CSG

    New Features:

    • matplotlib background color customization based on user preferred theme

    • 2 legends: to indicate bond order and to identify individual atoms

    • matplotlib figures are now custom-named

    • bond order now has a color scheme

    • bug fixes: Cl2O, NO, ClF3, FCl3, group 1 element bond order issues, etc... SF6 DARK SF6 LIGHT

    opened by PranavPujar 1
  • Completed geometry.db. Added functionality for atomic sizes and colors.

    Completed geometry.db. Added functionality for atomic sizes and colors.

    What's new...

    • _self._atomic_colors taken from mogli

    • Added some halogens to oxidn_states and _self._atomic_numbers.

    • get_markersize() and get_markercolor() are for passing into the color parameter c of ax.plot() while rendering.

    • Opacity values can be appended into the rgb list under get_markercolor() but seems pointless for now as it cannot make the colors deeper.

    Some other misc stuff we can do:

    • [ ] provide example compounds to the user

    • [ ] deepen the atom colors a bit (they're pretty light now for some reason)

    • [ ] annotate all atoms of the rendered compound (I have currently commented out that portion, as it gets overlapped when rendering bigger atoms

    Bugs remaining (at least those that have come to light):

    Al2O3 gets classified as AB2 type oxygen halides polyhalogen compounds (eg: ClF3) nitrogen monoxide

    opened by PranavPujar 1
  • Corrected the lone pair function.

    Corrected the lone pair function.

    just minor changes were only required. it was my dumb thing i had to change only 1 thing. N i removed bp function. bp was not showing correct value so without that itself it works..

    bugfix 
    opened by K-A-N-N-A-N 1
  • Added functions classify_geometry() and gdict_to_str()

    Added functions classify_geometry() and gdict_to_str()

    classify_geometry(): Classifies the geometry of a compound, given element_dict (like in get_elements(); see get_elements()) and number of lone pairs lp (see get_lp()).

    Example return value:
    	{'A': 1, 'B': 2, 'L': 0}
    

    gdict_to_str(): Converts a 'geometry dictionary' (like above) to string.

    Example return value:
    	(same example as above)
    	"AB2"
    

    See source for more information.

    feature 
    opened by jithin-renji 1
  • Added new function get_lp(). Also added periodic table.

    Added new function get_lp(). Also added periodic table.

    I have added the lp function but when group 8 elements like Xe is added its showing invalid so we have to figure that out.. i dont think that its the lp def cause the def starts if the input is valid only. And i have also added period table grp1,2 ,13,14...18. it included valency,valence e and all the elements. i have to add transition elements also but that needs some extra things as nothing is common. N i have not added any cmments in the program i forgot about it so ill add the comments today or i can explain it to u guys if u dont understand the nxt time we meet. n the def is kinda really long and i hav tried my max to reduce it but there were no other way. if u can reduce the size n make it easier then pls do tell.

    feature 
    opened by K-A-N-N-A-N 1
  • Added PeriodicTable class to simplify `get_lp()`

    Added PeriodicTable class to simplify `get_lp()`

    The PeriodicTable class has methods to calculate valencies, valence electrons, etc. given an initialized instance of a PeriodicTable. This has considerably reduced the length of get_lp() and has drastically improved readability.

    refactor 
    opened by jithin-renji 0
  • Add `get_elements()`

    Add `get_elements()`

    The get_elements() function takes a string as argument. This string must be a chemical formula for a compound. After processing the string, the function returns a dictionary of elements with their corresponding "numbers". For example: get_elements("H2O") will return {'H': 2, 'O': 1}

    feature 
    opened by jithin-renji 0
Releases(v0.1-alpha.3)
  • v0.1-alpha.3(Aug 29, 2020)

    CSG v0.1-alpha.3

    What's new:

    • Different colored bonds with varying thicknesses for different bond orders.
    • A legend to convey information about the different colors used.
    • The chemical structure window now shows the chemical formula and its geometry in its title. Legend
    • The chemical structure window respects the dark/light theme setting. Dark Theme Light Theme
    • UI tweaks.
    • Bug fixes.
    Source code(tar.gz)
    Source code(zip)
  • v0.1-alpha.2(Aug 23, 2020)

  • v0.1-alpha.1(Aug 23, 2020)

    CSG v0.1-alpha.1

    • CSG can now generate structures from the command-line, making PyQt5 an optional dependency (Matplotlib is still required).
    Source code(tar.gz)
    Source code(zip)
  • v0.1-alpha(Aug 22, 2020)

    CSG v0.1-alpha

    • Can generate simple chemical structures with geometries ranging from AB to AB6, and AB2L to AB5L in 3D space.
    • For now, the input compound must contain only 2 distinct elements, and must contain only 1 central atom.
    Source code(tar.gz)
    Source code(zip)
Owner
JP&K
JP&K
My notes on Data structure and Algos in golang implementation and python

My notes on DS and Algo Table of Contents Arrays LinkedList Trees Types of trees: Tree/Graph Traversal Algorithms Heap Priorty Queue Trie Graphs Graph

Chia Yong Kang 0 Feb 13, 2022
A Python library for electronic structure pre/post-processing

PyProcar PyProcar is a robust, open-source Python library used for pre- and post-processing of the electronic structure data coming from DFT calculati

Romero Group 124 Dec 7, 2022
Data Structure With Python

Data-Structure-With-Python- Python programs also include in this repo Stack A stack is a linear data structure that stores items in a Last-In/First-Ou

Sumit Nautiyal 2 Jan 9, 2022
IADS 2021-22 Algorithm and Data structure collection

A collection of algorithms and datastructures introduced during UoE's Introduction to Datastructures and Algorithms class.

Artemis Livingstone 20 Nov 7, 2022
Optimising chemical reactions using machine learning

Summit Summit is a set of tools for optimising chemical processes. We’ve started by targeting reactions. What is Summit? Currently, reaction optimisat

Sustainable Reaction Engineering Group 75 Dec 14, 2022
Pipeline for chemical image-to-text competition

BMS-Molecular-Translation Introduction This is a pipeline for Bristol-Myers Squibb – Molecular Translation by Vadim Timakin and Maksim Zhdanov. We got

Maksim Zhdanov 7 Sep 20, 2022
A central task in drug discovery is searching, screening, and organizing large chemical databases

A central task in drug discovery is searching, screening, and organizing large chemical databases. Here, we implement clustering on molecular similarity. We support multiple methods to provide a interactive exploration of chemical space.

NVIDIA Corporation 124 Jan 7, 2023
Chemical equation balancer

Chemical equation balancer Balance your chemical equations with ease! Installation $ git clone [email protected]:InCogNiTo124/chemeq.git && cd chemeq; $

Marijan Smetko 4 Nov 26, 2022
Programmatically access the physical and chemical properties of elements in modern periodic table.

API to fetch elements of the periodic table in JSON format. Uses Pandas for dumping .csv data to .json and Flask for API Integration. Deployed on "pyt

the techno hack 3 Oct 23, 2022
Systemic Evolutionary Chemical Space Exploration for Drug Discovery

SECSE SECSE: Systemic Evolutionary Chemical Space Explorer Chemical space exploration is a major task of the hit-finding process during the pursuit of

null 64 Dec 16, 2022
Interactive chemical viewer for 2D structures of small molecules

?? mols2grid mols2grid is an interactive chemical viewer for 2D structures of small molecules, based on RDKit. ➡️ Try the demo notebook on Google Cola

Cédric Bouysset 154 Dec 26, 2022
Chemical Analysis Calculator, with full solution display.

Chemicology Chemical Analysis Calculator, to solve problems efficiently by displaying whole solution. Go to releases for downloading .exe, .dmg, Linux

Muhammad Moazzam 2 Aug 6, 2022
Python-based Informatics Kit for Analysing Chemical Units

INSTALLATION Python-based Informatics Kit for the Analysis of Chemical Units Step 1: Make a conda environment: conda create -n pikachu python=3.9 cond

null 47 Dec 23, 2022
Prime Path Generator is a prime path generator used to generate prime paths.

Prime Path Generator is a prime path generator used to generate prime paths.

null 1 Nov 6, 2021
ANKIT-OS/TG-SESSION-GENERATOR-BOTbisTG-SESSION-GENERATOR-BOT a special repository. Its Is A Telegram Bot To Generate String Session

ANKIT-OS/TG-SESSION-GENERATOR-BOTbisTG-SESSION-GENERATOR-BOT a special repository. Its Is A Telegram Bot To Generate String Session

ANKIT KUMAR 1 Dec 26, 2021
QR-Generator - An awesome QR Generator to create or customize your QR's

QR Generator An awesome QR Generator to create or customize your QR's! Table of

Tristán 1 Jan 28, 2022
BTC-Generator - BTC Generator With Python

Что такое BTC-Generator? Это генератор чеков всеми любимого @BTC_BANKER_BOT Для

DoomGod 3 Aug 24, 2022
NFT Generator - A NFT Generator created using Python

NFT_Generator v1 An NFT Generator created using Python. This NFT Generation tool

null 3 Dec 2, 2022
NFT Generator: A modular NFT generator application

NFT Generator A simple passion project done with the role to learn a bit about h

null 2 Aug 30, 2022
Simple ONNX operation generator. Simple Operation Generator for ONNX.

sog4onnx Simple ONNX operation generator. Simple Operation Generator for ONNX. https://github.com/PINTO0309/simple-onnx-processing-tools Key concept V

Katsuya Hyodo 6 May 15, 2022