comparison mutation_analysis.py @ 73:13c3710604ef draft

Uploaded
author davidvanzessen
date Wed, 04 May 2016 08:40:31 -0400
parents a7381fd96dad
children becea91089ed
comparison
equal deleted inserted replaced
72:51d92233fb5d 73:13c3710604ef
5 5
6 parser = argparse.ArgumentParser() 6 parser = argparse.ArgumentParser()
7 parser.add_argument("--input", 7 parser.add_argument("--input",
8 help="The '7_V-REGION-mutation-and-AA-change-table' and '10_V-REGION-mutation-hotspots' merged together, with an added 'best_match' annotation") 8 help="The '7_V-REGION-mutation-and-AA-change-table' and '10_V-REGION-mutation-hotspots' merged together, with an added 'best_match' annotation")
9 parser.add_argument("--genes", help="The genes available in the 'best_match' column") 9 parser.add_argument("--genes", help="The genes available in the 'best_match' column")
10 parser.add_argument("--includefr1", help="The genes available in the 'best_match' column") 10 parser.add_argument("--includefr1", help="Should the mutation/nucleotides in the FR1 region be included?")
11 parser.add_argument("--output", help="Output file") 11 parser.add_argument("--output", help="Output file")
12 12
13 args = parser.parse_args() 13 args = parser.parse_args()
14 14
15 infile = args.input 15 infile = args.input
55 continue 55 continue
56 linecount += 1 56 linecount += 1
57 linesplt = line.split("\t") 57 linesplt = line.split("\t")
58 ID = linesplt[IDIndex] 58 ID = linesplt[IDIndex]
59 genedic[ID] = linesplt[best_matchIndex] 59 genedic[ID] = linesplt[best_matchIndex]
60 print line
60 try: 61 try:
61 mutationdic[ID + "_FR1"] = [mutationMatcher.match(x).groups() for x in linesplt[fr1Index].split("|") if x] if include_fr1 else [] 62 mutationdic[ID + "_FR1"] = [mutationMatcher.match(x).groups() for x in linesplt[fr1Index].split("|") if x] if include_fr1 else []
62 mutationdic[ID + "_CDR1"] = [mutationMatcher.match(x).groups() for x in linesplt[cdr1Index].split("|") if x] 63 mutationdic[ID + "_CDR1"] = [mutationMatcher.match(x).groups() for x in linesplt[cdr1Index].split("|") if x]
63 mutationdic[ID + "_FR2"] = [mutationMatcher.match(x).groups() for x in linesplt[fr2Index].split("|") if x] 64 mutationdic[ID + "_FR2"] = [mutationMatcher.match(x).groups() for x in linesplt[fr2Index].split("|") if x]
64 mutationdic[ID + "_CDR2"] = [mutationMatcher.match(x).groups() for x in linesplt[cdr2Index].split("|") if x] 65 mutationdic[ID + "_CDR2"] = [mutationMatcher.match(x).groups() for x in linesplt[cdr2Index].split("|") if x]