Skip to content
/ rdkit Public
forked from rdkit/rdkit

The official sources for the RDKit library - reading HIN format

License

Notifications You must be signed in to change notification settings

Aksonik/rdkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7,539 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDKit

Branch: reading-HIN-format

It has an additional function to read a molecule written in a HIN format.
It is coded in a similar way as Chem.rdmolfiles.MolFromPDBFile to read PDB file.

import rdkit
print(rdkit.version)

from rdkit import Chem
from rdkit.Chem import Descriptors

mol=Chem.rdmolfiles.MolFromHINFile("Ethane.hin")
mass=Descriptors.MolWt(mol)
print(mass)

print(mol.GetNumAtoms())

for conf in mol.GetConformers():
print(conf.GetPositions())

distMat = Chem.Get3DDistanceMatrix(supplHIN)
print(distMat[0,2])

for atom in mol.GetAtoms():
atom_charge = atom.GetFormalCharge()
print("Atom (symbol, atomic numer, valence(imp), valence(exp), charge:",atom.GetSymbol(),atom.GetAtomicNum(),atom.GetImplicitValence(),atom.GetExplicitValence(),atom_charge)
print("Neighbors:",[x.GetAtomicNum() for x in atom.GetNeighbors()])

print("Number of bonds:",mol.GetNumBonds())

for bond in mol.GetBonds():
aid1=bond.GetBeginAtomIdx()
aid2=bond.GetEndAtomIdx()

atom=mol.GetAtomWithIdx(aid1)
aid1_symbol=atom.GetSymbol()

atom=mol.GetAtomWithIdx(aid2)
aid2_symbol=atom.GetSymbol()

About

The official sources for the RDKit library - reading HIN format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 64.9%
  • C++ 23.1%
  • Python 6.1%
  • C 2.5%
  • CMake 1.1%
  • Jupyter Notebook 0.8%
  • Other 1.5%