X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=getSNPs.py;fp=getSNPs.py;h=64948d405c523146e378c00fa4e204ca3ec75a4b;hp=4778644832ba9b3734687a92421dd60bbeee93a2;hb=cfc5602b26323ad2365295145e3f6c622d912eb4;hpb=c4561c55cfa9726530c6777b6515c4ef66306b2f diff --git a/getSNPs.py b/getSNPs.py index 4778644..64948d4 100755 --- a/getSNPs.py +++ b/getSNPs.py @@ -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)