def openFilesWithoutSummary(distanceMax, directory_in): fileClass = {} listDistance = structure.listDistance(distanceMax) listStructureStudy = structure.ListSub() for distance in listDistance : fileClass[distance] = {} for struct in listStructureStudy : dir_struct = pathManage.withoutAtLeastOneSummary(directory_in) fileClass[distance][struct] = open(dir_struct + struct + "_<" + distance, "w") return fileClass
def resultResProx(stCount, distance_max, pr_result): l_p_filout = [] l_distance = structure.listDistance(distance_max) l_aa = ["HOH", "ASP", "GLU", "THR", "SER", "ASN", "GLN", "TYR", "HIS", "LYS", "ARG", "PHE", "TRP", "ALA", "ILE", "LEU", "MET", "VAL", "CYS", "GLY", "PRO"] for substruct in stCount.keys () : print substruct, "-----" print stCount[substruct] if stCount[substruct] == {} : continue p_filout = pr_result + substruct + "resCount" l_p_filout.append (p_filout) filout = open (p_filout, "w") for aa in l_aa : line_w = str (aa) for distance in l_distance : line_w = line_w + "\t" + str(stCount[substruct][distance][aa]) line_w = line_w + "\n" filout.write (line_w) filout.close () return l_p_filout