X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=geneMrnaCounts.py;fp=geneMrnaCounts.py;h=7b4a2cc819c30976692d9721ddb363756ebdf70a;hp=cf5065ab88c40279c7ca5dfb30b70bc99dfd2065;hb=cfc5602b26323ad2365295145e3f6c622d912eb4;hpb=c4561c55cfa9726530c6777b6515c4ef66306b2f diff --git a/geneMrnaCounts.py b/geneMrnaCounts.py index cf5065a..7b4a2cc 100755 --- a/geneMrnaCounts.py +++ b/geneMrnaCounts.py @@ -124,7 +124,7 @@ def geneMrnaCounts(genomeName, hitfile, outfilename, trackStrand=False, doSplice continue if countFeats: - seenFeaturesByChromDict[chrom] = [] + seenFeaturesByChromDict[chrom] = set([]) print "\nchr%s" % chrom fullchrom = "chr%s" % chrom @@ -137,18 +137,18 @@ def geneMrnaCounts(genomeName, hitfile, outfilename, trackStrand=False, doSplice if featureSense == "R": checkSense = "-" - regionList.append((gid, fullchrom, start, stop, checkSense)) + regionData = (gid, fullchrom, start, stop, checkSense) count = hitRDS.getCounts(fullchrom, start, stop, uniqs=doUniqs, multi=doMulti, splices=doSplices, sense=checkSense) else: - regionList.append((gid, fullchrom, start, stop)) + regionData = (gid, fullchrom, start, stop) count = hitRDS.getCounts(fullchrom, start, stop, uniqs=doUniqs, multi=doMulti, splices=doSplices) - if count != 0: - print count gidCount[gid] += count + if markGID: + regionList.append(regionData) + if countFeats: - if (start, stop, gid, featureSense) not in seenFeaturesByChromDict[chrom]: - seenFeaturesByChromDict[chrom].append((start, stop, gid, featureSense)) + seenFeaturesByChromDict[chrom].add((start, stop, gid, featureSense)) except: print "problem with %s - skipping" % gid