comparison shm_csr.py @ 3:275ab5175fd6 draft

Uploaded
author davidvanzessen
date Thu, 27 Oct 2016 09:40:45 -0400
parents faae21ba5c63
children ad9be244b104
comparison
equal deleted inserted replaced
2:e85fec274cde 3:275ab5175fd6
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[:]} 88 AA_mutation_dic = {"IGA": AA_mutation[:], "IGG": AA_mutation[:], "IGM": 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")