diff mutation_analysis.py @ 85:07f7da724a77 draft

Uploaded
author davidvanzessen
date Thu, 26 May 2016 08:18:13 -0400
parents b523ce95d857
children 5ffbf40cdd4b
line wrap: on
line diff
--- a/mutation_analysis.py	Tue May 24 03:59:44 2016 -0400
+++ b/mutation_analysis.py	Thu May 26 08:18:13 2016 -0400
@@ -49,8 +49,8 @@
 			fr2Index = linesplt.index("FR2.IMGT")
 			cdr2Index = linesplt.index("CDR2.IMGT")
 			fr3Index = linesplt.index("FR3.IMGT")
-			cdr1LengthIndex = linesplt.index("CDR1.IMGT.Nb.of.nucleotides")
-			cdr2LengthIndex = linesplt.index("CDR2.IMGT.Nb.of.nucleotides")
+			cdr1LengthIndex = linesplt.index("CDR1.IMGT.length")
+			cdr2LengthIndex = linesplt.index("CDR2.IMGT.length")
 			first = False
 			continue
 		linecount += 1
@@ -73,9 +73,9 @@
 		cdr1Length = linesplt[cdr1LengthIndex]
 		cdr2Length = linesplt[cdr2LengthIndex]
 
-		cdr1LengthDic[ID] = int(cdr1Length) / 3
-		cdr2LengthDic[ID] = int(cdr2Length) / 3
-
+		cdr1LengthDic[ID] = int(cdr1Length) if cdr1Length != "X" else 0
+		cdr2LengthDic[ID] = int(cdr2Length) if cdr2Length != "X" else 0
+		
 		IDlist += [ID]
 
 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