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
1
vote
2 answers
Accessing output of RDKIT Chem.FindAllSubgraphsOfLengthN(mol,n)
I am attempting to use RDKIT Chem.FindAllSubgraphsOfLengthN(mol,n) function but am unable to callout the information from using this function. It runs, but I am unable to obtain the substructures.
Does anyone have suggestions on successfully calling…

meadeytabeedy
- 31
- 3
1
vote
1 answer
PDE system with variables of different dimensions - Porous electrode theory with FiPy
I'm trying to solve a system of four PDEs describing steady-state charge conservation in a porous electrode. The equations are
∇ ⋅1 + ∇ ⋅ 2 = 0,
1 = − ∇1,
2 = − ∇2,
∇ ⋅ 1 = rxn, or alternatively ∇ ⋅ 2 = -rxn.
I want to use FiPy to solve these…

jso
- 23
- 5
1
vote
1 answer
Clustering a pairwise distance matrix
So assuming I have a precomputed distance matrix
1 2 3 4 5
1 0.000 1.154 1.235 1.297 0.960
2 1.154 0.000 0.932 0.929 0.988
3 1.235 0.932 0.000 0.727 1.244
4 1.297 0.929 0.727 …

Philipp O.
- 41
- 1
- 4
1
vote
1 answer
MALDI graph: need help labeling the local maxima
This following code works fine, but I am not able to label on the peak of the signficant columns. I am trying to label the x value of the tallest columsns in each cluster of columns. The peaks that I would like labeled here are the ones at: 630,…

mudeer445589
- 13
- 4
1
vote
1 answer
How to do a programmatically fuzzy search on pubchem using compound names
When I manually searched the pubchem web page using the keyword "1-(2-Hydroxyphenyl)-2-phenyl ethanone", I got the following results.
Although no compounds exactly matched the above keywords, four compounds were found that partially matched the…

arron
- 73
- 5
1
vote
1 answer
RDKit: Atom Indices to *.mol file
Question: How to convert atom indices into mol file?
Goal: Convert shortest path between atoms into mol file.
I have an initial mol file and am analyzing it using RDKit. I am getting the shortest path between two atoms using their indices. Example…

meadeytabeedy
- 31
- 3
1
vote
2 answers
Python function about chemical formulas
I have a CSV file that contains chemical matter names and some info.What I need to do is add new columns and write their formulas, molecular weights and count H,C,N,O,S atom numbers in each formula.I am stuck with the counting atom numbers part.I…

sabina aliyeva
- 33
- 4
1
vote
0 answers
Python 1d Fourier Transform in wavenumber domain?
I'd like to do 1d fft on my 2d spectrum (i.e. fft along time axis at y=101,102 ... 399,400)
The one of fft spectrum (simply by 'np.fft.fft(signal) / len(signal)') shows x axis maybe in Hz.
But my time axis is fs scale (10^-15 s).
Can I use fs…

jin
- 11
- 1
1
vote
1 answer
How to plot a titration curve in R?
I would like to plot a smooth titration curve with empirical values in R. Unfortunately, I was not able to calculate the point of inflection of the curve where the equivalence point is located.
Do you have any ideas on how I can do…

Rolu Rostl
- 11
- 2
1
vote
2 answers
Extract compound data from SDF file using IDNUMBER and write to a new file
I'm still quite new to awk and have been trying to use a bash script and awk to filter a file according to a list of codes in a separate text file. While there are a few similar questions around, I have been unable to adapt their implementations.
My…

protein_fashion
- 13
- 3
1
vote
1 answer
How can I use this code to plot a sigma profile
I'm currently working on a project that requires using the following python code to plot a sigma profile
"""
A small script that shows how to extract and plot the
NHB, OH, OT portions of the sigma profiles
A part of usnistgov/COSMOSAC
"""
import…

k95g
- 11
- 1
1
vote
1 answer
How do you encode the difference between atom charge and bond type in NetworkX so that they play a role in Graph Edit Distance?
TLDR: How do you use node_match attributes to get NetworkX to recognise C+ and C atoms as different?
Here is an example of a pair of molecules I have calculated GED for.
I got a value of 0 for the GED using the following code:
import networkx as…

BanAckerman
- 103
- 1
- 8
1
vote
2 answers
Align Molecules in chemfig
I want to align the reaction equation to the black line shown in the picture.
\documentclass[11pt,a4paper,oneside]{scrartcl}
\usepackage{chemfig}
\begin{document}
\begin{figure}
\begin{center}
\schemestart
…

TheChemist
- 63
- 1
- 4
1
vote
2 answers
Convert a SMILES dataset to graph
My idea would be to create a VAE or a GAN capable of generating new drugs, using graphs as representations for my molecules. Now I’m asking the real question:
I started the project with a simple Pandas dataframe made up of SMILES strings and various…

Gianmarco Luchetti
- 131
- 7
1
vote
1 answer
Is it possible to model the Universe in an object oriented manner from the subatomic level upwards?
While I'm certain this must have been tried before, I cant seem to find any examples of this concept being done myself.
What I'm describing goes off of the idea that effectively you could model all "things" which are as objects. From their you can…

Cordyceps12
- 11
- 1