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
0
votes
1 answer

Python curve_fit creating odd corners

I'm trying to fit some data to a nernst curve, but the fitted line has odd angles that don't fit either the data or the equation. Do you know why this is? csv_file='031109twohemesplit.csv' data =…
pythonoob
  • 11
  • 2
0
votes
1 answer

Renumbering a Sequence of Numbers With Gaps using Python

I am trying to figure out how to renumber a certain file format and struggling to get it right. First, a little background may help: There is a certain file format used in computational chemistry to describe the structure of a molecule with the…
Neil
  • 1
  • 3
0
votes
1 answer

Method without arguments or parenthesis for Scipy odeint

help, please - I can't understand my own code! lol I'm fairly new at python and after many trials and errors, I got my code to work, but there is one particular part of it I don't understand. In the code below, I'm solving a fairly basic ODE through…
J Faller
  • 5
  • 1
0
votes
2 answers

graph theory - connect point in 3D space with other three nearest points (distance based)

I want to connect nodes (Atoms) with the three nearest nodes(atoms). I am doing ad1 = np.zeros((31,31)) for i in range(31): dist_i = dist_mat[i] cut_off = sorted(dist_i)[3] ad1[i, np.where((dist_i<=cut_off) & (dist_i!=0.0))] =…
WhySoSerious
  • 185
  • 1
  • 19
0
votes
1 answer

How can I return experimental or estimated chemical properties in chemspipy (chem spider)?

Someone previously asked this question, but the links in the answer no longer work/the answer was not clear to me. I have a list of 172 chemical compounds that I would like to determine properties for. I have been able to determine SOME of the…
0
votes
0 answers

How to find most relevant variables with PCA dimension reduction?

I'm new to python coding, and working on a project but stuck at coding part. I have one target variable and 23 relevant variables. My dataset is 11(simples)*23(descriptors) and one target dataset 11(simples)*1(target variable). How do I find the…
EricT
  • 1
  • 1
0
votes
0 answers

Plot in 2D a plane with 3D coordinates

So i am working in a crystallographic project and I'm in front of a problem. What i'm trying to do in this code is to plot the reciprocal space of my cristal. More importantly some specific planes of my crystal. I suppose that there are not a lot of…
Rubueno
  • 1
  • 1
0
votes
0 answers

Generating molecular descriptor with modred from list

I'm tying to build ML model for chemistry. The amount of input data is pretty large (~1M molecules), and I can't just make full list of available descriptors for each molecule. So I use a sample and run my model on it to get a list of most important…
0
votes
0 answers

Looking for R functions to access Pubchem API to query the classification browser

I am trying to look for ways to use R in accessing the classification browser in PubChem using Rest API and download bulk data at once. Can someone guide me on how to go about with this ? Thanks in advance
LearningR
  • 23
  • 3
0
votes
1 answer

How to discriminate between lines in CV2 image processing with python?

I am working on a skeletal formula image processor in python as a chemistry project. It is still in its very early stages, but I've been stumped by a problem. When I run the image processing, singular lines are counted as multiple; as multiple lines…
0
votes
1 answer

How to get parameters for DREIDING force field

I am trying to use the DREIDING force field for a polymer. How can i get the parameters for DREIDING? E.g. if i have ETHYLENE. What are the parameters for the force field? Is there any Data Bank to get them or any software?
ppp
  • 3
  • 2
0
votes
0 answers

fgets() is not waiting for an input from the console

I've written the following code for the ideal gas equation and been copying and pasting my input block from other areas of my code. When I get to debugging, the console isn't waiting for an input for the variable 'N'. When I placed an input before…
Matt C
  • 63
  • 5
0
votes
2 answers

how to get all possible combinations of strings/words with each word multiple times

I'm trying to create all possible stochiometries of chemical compounds, which essentially is combining strings/words: Let's say I have a list of elements: els=['Ba','Ti','O'] and I say the number of each element can be maximally 3 and I want all…
ramobal
  • 241
  • 2
  • 9
0
votes
1 answer

RegEx Catastrophic Backtracking

I'm trying to code a program to handle some data from some computations for me and my group of chemists. I need to be able to search through an output file that contains an excess of 100,000 lines with repeating units. I'm having trouble developing…
0
votes
1 answer

How to fit curve to bi-gaussian/skewed gaussian using LMfit

I have a bunch of code that isolates a mass spectrometry peak from a spectrum and have placed the values of the peak into two lists. Gaussian_x and gaussian_x. I now need to fit this curve, ideally using Levenberg-Marquardt or similar algorithm so…