comparison shm_csr.py @ 26:ce25fb581ca3 draft

Uploaded
author davidvanzessen
date Mon, 05 Dec 2016 11:00:13 -0500
parents b95fa7e426c3
children ca2512e1e3ab
comparison
equal deleted inserted replaced
25:8d1c4c75f81b 26:ce25fb581ca3
83 AALength = (int(max(mutationList, key=lambda i: int(i[4]) if i[4] else 0)[4]) + 1) # [4] is the position of the AA mutation, None if silent 83 AALength = (int(max(mutationList, key=lambda i: int(i[4]) if i[4] else 0)[4]) + 1) # [4] is the position of the AA mutation, None if silent
84 if AALength < 60: 84 if AALength < 60:
85 AALength = 64 85 AALength = 64
86 86
87 AA_mutation = [0] * AALength 87 AA_mutation = [0] * AALength
88 AA_mutation_dic = {"IGA": AA_mutation[:], "IGG": AA_mutation[:], "IGM": AA_mutation[:], "unm": AA_mutation[:], "all": AA_mutation[:]} 88 AA_mutation_dic = {"IGA": AA_mutation[:], "IGG": AA_mutation[:], "IGM": AA_mutation[:], "IGE": AA_mutation[:], "unm": AA_mutation[:], "all": AA_mutation[:]}
89 AA_mutation_empty = AA_mutation[:] 89 AA_mutation_empty = AA_mutation[:]
90 90
91 aa_mutations_by_id_file = outfile[:outfile.rindex("/")] + "/aa_id_mutations.txt" 91 aa_mutations_by_id_file = outfile[:outfile.rindex("/")] + "/aa_id_mutations.txt"
92 with open(aa_mutations_by_id_file, 'w') as o: 92 with open(aa_mutations_by_id_file, 'w') as o:
93 o.write("ID\tbest_match\t" + "\t".join([str(x) for x in range(1,AALength)]) + "\n") 93 o.write("ID\tbest_match\t" + "\t".join([str(x) for x in range(1,AALength)]) + "\n")