From d39b5f8f11e25580a158893ca09a3ba2a5a2b5ab Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 14 Mar 2013 15:44:38 -0400 Subject: formatting fixes and renamed isCompressed to is_compressed --- src/python/quikr.py | 11 +++++------ 1 file 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()) -- cgit v1.2.3