diff options
-rwxr-xr-x | multifasta_to_otu.py | 9 | ||||
-rwxr-xr-x | quikr.py | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/multifasta_to_otu.py b/multifasta_to_otu.py index 548633e..bcc8177 100755 --- a/multifasta_to_otu.py +++ b/multifasta_to_otu.py @@ -5,7 +5,9 @@ from Bio import SeqIO import multiprocessing from subprocess import * import os +import gzip import quikr as q +import quikr_util as qu import sys import numpy as np import argparse @@ -70,7 +72,12 @@ def main(): kmer = args.kmer # Load trained matrix - trained_matrix = np.load(args.trained_matrix) + if qu.isCompressed(args.trained_matrix): + trained_matrix_file = gzip.open(args.trained_matrix, "rb") + else: + trained_matrix_file = open(args.trained_matrix, "rb") + + trained_matrix = np.load(trained_matrix_file) # Return a list of the input directory fasta_list = os.listdir(args.input_directory) @@ -52,7 +52,6 @@ def main(): def quikr_load_trained_matrix_from_file(input_fasta_location, trained_matrix_location, kmer, default_lambda): if qu.isCompressed(trained_matrix_location): - print "compressed!" trained_matrix_file = gzip.open(trained_matrix_location, "rb") else: trained_matrix_file = open(trained_matrix_location, "rb") |