Skip to content

Commit 93c7ae2

Browse files
authored
Merge pull request #152 from Genentech/tangermeme-update
Tangermeme update
2 parents e440bfc + 288710d commit 93c7ae2

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ install_requires =
7070
logomaker >= 0.8
7171
pyBigWig
7272
ledidi < 2.0.0
73-
tangermeme >= 0.4.0,< 0.5.0
73+
tangermeme >= 0.5.0
74+
memelite
7475
pygenomeviz <= 0.4.4
7576
statsmodels >=0.11.1
7677
pyjaspar >=3.0

src/grelu/interpret/motifs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ def scan_sequences(
122122
attrs: Optional[np.ndarray] = None,
123123
):
124124
"""
125-
Scan a DNA sequence using motifs. Based on
126-
https://github.com/jmschrei/tangermeme/blob/main/tangermeme/tools/fimo.py.
125+
Scan a DNA sequence using motifs. Based on https://github.com/jmschrei/memesuite-lite.
127126
128127
Args:
129128
seqs: A string or a list of DNA sequences as strings
@@ -148,7 +147,7 @@ def scan_sequences(
148147
pd.DataFrame containing columns 'motif', 'sequence', 'start', 'end',
149148
'strand', 'score', 'pval', and 'matched_seq'.
150149
"""
151-
from tangermeme.tools.fimo import fimo
150+
from memelite import fimo
152151

153152
# Format sequences
154153
seqs = make_list(seqs)
@@ -369,7 +368,7 @@ def compare_motifs(
369368
def run_tomtom(motifs: Dict[str, np.ndarray], meme_file: str) -> pd.DataFrame:
370369
"""
371370
Function to compare given motifs to reference motifs using the
372-
tomtom algorithm, as implemented in tangermeme.
371+
tomtom algorithm, as implemented in memelite (https://github.com/jmschrei/memesuite-lite).
373372
374373
Args:
375374
motifs: A dictionary whose values are Position Probability Matrices
@@ -380,7 +379,7 @@ def run_tomtom(motifs: Dict[str, np.ndarray], meme_file: str) -> pd.DataFrame:
380379
df: Pandas dataframe containing all tomtom results.
381380
"""
382381
from statsmodels.stats.multitest import fdrcorrection
383-
from tangermeme.tools.tomtom import tomtom
382+
from memelite import tomtom
384383

385384
from grelu.interpret.motifs import motifs_to_strings
386385
from grelu.resources import get_meme_file_path

src/grelu/io/motifs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def read_meme_file(
2727
values are the motif position probability matrices (PPMs)
2828
as numpy arrays of shape (4, L).
2929
"""
30-
from tangermeme.io import read_meme
30+
from memelite.io import read_meme
3131

3232
from grelu.resources import get_meme_file_path
3333

@@ -48,9 +48,6 @@ def read_meme_file(
4848

4949
motifs = motifs_subset
5050

51-
# Convert to numpy
52-
motifs = {k: v.numpy() for k, v in motifs.items()}
53-
5451
return motifs
5552

5653

0 commit comments

Comments
 (0)