PEATSA/WebApp/JobSubmission.py
def ProcessPDBFilename(filename):

	'''Processes the input string to be of the form "PDBID.pdb"
	
	This is done in the following way:
	- filename is split into base + extension
	- Trailing whitespace and underlines are removed
	- All punctuation (except for underlines) is removed
	- All spaces are replaces with underlines
	- The base is lower-cased and appended with .pdb
	
	If the file does not have the '.pdb' extension (in any mixture of cases)
	an empty string is returned'''
		
	filename = os.path.basename(filename)	
	extension = os.path.splitext(filename)[1]
	if extension.lower() != ".pdb":
		return ""
		
	pdbId = os.path.splitext(filename)[0]
	
	#Strip stuff
	pdbId = pdbId.strip()
	pdbId = pdbId.strip("_")
	
	#Replace underlines with spaces
	#This is so these aren't removed in the next step
	pdbId = pdbId.replace("_", " ")
	
	#Remove all punctuation characters
	for character in string.punctuation:
		pdbId = pdbId.replace(character, "")
	
	#Put the underlines back - this also replaces any
	#preexisting spaces with underlines
	pdbId = pdbId.replace(" ", "_")
	
	pdbId = pdbId.lower()
	return pdbId + '.pdb'
Processes the input string to be of the form "PDBID.pdb"
	
	This is done in the following way:
	- filename is split into base + extension
	- Trailing whitespace and underlines are removed
	- All punctuation (except for underlines) is removed
	- All spaces are replaces with underlines
	- The base is lower-cased and appended with .pdb
	
	If the file does not have the '.pdb' extension (in any mixture of cases)
	an empty string is returned
Processes the input string to be of the form "PDBID.pdb"
This is done in the following way:
filename is split into base + extension
Trailing whitespace and underlines are removed
All punctuation (except for underlines) is removed
All spaces are replaces with underlines
The base is lower-cased and appended with .pdb

If the file does not have the '.pdb' extension (in any mixture of cases)
an empty string is returned
Processes the input string to be of the form " PDBID . pdb " This is done in the following way : filename is split into base + extension Trailing whitespace and underlines are removed All punctuation ( except for underlines ) is removed All spaces are replaces with underlines The base is lower - cased and appended with . pdb If the file does not have the ' . pdb ' extension ( in any mixture of cases ) an empty string is returned
def ProcessPDBFilename(filename):
	filename = os.path.basename(filename)	
	extension = os.path.splitext(filename)[1]
	if extension.lower() != ".pdb":
		return ""
	pdbId = os.path.splitext(filename)[0]
	pdbId = pdbId.strip()
	pdbId = pdbId.strip("_")
	pdbId = pdbId.replace("_", " ")
	for character in string.punctuation:
		pdbId = pdbId.replace(character, "")
	pdbId = pdbId.replace(" ", "_")
	pdbId = pdbId.lower()
	return pdbId + '.pdb'
def ProcessPDBFilename ( filename ) : filename = os . path . basename ( filename ) extension = os . path . splitext ( filename ) [ 1 ] if extension . lower ( ) != ".pdb" : return "" pdbId = os . path . splitext ( filename ) [ 0 ] pdbId = pdbId . strip ( ) pdbId = pdbId . strip ( "_" ) pdbId = pdbId . replace ( "_" , " " ) for character in string . punctuation : pdbId = pdbId . replace ( character , "" ) pdbId = pdbId . replace ( " " , "_" ) pdbId = pdbId . lower ( ) return pdbId + '.pdb'
Processes the input string to be of the form "PDBID.pdb"
This is done in the following way:
 filename is split into base + extension
 Trailing whitespace and underlines are removed
 All punctuation (except for underlines) is removed
 All spaces are replaces with underlines
 The base is lower-cased and appended with .pdb
Processes the input string to be of the form " PDBID . pdb " This is done in the following way : filename is split into base + extension Trailing whitespace and underlines are removed All punctuation ( except for underlines ) is removed All spaces are replaces with underlines The base is lower - cased and appended with . pdb
'''Processes the input string to be of the form "PDBID.pdb"
	
	This is done in the following way:
	- filename is split into base + extension
	- Trailing whitespace and underlines are removed
	- All punctuation (except for underlines) is removed
	- All spaces are replaces with underlines
	- The base is lower-cased and appended with .pdb
	
	If the file does not have the '.pdb' extension (in any mixture of cases)
	an empty string is returned''' #Strip stuff #Replace underlines with spaces #This is so these aren't removed in the next step #Remove all punctuation characters #Put the underlines back - this also replaces any #preexisting spaces with underlines
filename