From cf6a7912d970ee265a024d141159e089dfb5063e Mon Sep 17 00:00:00 2001 From: Jacob Schreiber Date: Wed, 14 Sep 2022 21:04:22 -0700 Subject: [PATCH] v0.0.8 --- modiscolite/__init__.py | 2 ++ modiscolite/gapped_kmer.py | 13 ++++--------- setup.py | 6 +++++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modiscolite/__init__.py b/modiscolite/__init__.py index 64a6882..6d59c4d 100644 --- a/modiscolite/__init__.py +++ b/modiscolite/__init__.py @@ -7,3 +7,5 @@ from . import tfmodisco from . import cluster from . import report + +__version__ = '0.0.8' \ No newline at end of file diff --git a/modiscolite/gapped_kmer.py b/modiscolite/gapped_kmer.py index ef06be1..bef7167 100644 --- a/modiscolite/gapped_kmer.py +++ b/modiscolite/gapped_kmer.py @@ -14,8 +14,8 @@ @njit(parallel=True) def _extract_gkmers(X, min_k, max_k, max_gap, max_len, max_entries): nx = X.shape[0] - keys = np.zeros((nx, max_entries), dtype='int64') - 1 - scores = np.zeros((nx, max_entries), dtype='float64') - 1.0 + keys = np.zeros((nx, max_entries), dtype='int64') + scores = np.zeros((nx, max_entries), dtype='float64') for xi in prange(nx): n = X.shape[1] @@ -74,7 +74,6 @@ def _extract_gkmers(X, min_k, max_k, max_gap, max_len, max_entries): if k >= min_k: gkmer_attrs[new_gkmer_hash] = gkmer_attrs.get(new_gkmer_hash, 0) + new_gkmer_attr / k - if len(gkmers_) == 0: last_k_gkmers[j] = np.zeros(0, dtype='int32') last_k_gkmers_attrs[j] = np.zeros(0, dtype='float64') @@ -83,7 +82,6 @@ def _extract_gkmers(X, min_k, max_k, max_gap, max_len, max_entries): last_k_gkmers[j] = np.array(gkmers_, dtype='int32') last_k_gkmers_attrs[j] = np.array(gkmer_attrs_, dtype='float64') last_k_gkmers_hashes[j] = np.array(gkmer_hashes_, dtype='int64') - ny = len(gkmer_attrs) keys_ = np.empty(ny, dtype='int64') @@ -100,8 +98,6 @@ def _extract_gkmers(X, min_k, max_k, max_gap, max_len, max_entries): return keys, scores - - def _seqlet_to_gkmers(seqlets, topn, min_k, max_k, max_gap, max_len, max_entries, take_fwd, sign): @@ -126,9 +122,8 @@ def _seqlet_to_gkmers(seqlets, topn, min_k, max_k, max_gap, max_len, Xs.append(X_) X = np.array(Xs) - keys, scores = _extract_gkmers(X, min_k=min_k, - max_k=max_k, max_gap=max_gap, max_len=max_len, max_entries=max_entries) - + keys, scores = _extract_gkmers(X, min_k=min_k, max_k=max_k, + max_gap=max_gap, max_len=max_len, max_entries=max_entries) row_idxs = np.repeat(range(keys.shape[0]), keys.shape[1]) csr_mat = scipy.sparse.csr_matrix((scores.flatten(), diff --git a/setup.py b/setup.py index 30b069b..9281126 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='modisco-lite', - version='0.0.6', + version='0.0.8', author='Jacob Schreiber', author_email='jmschreiber91@gmail.com', packages=['modiscolite'], @@ -18,5 +18,9 @@ 'leidenalg == 0.8.10', 'igraph == 0.9.11', 'tqdm >= 4.38.0', + 'pandas >= 1.4.3', + 'logomaker >= 0.8', + 'h5py >= 3.7.0', + 'hdf5plugin' ] )