For programming questions that involve chemistry - such as questions about programmatically working with chemical formulae, simulating chemical processes, or using chemistry-related libraries and APIs. Non-programming questions about chemistry are off-topic here, but may be on-topic on chemistry.stackexchange.com.
Questions tagged [chemistry]
275 questions
2
votes
2 answers
Marking signs denoting chemical bonds for assistive technologies
I sometimes have different chemical formulae in text, while there is no problem with formulae like H2SO4 (because it is read in the same way, both by people without visual impairments and by people using screen readers), the problem starts when by…

Piotr Skolimowski
- 23
- 3
2
votes
2 answers
How to separate a list of molecules based on how many hydrogens are attached to a certain atom?
I have alkene molecules of formula C9H17B. How can I separate these molecules into three classes, one being the class that has C-B-H2, one that has C2-B-H and one that has C3-B. How would I do this? I've tried using smiles and also as mol but my…

BanAckerman
- 103
- 1
- 8
2
votes
1 answer
How to save rdkit DrawMorganBit output as image?
code:
import numpy as np
from rdkit import Chem
from rdkit.Chem import Draw, AllChem, PandasTools, DataStructs
mol = Chem.MolFromSmiles('O=C1N([C@@H](C)C2CC2)CC3=CC(C4=C(C)N=C(NC(C)=O)S4)=CC(S(=O)(C)=O)=C31')
bi = {}
fp =…

Park
- 27
- 6
2
votes
2 answers
Have I applied the Fourier Transformation correctly to this Dataframe? [EXAFS X-Ray Absorption Dataframe]
I have a dataset with a signal and a 1/distance (Angstrom^-1) column.
This is the dataset (fourier.csv): https://pastebin.com/ucFekzc6
After applying these steps:
import pandas as pd
import numpy as np
from numpy.fft import fft
df = pd.read_csv…

QuantumRain
- 57
- 6
2
votes
1 answer
RdKit Coordinates for atoms in a molecule
Hey everyone I need some help formatting coordinates for atoms in a molecule and I'm coding with Python. What I am needing is along the lines of:
(atom) x y z coordinates
For every atom in the molecule. So far my code is:
for molecule in mol_list:
…

samusmaster210
- 21
- 1
- 3
2
votes
0 answers
XeLaTeX setup with fontspec in matplotlib
I am preparing figures for a manuscript where I would like to have precise control over the font used for each level of text. Specifically, I want to use different weights for e.g. tick labels and the figure titles. To do this, I am using the pgf…

ARGratrex
- 73
- 5
2
votes
1 answer
RDKit: "TypeError: 'Mol' object is not iterable" when attempting looped enumeration
I am trying to use RDKit to enumerate large libraries of compounds and output the result as a single column of SMILES strings in a CSV file. I was able to use the following code successfully:
import os
os.chdir('xxx')
from rdkit import Chem
from…

SPlamondonVtx
- 23
- 5
2
votes
0 answers
2D structure of molecule: view.molecule.2d error
library(rcdk)
m1 <- parse.smiles('C1CCCC1(C)C')[[1]]
m2 <- parse.smiles('C1CCC(C)CC1')[[1]]
## MCS depends on ordering of input ?!
mcs12 <- get.mcs(m1,m2)
mcs21 <- get.mcs(m2,m1)
view.molecule.2d(c(m1, m2, mcs12, mcs21))
I am getting…

vs140580
- 41
- 2
2
votes
1 answer
Obtaining Radial Distribution Functions using MDAnalysis
I am running a simple benzene simulation in GROMOS54a7.
I want to calculate the RDF of the center of masses of each benzene molecule, using MDAnalysis 1.0.0.
Is this possible? I have create the rdf for the C molecules g_cc(r) using the following…

megamence
- 335
- 2
- 10
2
votes
1 answer
Generating conformers of small ligands but preserving correct aromaticity
I'm trying to generate conformers for a number of small-molecule ligands to eventually do docking with. I generated the conformers using RDkit's EmbedMultipleConfs function. However, when subsequently visually inspecting the conformers in PyMol I…

user21398
- 419
- 6
- 13
2
votes
1 answer
How can I determine the number of paraffinic CH3, CH2 and CH groups for any molecule with rdkit in Python?
I am trying to determine the number of paraffinic groups in any molecule using the rdkit package in Python. Initially I start to determine paraffinic CH3 groups, which I have to extend to paraffinic CH2, and paraffinic CH groups.
In the MWE, I am…

Tom Kurushingal
- 6,086
- 20
- 54
- 86
2
votes
1 answer
Hopf Bifurcation Plot
I am attempting to code a bifurcation diagram to illustrate the values of f for which the Oregonator model yields oscillatory behaviour. I get the "setting an array element with a sequence" error at the solve_ivp line. I suspect it has something to…

AlphaArgonian
- 61
- 1
- 7
2
votes
2 answers
Interactive periodic table with Tkinter & python
I have been trying to make an interactive periodic table using Tkinter & python3. However, on running the code, I don't get any output except a blank tkinter window. Can anyone point in the code attached below about why don't the buttons get…

Henry V
- 29
- 2
2
votes
1 answer
On finding chirality using RDKit
In the paper: "Graph Networks as a Universal Machine Learning
Framework for Molecules and Crystals", authors introduce chirality as an atom feature input to analyze QM9 dataset. I was trying to recreate this atom feature as following
Chirality:…

Blade
- 984
- 3
- 12
- 34
2
votes
1 answer
Solving non linear equations: add constraints to Gibbs free energy problem
I'm trying to solve a non linear system that will minimize the Gibbs free energy using the Lagrange method, with the exponential formulation.
The equations already have the Lagrangians in the exponential form Y1...Y6 that are later converted to the…

Thales Almeida
- 57
- 5