Commit facba872 by Mustafa Tekpinar

Improved cleanTheMess fucntion esgemme.py

parent 7f40b9ac
...@@ -286,35 +286,48 @@ def launchPred(prot,inAli,mutFile, normWeightMode, alphabet): ...@@ -286,35 +286,48 @@ def launchPred(prot,inAli,mutFile, normWeightMode, alphabet):
# Remove temporary files # Remove temporary files
def cleanTheMess(prot,bFile,fFile, chainID): def cleanTheMess(prot,bFile,fFile, chainID):
if bFile!='': if bFile!='':
if bFile!=prot+"_"+chainID+".psiblast": if bFile!=prot+"_"+chainID+".psiblast":
os.remove(prot+"_"+chainID+".psiblast") os.remove(prot+"_"+chainID+".psiblast")
else: else:
if os.path.isfile(prot+"/"+prot+"_"+chainID+".psiblast"): if os.path.isfile(prot+"/"+prot+"_"+chainID+".psiblast"):
os.rename(prot+"/"+prot+"_"+chainID+".psiblast",prot+"_"+chainID+".psiblast") os.rename(prot+"/"+prot+"_"+chainID+".psiblast",prot+"_"+chainID+".psiblast")
if fFile!='': if fFile!='':
if fFile!=prot+"_"+chainID+".fasta": if fFile!=prot+"_"+chainID+".fasta":
if os.path.isfile(prot+"_"+chainID+".fasta"): if os.path.isfile(prot+"_"+chainID+".fasta"):
os.remove(prot+"_"+chainID+".fasta") os.remove(prot+"_"+chainID+".fasta")
# if os.path.isfile(prot+"/"+prot+"_jet.res"): if os.path.isfile(prot+"_jet.res"):
# os.rename(prot+"/"+prot+"_jet.res",prot+"_jet.res") os.remove(prot+"_jet.res")
# os.remove(prot+".pdb") if os.path.isfile(prot+".pdb"):
os.remove(prot+".pdb")
# Get all files with suffix nwk # Get all files with suffix nwk
treefiles = glob.glob('*.nwk') treefiles = glob.glob('*.nwk')
# Iterate over the list of files and remove individually # Iterate over the list of files and remove individually
for file in treefiles: for file in treefiles:
os.remove(file) os.remove(file)
dir_name = prot+"/" dir_name = prot+"/"
if os.path.isdir(dir_name): if os.path.isdir(dir_name):
for f in os.listdir(dir_name): for f in os.listdir(dir_name):
f_path = os.path.join(dir_name, f) f_path = os.path.join(dir_name, f)
if os.path.isfile(f_path): if os.path.isfile(f_path):
os.remove(f_path) os.remove(f_path)
os.rmdir(dir_name) os.rmdir(dir_name)
if os.path.isfile("bin1.fasta"):
os.remove("bin1.fasta")
os.remove("bin2.fasta")
os.remove("bin3.fasta")
os.remove("bin4.fasta")
if os.path.isfile("caracTest.dat"):
os.remove("caracTest.dat")
if os.path.isfile("default.conf"):
os.remove("default.conf")
############################################################################### ###############################################################################
def rankSortProteinData(dataArray, inverted=True): def rankSortProteinData(dataArray, inverted=True):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment