Skip to content

Commit b2fbaf9

Browse files
committed
added test
1 parent 894cb6b commit b2fbaf9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_interpret.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
run_tomtom,
1010
scan_sequences,
1111
trim_pwm,
12+
compare_motifs
1213
)
1314
from grelu.interpret.score import ISM_predict, get_attention_scores, get_attributions
1415
from grelu.interpret.simulate import (
@@ -268,6 +269,28 @@ def test_scan_sequences():
268269
assert out.equals(expected)
269270

270271

272+
def test_compare_motifs():
273+
out = compare_motifs(
274+
ref_seq="CACGTGACGCATGA",
275+
motifs=meme_file,
276+
alt_seq="TAAGTGACGCGTGA",
277+
pthresh = 5e-4,
278+
rc=False
279+
)
280+
expected = pd.DataFrame({
281+
'motif': ['MA0004.1 Arnt', 'MA0006.1 Ahr::Arnt'],
282+
'start': [0, 7],
283+
'end': [6, 13],
284+
'strand': ['+', '+'],
285+
'p-value_alt': [0.015625, 0.000244140625],
286+
'p-value_ref': [0.000244140625, 0.010009765624999995],
287+
'score_alt': [-14.648840188980103, 10.232005834579468],
288+
'score_ref': [11.60498046875, -2.9944558143615723],
289+
'score_diff': [-26.253820657730103, 13.22646164894104]
290+
})
291+
assert out.equals(expected)
292+
293+
271294
def test_run_tomtom():
272295

273296
motifs = {

0 commit comments

Comments
 (0)