pKaTool/Ghosts/CSP_explicit.py
def parseCoordCharges(self, pqrFile, pdb=False):
		'''
		Parse coordinates and charges from pqr files
		'''
		try:
			fd = open(pqrFile, 'r');
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\t\tFATAL: Cannot open %s file'%pqrFile
			
		coordMol = {}
		chargeMol = {}
		for line in lines:
			record = line[:6].strip()
			if record == 'ATOM':
				chainID = parseChainID(line)
				resNum = parseResNum(line)
				atomName = parseAtomName(line)
				resName = parseResName(line)
				if pdb == False:
				    charge = parsePQRCharge(line)
				if not coordMol.has_key(chainID):
					coordMol[chainID] = {}
					chargeMol[chainID] = {}
				if not coordMol[chainID].has_key(resNum):
					coordMol[chainID][resNum] = {}
					chargeMol[chainID][resNum] = {}
				coordinates = eval(getCoordinates(line))
				coordMol[chainID][resNum][atomName] = coordinates
				if pdb == False:
				    chargeMol[chainID][resNum][atomName] = charge
				
		return coordMol, chargeMol

		Parse coordinates and charges from pqr files
		
Parse coordinates and charges from pqr files
Parse coordinates and charges from pqr files
def parseCoordCharges(self, pqrFile, pdb=False):
		try:
			fd = open(pqrFile, 'r');
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\t\tFATAL: Cannot open %s file'%pqrFile
		coordMol = {}
		chargeMol = {}
		for line in lines:
			record = line[:6].strip()
			if record == 'ATOM':
				chainID = parseChainID(line)
				resNum = parseResNum(line)
				atomName = parseAtomName(line)
				resName = parseResName(line)
				if pdb == False:
				    charge = parsePQRCharge(line)
				if not coordMol.has_key(chainID):
					coordMol[chainID] = {}
					chargeMol[chainID] = {}
				if not coordMol[chainID].has_key(resNum):
					coordMol[chainID][resNum] = {}
					chargeMol[chainID][resNum] = {}
				coordinates = eval(getCoordinates(line))
				coordMol[chainID][resNum][atomName] = coordinates
				if pdb == False:
				    chargeMol[chainID][resNum][atomName] = charge
		return coordMol, chargeMol
def parseCoordCharges ( self , pqrFile , pdb = False ) : try : fd = open ( pqrFile , 'r' ) ; lines = fd . readlines ( ) fd . close ( ) except IOError : print '\n\t\tFATAL: Cannot open %s file' % pqrFile coordMol = { } chargeMol = { } for line in lines : record = line [ : 6 ] . strip ( ) if record == 'ATOM' : chainID = parseChainID ( line ) resNum = parseResNum ( line ) atomName = parseAtomName ( line ) resName = parseResName ( line ) if pdb == False : charge = parsePQRCharge ( line ) if not coordMol . has_key ( chainID ) : coordMol [ chainID ] = { } chargeMol [ chainID ] = { } if not coordMol [ chainID ] . has_key ( resNum ) : coordMol [ chainID ] [ resNum ] = { } chargeMol [ chainID ] [ resNum ] = { } coordinates = eval ( getCoordinates ( line ) ) coordMol [ chainID ] [ resNum ] [ atomName ] = coordinates if pdb == False : chargeMol [ chainID ] [ resNum ] [ atomName ] = charge return coordMol , chargeMol
Parse coordinates and charges from pqr files
Parse coordinates and charges from pqr files
'''
		Parse coordinates and charges from pqr files
		'''
self
pqrFile
pdb