From 0260b9a483d596b0746381091a2035442d41233d Mon Sep 17 00:00:00 2001 From: avantikalal Date: Thu, 7 Nov 2024 21:58:00 +0000 Subject: [PATCH] quick bugfix --- src/grelu/interpret/motifs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/grelu/interpret/motifs.py b/src/grelu/interpret/motifs.py index d38991d..7bbe52e 100644 --- a/src/grelu/interpret/motifs.py +++ b/src/grelu/interpret/motifs.py @@ -150,8 +150,10 @@ def scan_sequences( seq_ids = seq_ids or [str(i) for i in range(len(seqs))] # Format motifs - if isinstance(motifs, Dict): - motifs = {k: Tensor(v) for k, v in motifs.items()} + if isinstance(motifs, str): + motifs = read_meme_file(motifs) + + motifs = {k: Tensor(v) for k, v in motifs.items()} # Scan each sequence in seqs results = pd.DataFrame() @@ -305,7 +307,6 @@ def compare_motifs( rc: If True, both the sequence and its reverse complement will be scanned. If False, only the given sequence will be scanned. """ - from grelu.interpret.motifs import scan_sequences from grelu.sequence.mutate import mutate # Create alt sequence