aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCalvin <calvin@EESI>2013-03-14 15:44:38 -0400
committerCalvin <calvin@EESI>2013-03-14 15:44:38 -0400
commitd39b5f8f11e25580a158893ca09a3ba2a5a2b5ab (patch)
tree35b1cf1ad3c64293866bfce63b69fbc68e777606 /src
parentf14454dfa1ce071ebd443e0578ff6bb3bbb00bc1 (diff)
formatting fixes and renamed isCompressed to is_compressed
Diffstat (limited to 'src')
-rwxr-xr-xsrc/python/quikr.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/python/quikr.py b/src/python/quikr.py
index 802a7e0..182fd74 100755
--- a/src/python/quikr.py
+++ b/src/python/quikr.py
@@ -6,7 +6,6 @@ import scipy.optimize.nnls
import scipy.sparse
import numpy as np
from subprocess import *
-import argparse
import gzip
import itertools
@@ -37,7 +36,11 @@ def isCompressed(filename):
rtype: boolean
"""
- f = open(filename, "rb")
+ try:
+ f = open(filename, "rb")
+ except IOError:
+ print "Warning: isCompressed could not find " + filename
+ return False
# The first two bytes of a gzipped file are always '1f 8b'
if f.read(2) == '\x1f\x8b':
@@ -116,7 +119,3 @@ def calculate_estimated_frequencies(input_fasta_location, trained_matrix, kmer,
xstar = xstar / xstar.sum(0)
return xstar
-
-
-if __name__ == "__main__":
- sys.exit(main())