Questions tagged [chemistry]

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.

275 questions
1
vote
1 answer

On-the-fly parser/pre-generation space/time tradeoff considerations

Do the space-related benefits of using an on-the-fly parser outweigh the time-related benefits of a pre-generated lookup table? Long version: I am authoring a chemistry reference tool, and am including a feature that will automatically name…
Williham Totland
  • 28,471
  • 6
  • 52
  • 68
1
vote
0 answers

How can I calculate the Sobol sensitivities of the area under a curve in R?

I have written a fairly complex ordinary differential equation pharmacokinetic / pharmacodynamic model in R using the dMod package. I’ve converted this into equations readable by the ODEsensitivity package so I can get Sobol sensitivity indices for…
Emma Spady
  • 21
  • 4
1
vote
1 answer

Cannot import X problem. Stiff ODE solver for Oregonator Model

The error comes from attempting to import the Radau method from scipy.integrate (needed because the Oregonator model is a stiff system). I am attempting to numerically integrate the Oregonator model to show that there must be some transition point…
1
vote
2 answers

Using a stack to calculate a molecular mass

I am tasked with using a stack of integers to calculate the molecular mass of a given molecule. I was supposed to implement the IntStack class myself using an array. I was then supposed to make a class that takes a String as an input and evaluate…
BigMatt97
  • 11
  • 3
1
vote
1 answer

Using edge features for GCN in DGL

I'm trying to implement a graph convolutional network (GCN) in the Deep Graph Learning (DGL) package for Python. In many papers, edges have discrete features, and each possible value is associated with a different weight matrix or set of weight…
John Kleve
  • 499
  • 1
  • 4
  • 12
1
vote
0 answers

Im trying to convert my SmilesCode to Fingerprints. It does work, but I have problems to use the function for my SmilesCode-List

I'm trying to iterate my function over a column but it doesn't work properly. I get this error code: ArgumentError: Python argument types in rdkit.Chem.rdmolops.RDKFingerprint(NoneType, int, int, int, int, int, float, int) did not match C++…
Mr. Chang
  • 11
  • 4
1
vote
0 answers

Chemical Structures as Graph Labels in R

I want to make a plot that labels a point with the chemical structure represented by the value at that point. In the example below I have a plot of melting points which are labelled by the smiles strings of the molecules. chem_data <- c(40.5, -6.3,…
DarrenRhodes
  • 1,431
  • 2
  • 15
  • 29
1
vote
2 answers

How to extract the number of hydrogens from a chemical formula (i.e. from C18H36P1 to get the 36) using Pandas

I would like to be able to make a new column in a pandas dataframe that comprises the number of hydrogens from a chemical formula. Getting the number hydrogens from this chemical formula C18H36P1S1, would give 36. The Chemical formulas are general…
1
vote
1 answer

Peptide monoisotopic calculating using python

I'm making Calculator for Peptide monoisotopic and have some problems that I cannot solve. import re aminoacid = { "I": "C6H13NO2", "L": "C6H13NO2", "K": "C6H14N2O2", "M": "C5H11NO2S", "F": "C9H11NO2", …
1
vote
3 answers

Converting a chemical formula to its iupac name

I have a periodic table which I coded in java and i'm working on creating simple compounds (only binary compounds) and returning information about them, but I'm having trouble with turning a chemical formula into the IUPAC name. I have it setup so…
bimbob
  • 21
  • 5
1
vote
1 answer

Use biomass pyrolysis kinetics in Cantera reactor

I'm trying to use Cantera with a kinetic scheme for biomass pyrolysis to look at concentration changes over time in a batch reactor. An overview of the kinetics is shown below along with a reference to the paper. Notice that species concentrations…
wigging
  • 8,492
  • 12
  • 75
  • 117
1
vote
1 answer

Divide by zero error in scipy.optimize.curvefit

I am trying to fit three time-evolution curves with two rate constants, k1 and k2. The system of equations I am trying to solve is: A_t = A_0 * exp(-k1*t) B_t = [A_0 * k1/(k2-k1)]* exp(-k1*t) - [A_0*(k1/(k2-k1)-B_0] * exp(-k2*t) C_t = [A_0 *…
1
vote
2 answers

drawing of chemical structures -Any plugin in C# for these?

I want to represent the chemical structure drawing in my windows application. I found some softwares are available in the market like "BKChem","Metlab","ChemDraw","SMILE (Simplified molecular input line entry specification)","BioChemDraw". but…
Red Swan
  • 15,157
  • 43
  • 156
  • 238
1
vote
2 answers

Subtracting columns in two dataframes based on another column

My first dataset (MSdata1) looks like this m.z Intensity Relative Delta..ppm. RDB.equiv. Composition 301.14093 7646 100.00 -0.34 5.5 C16 H22 O4 Na 149.02331 4083458.5 23.60 -0.08 6.5 C8 H5…
Ragstock
  • 55
  • 8
1
vote
1 answer

How can I use Python to create a Stoichiometric Matrix

I'm new to Python and Pandas, so I would be really glad if someone could help me in this matter. My question is the following: If I have a .txt file with a set of reactions as strings (R1, R2...). Each reaction has compounds (A,B,C,D...) with their…
Microdot
  • 37
  • 6