Example #1
0
            #state.addMolecule(newPABA)
            oh[0].merge(newPABA, [(oxygen, 114)])

            #neutralize total charge
            ch = oh[0].atom_attributes(oxygen).getInfo().getCharge()
            if atype == "O2":
                oh[0].atom_attributes(oxygen).getInfo().setCharge(ch -
                                                                  (-0.208801))
            else:
                oh[0].atom_attributes(oxygen).getInfo().setCharge(ch -
                                                                  (-0.208801))

    print "Force field ", oh[0].getForceField()._BONDS

    oh[0].getForceField().setBond(('C15', 'O6'), 1.42, 1)
    oh[0].getForceField().setBond(('C15', 'O6'), 428, 0)
    oh[0].getForceField().setBond(('C15', 'O2'), 1.42, 1)
    oh[0].getForceField().setBond(('C15', 'O2'), 428, 0)

    oh[0].getForceField().setAngle(('C15', 'O2', 'C2'), 131.929, 0)
    oh[0].getForceField().setAngle(('C15', 'O2', 'C2'), 78., 1)
    oh[0].getForceField().setAngle(('C15', 'O6', 'C6'), 131.929, 0)
    oh[0].getForceField().setAngle(('C15', 'O6', 'C6'), 104., 1)

    oh[0].getForceField().setAngle(('C14', 'C15', 'O6'), 113.391, 0)
    oh[0].getForceField().setAngle(('C14', 'C15', 'O6'), 40., 1)
    oh[0].getForceField().setAngle(('C14', 'C15', 'O2'), 113.391, 0)
    oh[0].getForceField().setAngle(('C14', 'C15', 'O2'), 40., 1)

    mixture.save(FileName)
Example #2
0
	def __init2__(self,n,m,q):
		super(Diamond,self).__init__(ident="Diamond")
		
		allCells = Mixture()
		allCells.loadWFM(WOLFFIA_WFY_DIR + "/diamond.wfm")
		#print allCells.moleculeNames()
		#print allCells.nodes()
		cell = allCells.getMolecule(allCells.nodes()[0])

		for x in range(n):
			for y in range(m):
				line = Molecule()
				for z in range(q):
					newCell = cell.copy()
					newCell.moveBy([x*self._CELL_WIDTH_,y*self._CELL_WIDTH_,z*self._CELL_WIDTH_])
					addAndJoin(line, newCell)
				print "Diamond __init__",x,y
				addAndJoin(self, line)
		#print allCells.enclosingBox()
'''
#==========================================================================
#==========================================================================
if __name__ == '__main__':
    d = Diamond(3, 3, 3)
    print(d.edges())
    d.writePDB("/home/jse/Desktop/Diamantito.pdb")

    m = Mixture()
    m.add(d)
    m.save("/home/jse/Desktop/Diamantito.wfm")