Skip to content

Commit

Permalink
v0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jmschrei committed Sep 15, 2022
1 parent 1df5847 commit cf6a791
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions modiscolite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
from . import tfmodisco
from . import cluster
from . import report

__version__ = '0.0.8'
13 changes: 4 additions & 9 deletions modiscolite/gapped_kmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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):

Expand All @@ -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(),
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='modisco-lite',
version='0.0.6',
version='0.0.8',
author='Jacob Schreiber',
author_email='[email protected]',
packages=['modiscolite'],
Expand All @@ -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'
]
)

0 comments on commit cf6a791

Please sign in to comment.