pKaTool/Ghosts/Chemical_shift_md.py
def parseCharges(self):
		'''
		Parse charges from the topology file
		'''
		try:
			fd = open(self.top, 'r');
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\t\tFATAL: Cannot open %s file'%self.top
			sys.exit(1)
		chargeDict = {}
		for lineNum in range(len(lines)):
			if lines[lineNum].strip() == '[ atoms ]':
				for lineNum1 in range(lineNum+2, len(lines)):
					if lines[lineNum1].strip() == '':
						break
					line = lines[lineNum1].strip()
					resNum = int(line.split()[2])
					atomName = line.split()[4]
					if atomName in conversionvHv3v2:
						atomName = conversionvHv3v2[atomName]
					chargeValue = float(line.split()[6])
					if not resNum in chargeDict.keys():
						chargeDict[resNum] = {}
					chargeDict[resNum][atomName] = chargeValue
		
		return chargeDict

		Parse charges from the topology file
		
Parse charges from the topology file
Parse charges from the topology file
def parseCharges(self):
		try:
			fd = open(self.top, 'r');
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\t\tFATAL: Cannot open %s file'%self.top
			sys.exit(1)
		chargeDict = {}
		for lineNum in range(len(lines)):
			if lines[lineNum].strip() == '[ atoms ]':
				for lineNum1 in range(lineNum+2, len(lines)):
					if lines[lineNum1].strip() == '':
						break
					line = lines[lineNum1].strip()
					resNum = int(line.split()[2])
					atomName = line.split()[4]
					if atomName in conversionvHv3v2:
						atomName = conversionvHv3v2[atomName]
					chargeValue = float(line.split()[6])
					if not resNum in chargeDict.keys():
						chargeDict[resNum] = {}
					chargeDict[resNum][atomName] = chargeValue
		return chargeDict
def parseCharges ( self ) : try : fd = open ( self . top , 'r' ) ; lines = fd . readlines ( ) fd . close ( ) except IOError : print '\n\t\tFATAL: Cannot open %s file' % self . top sys . exit ( 1 ) chargeDict = { } for lineNum in range ( len ( lines ) ) : if lines [ lineNum ] . strip ( ) == '[ atoms ]' : for lineNum1 in range ( lineNum + 2 , len ( lines ) ) : if lines [ lineNum1 ] . strip ( ) == '' : break line = lines [ lineNum1 ] . strip ( ) resNum = int ( line . split ( ) [ 2 ] ) atomName = line . split ( ) [ 4 ] if atomName in conversionvHv3v2 : atomName = conversionvHv3v2 [ atomName ] chargeValue = float ( line . split ( ) [ 6 ] ) if not resNum in chargeDict . keys ( ) : chargeDict [ resNum ] = { } chargeDict [ resNum ] [ atomName ] = chargeValue return chargeDict
Parse charges from the topology file
Parse charges from the topology file
'''
		Parse charges from the topology file
		'''
self