projects
/
erange.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite of findall.py to clean code. Configuration tested using
[erange.git]
/
geneLocusBins.py
diff --git
a/geneLocusBins.py
b/geneLocusBins.py
index 49745dc0c1361c2a8dbe4736c9c8630396fd93e4..03cade292225b55513b300a0fca2d8f2c4f5d50a 100755
(executable)
--- a/
geneLocusBins.py
+++ b/
geneLocusBins.py
@@
-138,7
+138,7
@@
def writeBins(gidList, geneinfoDict, gidBins, gidLen, outfilename, normalizeBins
try:
geneinfo = geneinfoDict[gid]
symbol = geneinfo[0][0]
try:
geneinfo = geneinfoDict[gid]
symbol = geneinfo[0][0]
- except
KeyError
:
+ except
(KeyError, IndexError)
:
pass
else:
symbol = gid
pass
else:
symbol = gid
@@
-154,6
+154,7
@@
def writeBins(gidList, geneinfoDict, gidBins, gidLen, outfilename, normalizeBins
try:
normalizedValue = 100. * binAmount / tagCount
except ZeroDivisionError:
try:
normalizedValue = 100. * binAmount / tagCount
except ZeroDivisionError:
+ #TODO: QForALi - this is the right way to refactor the original code, but I don't think this is the right answer
normalizedValue = 100. * binAmount
binAmount = normalizedValue
normalizedValue = 100. * binAmount
binAmount = normalizedValue
@@
-167,4
+168,4
@@
def writeBins(gidList, geneinfoDict, gidBins, gidLen, outfilename, normalizeBins
if __name__ == "__main__":
if __name__ == "__main__":
- main(sys.argv)
+ main(sys.argv)
\ No newline at end of file