import tool from string import lower import retrieveAtom import writePDBfile repData = repertory.datasetSerineProtease() listRep = listdir(repData) # for rep in listRep : # rep = repData + rep + "/" # managePDB.appendExtention(rep) ###to do fonction that retrieve ligands in pdb files####### ligandWithPDB = loadFile.resultLigandPDB(repertory.resultSerineProtease() + "resultLigandInPDB") listLigand = ligandWithPDB.keys() print listLigand nbLigand = len(listLigand) print nbLigand j = 0 while j < nbLigand : ligand = listLigand[j] print ligand , j pdb = ligandWithPDB[ligand][0].split("_")[2] pdb = lower(pdb) atomLigand = loadFile.ligandInPDBConnectMatrixLigand(pdb, ligand) writePDBfile.globalStruct(ligand + "_" + pdb + ".pdb", atomLigand) nbAtom = len(atomLigand)
import searchPDB import loadFile import repertory import tool searchPDB.ligands() listLigandInPDB = loadFile.resultLigandPDB(repertory.result() + "resultLigandInPDB") listLigand = listLigandInPDB.keys() nbLigand = len(listLigand) listLigandWithRibose = [] i = 0 while i < nbLigand : print listLigand[i], i ligandID = listLigand[i] listAtomLigand = loadFile.ligandInPDB(listLigandInPDB[ligandID][0], ligandID) if searchPDB.riboseFromADPRibose(listAtomLigand) == 1 : listLigandWithRibose.append(listLigand[i]) i = i + 1 fileResultRibose = open(repertory.result() + "riboseList", "w") print len(listLigandWithRibose) for ligand in listLigandWithRibose : fileResultRibose.write(ligand + "\n") fileResultRibose.close()