development release: conversion of ReadDataset to use BAM files
[erange.git] / getSNPs.py
index 4778644832ba9b3734687a92421dd60bbeee93a2..64948d405c523146e378c00fa4e204ca3ec75a4b 100755 (executable)
@@ -174,7 +174,7 @@ def getMatchDict(rds, chrom, withSplices=True):
     for read in readDict[chrom]:
         start = read["start"]
         stop = read["stop"]
-        if finalDict.has_key(start):
+        if start in finalDict:
             finalDict[start].append(stop)
         else:
             finalDict[start] = [stop]
@@ -193,7 +193,7 @@ def getMatchDict(rds, chrom, withSplices=True):
                 start = read["startR"]
                 stop = read["stopR"]
 
-            if finalDict.has_key(start):
+            if start in finalDict:
                 finalDict[start].append(stop)
             else:
                 finalDict[start] = [stop]
@@ -211,12 +211,12 @@ def getMismatchDict(rds, chrom, withSplices=True):
         back = "%s:%s" % (str(start), change)
         uniqBaseDict = {change: 1}
         totalBaseDict = {change: 1}
-        if mismatchDict.has_key(change_at):
+        if change_at in mismatchDict:
             pos = "%s:%s" % (str(start), change)
             totalCount = mismatchDict[change_at]["totalCount"]
             totalCount += 1
             totalBaseDict = mismatchDict[change_at]["totalBaseDict"]
-            if totalBaseDict.has_key(change)
+            if change in totalBaseDict
                 totalBaseDict[change] += 1
 
             uniqBaseDict = mismatchDict[change_at]["uniqBaseDict"]
@@ -224,7 +224,7 @@ def getMismatchDict(rds, chrom, withSplices=True):
             back = mismatchDict[change_at]["back"]
             if pos not in back:
                 uniqueReadCount += 1
-                if uniqBaseDict.has_key(change):
+                if change in uniqBaseDict:
                     uniqBaseDict[change] += 1 # dict contains total unique read counts
 
                 back = "%s,%s" % (back, pos)