Exemple #1
0
def obprop(imol, mol):
 for p in mol.GetData():
  if openbabel.toPairData(p).GetDataType() == openbabel.PairData:
    if p.GetAttribute() == 'OpenBabel Symmetry Classes':
      pass
    else:
      print str(imol) + "\t" + p.GetAttribute() + "\t" +  p.GetValue()
Exemple #2
0
def obprop(imol, mol):
    for p in mol.GetData():
        if openbabel.toPairData(p).GetDataType() == openbabel.PairData:
            if p.GetAttribute() == 'OpenBabel Symmetry Classes':
                pass
            else:
                print str(imol) + "\t" + p.GetAttribute() + "\t" + p.GetValue()
 def __setitem__(self, key, value):
     if key in self:
         pairdata = ob.toPairData(self._mol.GetData(key))
         pairdata.SetValue(str(value))
     else:
         pairdata = ob.OBPairData()
         pairdata.SetAttribute(key)
         pairdata.SetValue(str(value))
         self._mol.CloneData(pairdata)
Exemple #4
0
 def __setitem__(self, key, value):
     if key in self:
         pairdata = ob.toPairData(self._mol.GetData(key))
         pairdata.SetValue(str(value))
     else:
         pairdata = ob.OBPairData()
         pairdata.SetAttribute(key)
         pairdata.SetValue(str(value))
         self._mol.CloneData(pairdata)
Exemple #5
0
 def __setitem__(self, key, value):
     if key in self:
         pairdata = ob.toPairData(self._mol.GetData(key))
         pairdata.SetValue(str(value))
     else:
         pairdata = ob.OBPairData()
         pairdata.SetAttribute(key)
         pairdata.SetValue(str(value))
         pairdata.thisown = 0 # So that SWIG Proxy will not delete pairdata
         self._mol.SetData(pairdata)
Exemple #6
0
 def __setitem__(self, key, value):
     if key in self:
         pairdata = ob.toPairData(self._mol.GetData(key))
         pairdata.SetValue(str(value))
     else:
         pairdata = ob.OBPairData()
         pairdata.SetAttribute(key)
         pairdata.SetValue(str(value))
         pairdata.thisown = 0  # So that SWIG Proxy will not delete pairdata
         self._mol.SetData(pairdata)
 def __getitem__(self, key):
     self._testforkey(key)
     return ob.toPairData(self._mol.GetData(key)).GetValue()
 def _data(self):
     return [ob.toPairData(x) for x in self._mol.GetData() if x.GetDataType()==ob.PairData or x.GetDataType()==ob.CommentData]
Exemple #9
0
 def __getitem__(self, key):
     self._testforkey(key)
     return ob.toPairData(self._mol.GetData(key)).GetValue()
Exemple #10
0
 def _data(self):
     return [ob.toPairData(x) for x in self._mol.GetData() if x.GetDataType()==ob.PairData or x.GetDataType()==ob.CommentData]
Exemple #11
0
	def insert_bondproperties(self, obmol):
		"""loop over bonds' properties and insert them"""
		for bond in ob.OBMolBondIter(obmol):
			for p in bond.GetData():
				if ob.toPairData(p).GetDataType() == ob.PairData:
					self.db.insert_bondproperty(bond.GetBeginAtomIdx(), bond.GetEndAtomIdx(), p.GetAttribute(), p.GetValue())