X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=getSNPs.py;fp=getSNPs.py;h=4778644832ba9b3734687a92421dd60bbeee93a2;hp=f5826751fdecdc3643967ea8e04df8331fbf94e3;hb=c4561c55cfa9726530c6777b6515c4ef66306b2f;hpb=343a4a216be6e8fa5f1cb0d5c34af0f1fe3c54cd diff --git a/getSNPs.py b/getSNPs.py index f582675..4778644 100755 --- a/getSNPs.py +++ b/getSNPs.py @@ -90,8 +90,7 @@ def writeSNPsToFile(hitfile, uniqStartMin, totalRatioMin, outfilename, doCache, snpPropertiesList = getSNPs(hitfile, uniqStartMin, totalRatioMin, doCache, cachePages, doSplices, forceChr) for snpEntry in snpPropertiesList: outline = "%1.2f\t%1.2f\t%s\t%d\t%d\t%d\t\t%d\t%s\n" % snpEntry - print outline - outfile.write(outline + "\n") + outfile.write(outline) outfile.flush() outfile.close() @@ -213,12 +212,16 @@ def getMismatchDict(rds, chrom, withSplices=True): uniqBaseDict = {change: 1} totalBaseDict = {change: 1} if mismatchDict.has_key(change_at): - (uniqueReadCount, totalCount, back, uniqBaseDict, totalBaseDict) = mismatchDict[change_at] pos = "%s:%s" % (str(start), change) + totalCount = mismatchDict[change_at]["totalCount"] totalCount += 1 + totalBaseDict = mismatchDict[change_at]["totalBaseDict"] if totalBaseDict.has_key(change): totalBaseDict[change] += 1 + uniqBaseDict = mismatchDict[change_at]["uniqBaseDict"] + uniqueReadCount = mismatchDict[change_at]["uniqueReadCount"] + back = mismatchDict[change_at]["back"] if pos not in back: uniqueReadCount += 1 if uniqBaseDict.has_key(change):