pKaTool/Ghosts/Chemical_shift.py
def whatIF(self):
		'''
		Run what if on the original pdb file
		'''
		try:
			import WHAT_IF
		except ImportError:
			import pKarun.WHAT_IF as WHAT_IF
		
		self.dirName = os.getcwd()
		os.chdir(self.tmpDirName)
		
		X = WHAT_IF.Whatif()
		X.RedirectOutput('whatif.log')
		command = 'GETMOL %s\n \n %%DELWAT\n %%DELLIG\n %%CORALL\n N\n %%MAKMOL\n'%self.pdb
		command += '\n %s\n Y\n TOT 0\n \n STOP\n Y\n'%self.pdbPath
		X.Run(command, 'WI.log')
		#
		#change all GLU and ASP to be in the neutral form
		#
		try:
			fd = open(self.pdbPath, 'r')
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\tFATAL: Cannot open %s file'%pdbCha 
			sys.exit(1)
		linesOutput = []
		for line in lines:
			record = line[:6].strip()
			if record == 'ATOM':
				atomName = parseAtomName(line)
				#convert H names
				if conversionH.has_key(atomName):
					line = line[:12] + conversionH[atomName] + line[16:]
				group = getTitGroupID(line)
				#change resName for the provided titGroupSpan
				name = getResName(group)
				if cha2neuAcid.has_key(name):
					line = line[:17] + cha2neuAcid[name] + line[20:]
			linesOutput += [line]
		
		fd = open(self.pdbPath ,'w')
		fd.writelines(linesOutput)
		fd.close()
		return

		Run what if on the original pdb file
		
Run what if on the original pdb file
Run what if on the original pdb file
def whatIF(self):
		try:
			import WHAT_IF
		except ImportError:
			import pKarun.WHAT_IF as WHAT_IF
		self.dirName = os.getcwd()
		os.chdir(self.tmpDirName)
		X = WHAT_IF.Whatif()
		X.RedirectOutput('whatif.log')
		command = 'GETMOL %s\n \n %%DELWAT\n %%DELLIG\n %%CORALL\n N\n %%MAKMOL\n'%self.pdb
		command += '\n %s\n Y\n TOT 0\n \n STOP\n Y\n'%self.pdbPath
		X.Run(command, 'WI.log')
		change all GLU and ASP to be in the neutral form
		try:
			fd = open(self.pdbPath, 'r')
			lines = fd.readlines()
			fd.close()
		except IOError:
			print '\n\tFATAL: Cannot open %s file'%pdbCha 
			sys.exit(1)
		linesOutput = []
		for line in lines:
			record = line[:6].strip()
			if record == 'ATOM':
				atomName = parseAtomName(line)
				convert H names
				if conversionH.has_key(atomName):
					line = line[:12] + conversionH[atomName] + line[16:]
				group = getTitGroupID(line)
				change resName for the provided titGroupSpan
				name = getResName(group)
				if cha2neuAcid.has_key(name):
					line = line[:17] + cha2neuAcid[name] + line[20:]
			linesOutput += [line]
		fd = open(self.pdbPath ,'w')
		fd.writelines(linesOutput)
		fd.close()
		return
def whatIF ( self ) : try : import WHAT_IF except ImportError : import pKarun . WHAT_IF as WHAT_IF self . dirName = os . getcwd ( ) os . chdir ( self . tmpDirName ) X = WHAT_IF . Whatif ( ) X . RedirectOutput ( 'whatif.log' ) command = 'GETMOL %s\n \n %%DELWAT\n %%DELLIG\n %%CORALL\n N\n %%MAKMOL\n' % self . pdb command += '\n %s\n Y\n TOT 0\n \n STOP\n Y\n' % self . pdbPath X . Run ( command , 'WI.log' ) try : fd = open ( self . pdbPath , 'r' ) lines = fd . readlines ( ) fd . close ( ) except IOError : print '\n\tFATAL: Cannot open %s file' % pdbCha sys . exit ( 1 ) linesOutput = [ ] for line in lines : record = line [ : 6 ] . strip ( ) if record == 'ATOM' : atomName = parseAtomName ( line ) if conversionH . has_key ( atomName ) : line = line [ : 12 ] + conversionH [ atomName ] + line [ 16 : ] group = getTitGroupID ( line ) name = getResName ( group ) if cha2neuAcid . has_key ( name ) : line = line [ : 17 ] + cha2neuAcid [ name ] + line [ 20 : ] linesOutput += [ line ] fd = open ( self . pdbPath , 'w' ) fd . writelines ( linesOutput ) fd . close ( ) return
Run what if on the original pdb file
Run what if on the original pdb file
'''
		Run what if on the original pdb file
		''' # #change all GLU and ASP to be in the neutral form # #convert H names #change resName for the provided titGroupSpan
self