@@ -108,8 +108,8 @@ SireMol::AtomCharges( size=9
108108
109109.. Note ::
110110 To see the full list of properties available for a molecule, you can use the
111- ``propertyKeys () `` method on the underlying Sire molecule object, e.g.
112- ``ethanol._sire_object.propertyKeys () ``.
111+ ``property_keys () `` method on the underlying Sire molecule object, e.g.
112+ ``ethanol._sire_object.property_keys () ``.
113113
114114Editing bonds
115115-------------
@@ -122,7 +122,7 @@ constant for all existing bonds:
122122>>> bonds = TwoAtomFunctions(ethanol._sire_object.info())
123123>>> for bond in ethanol._sire_object.property(" bond" ).potentials():
124124... amber_bond = AmberBond(0 , 0 )
125- ... bonds.set(bond.atom0(), bond.atom1(), amber_bond.toExpression (Symbol(" r" )))
125+ ... bonds.set(bond.atom0(), bond.atom1(), amber_bond.to_expression (Symbol(" r" )))
126126>>> cursor = ethanol._sire_object.cursor()
127127>>> cursor[" bond" ] = bonds
128128>>> ethanol._sire_object = cursor.commit()
@@ -163,7 +163,7 @@ and modifying the desired angle:
163163>>> for angle in ethanol._sire_object.property(" angle" ).potentials():
164164... if ethanol._sire_object.atom(angle.atom1()).name().value() == " O3" :
165165... amber_angle = AmberAngle(100 , 1.5 )
166- ... angles.set(angle.atom0(), angle.atom1(), angle.atom2(), amber_angle.toExpression (Symbol(" theta" )))
166+ ... angles.set(angle.atom0(), angle.atom1(), angle.atom2(), amber_angle.to_expression (Symbol(" theta" )))
167167... else :
168168... angles.set(angle.atom0(), angle.atom1(), angle.atom2(), angle.function())
169169
@@ -247,7 +247,7 @@ A regular AMBER-style dihedral series where all terms have positive cosine facto
247247>>> d = AmberDihedral(f, Phi)
248248>>> print (" AMBER:" , d)
249249AMBER: AmberDihedral( k[0] = 0.3, periodicity[0] = 1, phase[0] = 0, k[1] = 0.8, periodicity[1] = 4, phase[1] = 0 )
250- >>> assert d.toExpression (Phi) == f
250+ >>> assert d.to_expression (Phi) == f
251251
252252An AMBER-style dihedral containing positive and negative cosine factors, which
253253can appear in the CHARMM force field:
@@ -256,7 +256,7 @@ can appear in the CHARMM force field:
256256>>> d = AmberDihedral(f, Phi)
257257>>> print (" CHARMM:" , d)
258258CHARMM: AmberDihedral( k[0] = 0.3, periodicity[0] = 1, phase[0] = 0, k[1] = -0.8, periodicity[1] = 4, phase[1] = 0 )
259- >>> assert d.toExpression (Phi) == f
259+ >>> assert d.to_expression (Phi) == f
260260
261261An AMBER-style dihedral containing positive and negative cosine factors, with
262262the negative of the form ``k [1 - Cos(Phi)] `` rather than ``-k [1 + Cos(Phi)] ``.
@@ -269,7 +269,7 @@ GROMACS: AmberDihedral( k[0] = 0.3, periodicity[0] = 1, phase[0] = 0, k[1] = 0.8
269269>>> from math import isclose
270270>>> from sire.legacy.CAS import SymbolValue, Values
271271>>> val = Values(SymbolValue(Phi.ID(), 2.0 ))
272- >>> assert isclose(f.evaluate(val), d.toExpression (Phi).evaluate(val))
272+ >>> assert isclose(f.evaluate(val), d.to_expression (Phi).evaluate(val))
273273
274274Finally, a three-term expression that mixes all formats:
275275
@@ -280,7 +280,7 @@ Finally, a three-term expression that mixes all formats:
280280... + 0.8 * (1 - Cos(4 * Phi))
281281... )
282282>>> d = AmberDihedral(f, Phi)
283- >>> assert isclose(f.evaluate(val), d.toExpression (Phi).evaluate(val))
283+ >>> assert isclose(f.evaluate(val), d.to_expression (Phi).evaluate(val))
284284
285285.. Note ::
286286 Impropers are also stored as ``FourAtomFunction `` objects, which can be
@@ -428,17 +428,17 @@ the editor, reparenting them to the appropriate chain, then adding the atoms:
428428... cg = editor.add(sr.legacy.Mol.CGName(str (i)))
429429... new_res = editor.add(res.number())
430430... new_res.rename(res.name())
431- ... new_res.reparent(chain_ids[i // 3 ] )
432- ... for j, atom in enumerate ( res.atoms() ):
431+ ... new_res.reparent(sr.legacy.Mol.ChainName( chain_ids[i]) )
432+ ... for atom in res.atoms():
433433... new_atom = cg.add(atom.number())
434434... new_atom.rename(atom.name())
435435... new_atom.reparent(res.index())
436436... editor = editor.commit().edit()
437437
438438Next we need to copy across the molecular properties, e.g. charges and bonded terms.
439439
440- >>> for prop in ala._sire_object.propertKeys ():
441- ... editor = editor.setProperty (prop, ala._sire_object.property(prop)).molecule()
440+ >>> for prop in ala._sire_object.property_keys ():
441+ ... editor = editor.set_property (prop, ala._sire_object.property(prop)).molecule()
442442
443443Finally, we can commit the changes to create the new molecule:
444444
0 commit comments