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()
def main (name_database, max_distance = 5.0, RX = 3.00, RFree = 0.25, option_superimpose = 0, option_on_complexes_by_ligand = 0, option_bond = 0, option_stat = 0, option_stat_dataset = 0, option_merge = 0, verbose = 1): #format input max_distance = float (max_distance) # run one database pr_result = pathManage.result (name_database) # search ligand in PDB searchPDB.ligands(name_database, pr_result) # dataset with resolution l_p_dataset = datasetFinal.Builder(name_database, RX, RFree, option_on_complexes_by_ligand) # ######################## # # Parsing dataset # # ######################## # # if option_stat_dataset == 1 : for p_dataset in l_p_dataset : statistic.ParseDataSet(p_dataset) # #################### # # result directory # # #################### # # # run for every dataset -> with diffrent resolution # short cut # l_p_dataset = ["/home/borrel/saltBridgesProject/result/PDB/3.0_0.25_uniquePDB/dataset_3.00.txt" ] # # # for p_dataset in l_p_dataset : pr_result = pathManage.CreatePathDir(p_dataset[:-4] + "/") pr_hetion = pathManage.CreatePathDir(p_dataset[:-4] + "/HET/") if verbose == 1 : print "== control path Main ==" print pr_result print pr_hetion print "=======================" # # stat -> build structure, not filter is !!! d_sub_neighbor = searchPDB.globalSearch(max_distance, p_dataset, pr_result) # remove iron close -> statistic before # Becarful because the dictionnary change print "control-1", len(d_sub_neighbor["I"]) d_close_het = hetCloseAnalysis.removeNeighborIron (d_sub_neighbor, pr_hetion + "ionSummarySubstruct.txt") print "control-2", len(d_sub_neighbor["I"]) if option_superimpose == 1 : # superimpose neighbors -> refaire a Helsinki car MAJ de de la PDB superimpose.globalNeighbor (d_sub_neighbor, "I", pr_result) superimpose.globalNeighbor (d_sub_neighbor, "II", pr_result) superimpose.globalNeighbor (d_sub_neighbor, "III", pr_result) superimpose.globalNeighbor (d_sub_neighbor, "IMD", pr_result) superimpose.globalNeighbor (d_sub_neighbor, "GAI", pr_result) superimpose.globalNeighbor (d_sub_neighbor, "COO", pr_result) # superimpose neighbors -> with het first stabilization # superimpose.globalNeighbor (d_close_het, "I", pr_hetion) # superimpose.globalNeighbor (d_close_het, "II", pr_hetion) # superimpose.globalNeighbor (d_close_het, "III", pr_hetion) # superimpose.globalNeighbor (d_close_het, "IMD", pr_hetion) # superimpose.globalNeighbor (d_close_het, "GAI", pr_hetion) if option_bond == 1 : # check planarity imidazole + guanidium statistic.planarityImidazole (d_sub_neighbor, pr_result) statistic.planarityGuanidium (d_sub_neighbor, pr_result) statistic.lenBondAnalysis(d_sub_neighbor, "I", pr_result) statistic.lenBondAnalysis(d_sub_neighbor, "II", pr_result) statistic.lenBondAnalysis(d_sub_neighbor, "III", pr_result) if option_stat == 1: # statistic statistic.globalRunStatistic(d_sub_neighbor, max_distance, pr_result) # statistic.globalRunStatistic(d_close_het, max_distance, pr_hetion) if option_merge == 1: if option_on_complexes_by_ligand == 1: statistic.MergeDataSet(pathManage.result (name_database + "/" + str (RX) + "_" + str (RFree) + "_uniquePDB"), "dataset_1.50", "dataset_3.00") statistic.MergeDataSet(pathManage.result (name_database + "/" + str (RX) + "_" + str (RFree) + "_uniquePDB"), "dataset_1.50", "dataset_3.00", arom = 1) else : statistic.MergeDataSet(pathManage.result (name_database + "/" + str (RX) + "_" + str (RFree)), "dataset_1.50", "dataset_3.00")