PEATSA/WebApp/JobSubmission.py
def CreateMutationString(mutationData, webStorageDirectory, jobInputDirectory, job):

	'''Creates the mutation part of the command line arguments based on the mutationData dictionary'''

	mutationType = mutationData['Type']
	mutationString = "--%s=%s"

	if mutationType == 'mutationList':
		#Write out the file to the web storage directory
		filename = os.path.join(webStorageDirectory, 'mutationList')
		stream = open(filename, 'w+')
		stream.write(mutationData['Data'].read())
		
		try:
			#Fixme - catch mutation list exception
			stream.seek(0)
			mutationList = Core.Data.mutationListFileFromStream(stream)
			job.setMutationListFile(mutationList)
			
			stream.close()
		except:	
			pass
		
		#Create the string
		#Note we must give the path to the mutationFile as it will 
		#be when the job is run
		filename = os.path.join(jobInputDirectory, 'mutationList')
		mutationString = mutationString % (mutationType, filename)
	elif mutationType == 'mutation':
		mutationString = mutationString % (mutationType, mutationData['Data'])
		job.setMutation(mutationData['Data'])

	return mutationString
Creates the mutation part of the command line arguments based on the mutationData dictionary
Creates the mutation part of the command line arguments based on the mutationData dictionary
Creates the mutation part of the command line arguments based on the mutationData dictionary
def CreateMutationString(mutationData, webStorageDirectory, jobInputDirectory, job):
	mutationType = mutationData['Type']
	mutationString = "--%s=%s"
	if mutationType == 'mutationList':
		filename = os.path.join(webStorageDirectory, 'mutationList')
		stream = open(filename, 'w+')
		stream.write(mutationData['Data'].read())
		try:
			stream.seek(0)
			mutationList = Core.Data.mutationListFileFromStream(stream)
			job.setMutationListFile(mutationList)
			stream.close()
		except:	
			pass
		filename = os.path.join(jobInputDirectory, 'mutationList')
		mutationString = mutationString % (mutationType, filename)
	elif mutationType == 'mutation':
		mutationString = mutationString % (mutationType, mutationData['Data'])
		job.setMutation(mutationData['Data'])
	return mutationString
def CreateMutationString ( mutationData , webStorageDirectory , jobInputDirectory , job ) : mutationType = mutationData [ 'Type' ] mutationString = "--%s=%s" if mutationType == 'mutationList' : filename = os . path . join ( webStorageDirectory , 'mutationList' ) stream = open ( filename , 'w+' ) stream . write ( mutationData [ 'Data' ] . read ( ) ) try : stream . seek ( 0 ) mutationList = Core . Data . mutationListFileFromStream ( stream ) job . setMutationListFile ( mutationList ) stream . close ( ) except : pass filename = os . path . join ( jobInputDirectory , 'mutationList' ) mutationString = mutationString % ( mutationType , filename ) elif mutationType == 'mutation' : mutationString = mutationString % ( mutationType , mutationData [ 'Data' ] ) job . setMutation ( mutationData [ 'Data' ] ) return mutationString
Creates the mutation part of the command line arguments based on the mutationData dictionary
Creates the mutation part of the command line arguments based on the mutationData dictionary
'''Creates the mutation part of the command line arguments based on the mutationData dictionary''' #Write out the file to the web storage directory #Fixme - catch mutation list exception #Create the string #Note we must give the path to the mutationFile as it will  #be when the job is run
mutationData
webStorageDirectory
jobInputDirectory
job