In [1]:
import rmgpy
from rmgpy.molecule import clar
from rmgpy.molecule.molecule import Molecule
from rmgpy.species import Species
from rmgpy.data.rmg import RMGDatabase
In [2]:
mol1 = Molecule().fromSMILES('C1=CC=C2C(C=CC3C2=CC=C2C=CC=CC=32)=C1')
mol2 = Molecule().fromSMILES('C1=CC=C2C(C=CC3C2=CC=C2C=CC=CC=32)=C1')
In [3]:
mol1
Out[3]:
In [4]:
mol1.isAromatic()
Out[4]:
In [5]:
SSSR = mol2.getSmallestSetOfSmallestRings()
SSSR
Out[5]:
In [6]:
for ring in SSSR:
indexList = zip(range(6),range(1,6) + [0])
bondList = []
bonds = ''
for index1, index2 in indexList:
bond = mol2.getBond(ring[index1],ring[index2])
bondList.append(bond)
bonds += bond.order
if bonds in ('DSDSDS', 'SDSDSD'):
print "Alternating single and double bonds!"
clar.clarTransformation(mol2,bondList)
else:
print "No alternating bonds: {0}".format(bonds)
In [7]:
mol2
Out[7]:
In [8]:
print mol2.toAdjacencyList()
In [9]:
mol2.isAromatic()
Out[9]:
In [10]:
databasePath = rmgpy.settings['database.directory']
database = RMGDatabase()
database.load(
path = databasePath,
thermoLibraries = ['PAHLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsFamilies = 'none'
)
In [11]:
thermo1 = database.thermo.estimateThermoViaGroupAdditivity(mol1)
print thermo1.getEnthalpy(300) / 1000
print thermo1.getEntropy(300)
In [12]:
thermo2 = database.thermo.estimateThermoViaGroupAdditivity(mol2)
print thermo2.getEnthalpy(300) / 1000
print thermo2.getEntropy(300)
In [13]:
spec = Species()
spec.molecule = [mol1]
spec.generateResonanceIsomers()
thermo3 = database.thermo.getThermoData(spec)
print thermo3.getEnthalpy(300) / 1000
print thermo3.getEntropy(300)
In [14]:
print thermo1.comment
In [15]:
print thermo2.comment
In [16]:
print thermo3.comment
In [17]:
spec.molecule[1]
Out[17]:
In [18]:
thermo4 = database.thermo.estimateThermoViaGroupAdditivity(spec.molecule[1])
print thermo4.getEnthalpy(300) / 1000
print thermo4.getEntropy(300)
In [19]:
print thermo4.comment
In [ ]: