PEATSA/WebApp/Data.py
def createJob(self, pdbId, calculations=[], dataTable='Data', metadata={}, optionArgs={}, fileArgs={}):

		'''Creates a new job entry in the database.
		
		Parameters
			Calculations is a list containing one or more of 'scan', 'stability' or 'binding'.
			dataTable - The table the job will store its data sets to
		
		Returns:
			A instance of the Job class'''

		if len(calculations) is 0:
			raise Core.Exceptions.ArgumentError, 'At least one calculation must be specified'
		else:
			aDict = {'scan':'NotSelected', 'stability':'NotSelected', 'binding':'NotSelected'}
			for calculation in calculations:
				if aDict.has_key(calculation):
					aDict[calculation] = 'Selected'
					#Temporary hack
					if calculation != 'binding':
						optionArgs['--'+calculation] = ""
				else:
					raise Core.Exceptions.ArgumentError, 'Invalid calculation types requested - %s' % calculations

		#Create a unique id for the job
		jobId = UtilityFunctions.GetNewSID("PDT")
		
		#Add PDB id to metadata
		metadata['pdbId'] = pdbId

		#Create the insert SQL command 		
		dateString = UtilityFunctions.CreateDateString()
		insertQuery = self.__createInsertString__(jobId, pdbId, dateString, 
					aDict['scan'], aDict['stability'], aDict['binding'], metadata, optionArgs, fileArgs)
		
		res = self.cursor.execute(insertQuery)
		self.connection.commit()
		job = Job(jobId, self.connection, self.jobTable, dataTable=dataTable)
		
		return job
Creates a new job entry in the database.
		
		Parameters
			Calculations is a list containing one or more of 'scan', 'stability' or 'binding'.
			dataTable - The table the job will store its data sets to
		
		Returns:
			A instance of the Job class
Creates a new job entry in the database.
Creates a new job entry in the database .
def createJob(self, pdbId, calculations=[], dataTable='Data', metadata={}, optionArgs={}, fileArgs={}):
		if len(calculations) is 0:
			raise Core.Exceptions.ArgumentError, 'At least one calculation must be specified'
		else:
			aDict = {'scan':'NotSelected', 'stability':'NotSelected', 'binding':'NotSelected'}
			for calculation in calculations:
				if aDict.has_key(calculation):
					aDict[calculation] = 'Selected'
					if calculation != 'binding':
						optionArgs['--'+calculation] = ""
				else:
					raise Core.Exceptions.ArgumentError, 'Invalid calculation types requested - %s' % calculations
		jobId = UtilityFunctions.GetNewSID("PDT")
		metadata['pdbId'] = pdbId
		dateString = UtilityFunctions.CreateDateString()
		insertQuery = self.__createInsertString__(jobId, pdbId, dateString, 
					aDict['scan'], aDict['stability'], aDict['binding'], metadata, optionArgs, fileArgs)
		res = self.cursor.execute(insertQuery)
		self.connection.commit()
		job = Job(jobId, self.connection, self.jobTable, dataTable=dataTable)
		return job
def createJob ( self , pdbId , calculations = [ ] , dataTable = 'Data' , metadata = { } , optionArgs = { } , fileArgs = { } ) : if len ( calculations ) is 0 : raise Core . Exceptions . ArgumentError , 'At least one calculation must be specified' else : aDict = { 'scan' : 'NotSelected' , 'stability' : 'NotSelected' , 'binding' : 'NotSelected' } for calculation in calculations : if aDict . has_key ( calculation ) : aDict [ calculation ] = 'Selected' if calculation != 'binding' : optionArgs [ '--' + calculation ] = "" else : raise Core . Exceptions . ArgumentError , 'Invalid calculation types requested - %s' % calculations jobId = UtilityFunctions . GetNewSID ( "PDT" ) metadata [ 'pdbId' ] = pdbId dateString = UtilityFunctions . CreateDateString ( ) insertQuery = self . __createInsertString__ ( jobId , pdbId , dateString , aDict [ 'scan' ] , aDict [ 'stability' ] , aDict [ 'binding' ] , metadata , optionArgs , fileArgs ) res = self . cursor . execute ( insertQuery ) self . connection . commit ( ) job = Job ( jobId , self . connection , self . jobTable , dataTable = dataTable ) return job
Creates a new job entry in the database.
Creates a new job entry in the database .
'''Creates a new job entry in the database.
		
		Parameters
			Calculations is a list containing one or more of 'scan', 'stability' or 'binding'.
			dataTable - The table the job will store its data sets to
		
		Returns:
			A instance of the Job class''' #Temporary hack #Create a unique id for the job #Add PDB id to metadata #Create the insert SQL command 		
A instance of the Job class
A instance of the Job class
self
pdbId
calculations
dataTable
metadata
optionArgs
fileArgs