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

Can canonical SMILES strings be constructed for arbitrary labelled graphs?

I have been reading a few papers on canonical SMILES strings recently and to me it seems like the canonization procedure most of the time relies on adding additional chemical information into the SMILES string representation. Now I am wondering: Is…
Chris
  • 31
  • 3
1
vote
1 answer

How to fix GROMACS error 'No such moleculetype SOL'?

I'm trying to reproduce this tutorial: http://www.mdtutorials.com/gmx/lysozyme/04_ions.html but with a different protein. During the step of adding ions (using genion for ion.tpr file generation)I get the 'No such moleculetype SOL'. When I add the…
rosanna
  • 13
  • 3
1
vote
1 answer

Fixing graph scaling/visibility

I am a chemistry major so I am pretty new to python but I am writing some code that will ideally generate a plot of the energy levels of the hydrogen atom within a set of values. Technically I have succeeded (see following plot). As you can see tho…
EJA1065
  • 25
  • 3
1
vote
1 answer

How can I find the best match for a picture from a small database?

I'm trying to give an image as an imput and find the best match for that input from a small datbase of pictures (≈100 pics). The problem itself is the following: for my homework, I get assigned a series of graphs (X-ray diffraction pattern graphs,…
1
vote
1 answer

How can I tune fsolve to avoid "invalid value encountered in log"

I just want to solve pH of Ammonia solution which is mentioned here. The full equations in detail is mentioned here and here is my numeric solving: import numpy as np import scipy.optimize as optimize C = np.array([0, 0, 0.1, 0]) N = np.array([ …
auntyellow
  • 2,423
  • 2
  • 20
  • 47
1
vote
1 answer

How do I create a graph that shows the time frames or exact times of specific ions?

I'm trying to visualize my preliminary data by showcasing the specific compounds and their retention times. What I'm trying to aim for is a graph that is able to show retention times on the x-axis and Ion mass on the y-axis. Some of the ions either…
David
  • 43
  • 5
1
vote
2 answers

R nleqslv difficulties - solving for pH in an acid-base buffer

Goal Build a theoretical titration curve for the phosphoric acid buffer (1M). I provide a fully reproducible and self-contained example (of my failures ^.^). Model equations Acid-base equilibrium equations for phosphoric acid are: Model…
1
vote
1 answer

ROC curve in python for active compounds vs. decoys - is it being generated correctly?

I'm new on this, but I'd like to plot a ROC curve for a small dataset of active compounds versus decoys. I based myself on this link: ROC curve for binary classification in python In this case, this small dataset is a result of a virtual screening…
1
vote
1 answer

Is it possible to calculate with a string, when the, and the string contains keys to a dictonary

I have been looking for methods for using the value from a str input, where some of the values (of the str) are keys to a dictionary I have. And then calculate with the values the keys have. It's hard to explain, but here is the example: I have a…
1
vote
1 answer

Non-cartesian coordinate integration in SymPy

I have a function defined in elliptic coordinates. How can I symbolically integrate it in SymPy? Otherwise, do you have an example of implementation of any other non-Cartesian integration? import sympy as sym r = sym.Symbol('r') Z =…
SimpPie
  • 11
  • 1
1
vote
1 answer

Bioisosteric replacement using SMARTS (KNIME and RDKit)

I am trying to create a KNIME workflow that would accept a list of compounds and carry out bioisosteric replacements (we will use the following example here: carboxylic acid to tetrazole) automatically. NOTE: I am using the following workflow as…
1
vote
3 answers

Passed parameters/variables aren't correct

While practicing OOP with inheritance in my second class I have problems adding my parameters, as you can see I have: (self, name, tred, PM, PM2, ra, ra2). But when run the program it tells me that I can not multiply Nonetype, I print them to see…
Bopemagno
  • 15
  • 5
1
vote
2 answers

Python Visualising a Graph of Atoms - How to use xyz2graph to visualise different atomic species as different colors?

This is the .xyz file that I want to visualise using xyz2graph: 18 Atoms. File created from networkx graph by get_decomposition_calc_SRO1.py_edited_by_hand Ga 0.0 0.0 0.0 In 1.59 0.917986928012 2.583 In 0.0 0.0 5.166 Ga 1.59 0.917986928012 7.749 Ga…
hkh
  • 350
  • 1
  • 5
  • 13
1
vote
1 answer

Setting a value to a dynamically executed function in R

For lab data, measurements are normally provided with detection/reporting limits and confidence intervals. For example, I might have a measurement of Magnesium concentration in water where the minimum reporting value is 5 and I have received two…
vorpal
  • 268
  • 4
  • 17
1
vote
2 answers

Extracting one chain from MD trajectory file using MDAnalysis

I would like to extract one chain from my molecular dynamics trajectory (xtc file) using MDAnalysis. I expected it to be very simple, but an error occurred and I am not sure why I am getting it. Here is the code: import MDAnalysis as mda u =…