Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip short seqs #304

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

skip short seqs #304

wants to merge 4 commits into from

Conversation

siebrenf
Copy link
Member

@siebrenf siebrenf commented Mar 17, 2023

C function pfmscan() will now stop if the given sequence is shorter than the given pfm.

I'm not sure if this does anything other than stopping early, because the line if (j_max < 0) { j_max = 0;}, in line 739 (743 in this PR), should already take care of problems?

How to test:

Command line:

git clone [email protected]:vanheeringen-lab/gimmemotifs.git
cd gimmemotifs
git checkout option_2
python setup.py build && pip install .

Python:

from gimmemotifs.c_metrics import pfmscan

seq = "ATGGTCT"
# ppm and cutoff for 'MA0046.2_MA0046.2.HNF1A'
ppm = [[0.3681, 0.1725, 0.2467, 0.2127],
       [0.4593, 0.0273, 0.4716, 0.0418],
       [0.0228, 0.0643, 0.0548, 0.8581],
       [0.1474, 0.1097, 0.0275, 0.7154],
       [0.9817, 0.0002, 0.0171, 0.001],
       [0.9337, 0.0418, 0.0005, 0.024],
       [0.0804, 0.0267, 0.0004, 0.8925],
       [0.2361, 0.265, 0.3209, 0.178],
       [0.934, 0.0006, 0.0224, 0.043],
       [0.0452, 0.0008, 0.0538, 0.9002],
       [0.0029, 0.0158, 0.0003, 0.981],
       [0.815, 0.0137, 0.077, 0.0943],
       [0.8781, 0.0431, 0.068, 0.0108],
       [0.0865, 0.8223, 0.0381, 0.0531],
       [0.2807, 0.2422, 0.1608, 0.3163]]
c = 9.687735324685306
nreport = 50
scan_rc = True

result = pfmscan(seq.upper(), ppm, c, nreport, scan_rc)
print(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant