Comments (3)
@dgasmith, the first section (or layer) of the InChI is the empirical chemical formula and is given as:
Begin with carbon atom, then hydrogen, then all other elements in alphabetical order.
Will this work with the representation in QCFractal?
In InChI, this is always given for the neutral species so that the core parent structure of different protonation states is represented.
from cmiles.
The exact molecular formula code is:
def molecular_formula(symbols):
count = collections.Counter(x.title() for x in symbols)
ret = []
for k in sorted(count.keys()):
c = count[k]
ret.append(k)
if c > 1:
ret.append(str(c))
return "".join(ret)
>>> molecular_formula(["he", "HE"])
"He2"
from cmiles.
Addressed with #9.
Note, the molecular formula is in Hill notation. Carbon and hydrogen are listed first and then all other elements are in alphabetical order of their symbols.
from cmiles.
Related Issues (20)
- Spurious missing stereo warnings
- Fix `has_stereo_defined` for rdkit HOT 1
- Detect overdefined stereo
- conda package HOT 1
- cmiles.utils.to_canonical_label failure HOT 2
- Could get_molecule_ids() support OEMol and RDMol input?
- Standardize molecule support through openforcefield.topology.Molecule?
- Generating a QCSchema JSON from an OEMol?
- WARNING: Proton(s) added/removed
- Generating CMILES ids for an OEMol?
- Hydrogens move and stereochemistry flip when reading qcschema molecule HOT 1
- Failing tests HOT 3
- Better parsing of molecule inputs
- Ideas for future refactor
- Discrepancies in re-generated reference data HOT 1
- How to update reference files for new versions of RDKit
- RDKit 2020.09.3 changes
- OpenEye toolkits 2020.2.0 changes
- Problem when loading TorsionDrive qcmol from QCA HOT 4
- Explicit valence issue with rdkit HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmiles.