Skip to content

Commit d5b7f69

Browse files
committed
Merge branch 'release/0.18.1'
2 parents 7451274 + 089a040 commit d5b7f69

18 files changed

Lines changed: 299 additions & 318 deletions

.rtd-environment.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
channels:
22
- conda-forge
33
- bioconda
4-
- defaults
54
dependencies:
65
# docs specific packages
76
- mock
@@ -13,18 +12,18 @@ dependencies:
1312
- configparser
1413
- diskcache
1514
- feather-format
16-
- genomepy >=0.13.0
17-
- ipywidgets # optional: progress bar in Jupyter notebook
15+
- genomepy >=0.14.0
16+
# - ipywidgets # optional: progress bar in Jupyter notebook
1817
- iteround
1918
- jinja2
2019
- logomaker
2120
- loguru
2221
- matplotlib-base >=3.3 # https://matplotlib.org/stable/devel/min_dep_policy.html#list-of-dependency-versions
2322
- numpy >=1.18 # https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table
24-
- pandas >=1.3.0 # version necessary for ExtraStyler.render()
23+
- pandas >=1.3, <3
2524
- pybedtools >=0.9.0
2625
- pysam >=0.16
27-
- python >=3.6
26+
- python >=3.7, <3.12 # Motifsampler & setuptools break from py3.12
2827
- python-xxhash
2928
- qnorm >=0.8.1
3029
- scikit-learn >=0.23.2 # https://scikit-learn.org/stable/install.html#installing-the-latest-release

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ install:
2525
- mamba env create -f requirements.yaml
2626
- source activate gimme
2727
- python setup.py build # installs the motif discovery tools
28-
- pip install -e . # installs gimme (in editable mode)
28+
- pip install -e . --no-deps --ignore-installed # installs gimme (in editable mode)
2929

3030
before_script:
3131
# install Code Climate test coverage reporter

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

66
## Unreleased
77

8+
## [0.18.1] - 2025-10-02
9+
10+
### Changed
11+
12+
- updated dependencies (conda + pypi)
13+
- updated Maelstrom report (don't show "NO ORTHOLOGS FOUND" if other factors have been found)
14+
- limit python to 3.11
15+
- Motifsampler & setuptools break from 3.12 onwards
16+
17+
### Fixed
18+
19+
- `gimme motifs` uses `--ncpus` where possible (two more places). fixes #265
20+
- updated pandas code, able to run pandas 2 now! resolves #306
21+
- updated C code, fixes compiler warnings & error (thanks cameronraysmith!)
22+
- updated versioneer, able to update configparser now! resolves #315
23+
824
## [0.18.0] - 2023-01-11
925

1026
### Added

docs/release_checklist.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This is mainly for personal use at the moment.
88
1. Make sure all tests pass.
99

1010
```shell
11-
mamba env update -f environment.yml
12-
pytest -vvv
11+
mamba env update -f requirements.yaml
12+
pytest -vvv --disable-pytest-warnings
1313
```
1414

1515
2. Create release candidate with `git flow`:
@@ -34,7 +34,7 @@ python setup.py sdist
3434
mamba create -n test python=3.9 pytest
3535
mamba activate test
3636
pip install dist/gimmemotifs*.tar.gz
37-
pytest -vvv
37+
pytest -vvv --disable-pytest-warnings
3838
```
3939

4040
5. Upload to pypi testing server

gimmemotifs/c_metrics.c

Lines changed: 28 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
#include <string.h>
1515
#include <stdio.h>
1616

17-
#if PY_MAJOR_VERSION >= 3
18-
#define PyInt_FromLong PyLong_FromLong
19-
#define PyString_Check PyUnicode_Check
20-
#define PyString_Size PyUnicode_GET_LENGTH
21-
#endif
22-
2317

2418
void fill_matrix(double matrix[][4], PyObject *matrix_o) {
2519
// Parse a PyObject matrix into a C array
@@ -312,9 +306,7 @@ static PyObject * c_metrics_score(PyObject *self, PyObject * args)
312306

313307
}
314308

315-
int get_truncate_len(len1, len2, pos) {
316-
//
317-
309+
int get_truncate_len(int len1, int len2, int pos) {
318310
if (pos < 0) {
319311
len2 += pos;
320312
}
@@ -328,7 +320,6 @@ int get_truncate_len(len1, len2, pos) {
328320
else {
329321
return len1;
330322
}
331-
332323
}
333324

334325
void fill_tmp_matrices(double matrix1[][4], double matrix2[][4], int pos, int l, double tmp_matrix1[][4], double tmp_matrix2[][4]) {
@@ -560,8 +551,6 @@ static PyObject * c_metrics_pwmscan(PyObject *self, PyObject * args)
560551

561552
if (j_max < 0) { j_max = 0;}
562553
int m;
563-
int c;
564-
double pwm_min = -50;
565554
for (j = 0; j < j_max; j++) {
566555
score = 0;
567556
rc_score = 0;
@@ -622,9 +611,9 @@ static PyObject * c_metrics_pwmscan(PyObject *self, PyObject * args)
622611
PyObject* row = PyList_New(0);
623612
x = PyFloat_FromDouble(score);
624613
PyList_Append(row, x); Py_DECREF(x);
625-
x = PyInt_FromLong((long) j);
614+
x = PyLong_FromLong((long) j);
626615
PyList_Append(row, x); Py_DECREF(x);
627-
x = PyInt_FromLong((long) 1);
616+
x = PyLong_FromLong((long) 1);
628617
PyList_Append(row, x); Py_DECREF(x);
629618
PyList_Append(return_list, row);
630619
Py_DECREF(row);
@@ -658,9 +647,9 @@ static PyObject * c_metrics_pwmscan(PyObject *self, PyObject * args)
658647
PyObject* row = PyList_New(0);
659648
x = PyFloat_FromDouble(score);
660649
PyList_Append(row, x); Py_DECREF(x);
661-
x = PyInt_FromLong((long) j);
650+
x = PyLong_FromLong((long) j);
662651
PyList_Append(row, x); Py_DECREF(x);
663-
x = PyInt_FromLong((long) 1);
652+
x = PyLong_FromLong((long) 1);
664653
PyList_Append(row, x); Py_DECREF(x);
665654
PyList_Append(return_list, row);
666655
Py_DECREF(row);
@@ -674,9 +663,9 @@ static PyObject * c_metrics_pwmscan(PyObject *self, PyObject * args)
674663
PyObject* row = PyList_New(0);
675664
x = PyFloat_FromDouble(maxScores[i]);
676665
PyList_Append(row, x); Py_DECREF(x);
677-
x = PyInt_FromLong((long)maxPos[i]);
666+
x = PyLong_FromLong((long)maxPos[i]);
678667
PyList_Append(row, x); Py_DECREF(x);
679-
x = PyInt_FromLong((long)maxStrand[i]);
668+
x = PyLong_FromLong((long)maxStrand[i]);
680669
PyList_Append(row, x); Py_DECREF(x);
681670
PyList_Append(return_list, row);
682671
Py_DECREF(row);
@@ -827,9 +816,9 @@ static PyObject * c_metrics_pfmscan(PyObject *self, PyObject * args)
827816
PyObject* row = PyList_New(0);
828817
x = PyFloat_FromDouble(score);
829818
PyList_Append(row, x); Py_DECREF(x);
830-
x = PyInt_FromLong((long) j);
819+
x = PyLong_FromLong((long) j);
831820
PyList_Append(row, x); Py_DECREF(x);
832-
x = PyInt_FromLong((long) 1);
821+
x = PyLong_FromLong((long) 1);
833822
PyList_Append(row, x); Py_DECREF(x);
834823
PyList_Append(return_list, row);
835824
Py_DECREF(row);
@@ -863,9 +852,9 @@ static PyObject * c_metrics_pfmscan(PyObject *self, PyObject * args)
863852
PyObject* row = PyList_New(0);
864853
x = PyFloat_FromDouble(score);
865854
PyList_Append(row, x); Py_DECREF(x);
866-
x = PyInt_FromLong((long) j);
855+
x = PyLong_FromLong((long) j);
867856
PyList_Append(row, x); Py_DECREF(x);
868-
x = PyInt_FromLong((long) 1);
857+
x = PyLong_FromLong((long) 1);
869858
PyList_Append(row, x); Py_DECREF(x);
870859
PyList_Append(return_list, row);
871860
Py_DECREF(row);
@@ -879,9 +868,9 @@ static PyObject * c_metrics_pfmscan(PyObject *self, PyObject * args)
879868
PyObject* row = PyList_New(0);
880869
x = PyFloat_FromDouble(maxScores[i]);
881870
PyList_Append(row, x); Py_DECREF(x);
882-
x = PyInt_FromLong((long)maxPos[i]);
871+
x = PyLong_FromLong((long)maxPos[i]);
883872
PyList_Append(row, x); Py_DECREF(x);
884-
x = PyInt_FromLong((long)maxStrand[i]);
873+
x = PyLong_FromLong((long)maxStrand[i]);
885874
PyList_Append(row, x); Py_DECREF(x);
886875
PyList_Append(return_list, row);
887876
Py_DECREF(row);
@@ -898,43 +887,28 @@ static PyMethodDef CoreMethods[] = {
898887
{"c_max_subtotal", c_metrics_max_subtotal, METH_VARARGS,"Test"},
899888
{"pfmscan", c_metrics_pfmscan, METH_VARARGS,"Test"},
900889
{"pwmscan", c_metrics_pwmscan, METH_VARARGS,"Test"},
901-
{NULL, NULL, NULL, 0, NULL}
890+
{NULL, NULL, 0, NULL}
902891
};
903892

904-
#if PY_MAJOR_VERSION >= 3
905-
static struct PyModuleDef moduledef = {
906-
PyModuleDef_HEAD_INIT,
907-
"c_metrics", /* m_name */
908-
"This is a module", /* m_doc */
909-
-1, /* m_size */
910-
CoreMethods, /* m_methods */
911-
NULL, /* m_reload */
912-
NULL, /* m_traverse */
913-
NULL, /* m_clear */
914-
NULL, /* m_free */
915-
};
916-
#endif
893+
static struct PyModuleDef moduledef = {
894+
PyModuleDef_HEAD_INIT,
895+
"c_metrics", /* m_name */
896+
"This is a module", /* m_doc */
897+
-1, /* m_size */
898+
CoreMethods, /* m_methods */
899+
NULL, /* m_reload */
900+
NULL, /* m_traverse */
901+
NULL, /* m_clear */
902+
NULL, /* m_free */
903+
};
917904

918905
static PyObject * moduleinit(void) {
919906
PyObject *m;
920-
#if PY_MAJOR_VERSION >= 3
921907
m = PyModule_Create(&moduledef);
922-
#else
923-
m = Py_InitModule3("c_metrics", CoreMethods, "c_metrics_module");
924-
#endif
925908
return m;
926909
}
927910

928911
PyMODINIT_FUNC
929-
#if PY_MAJOR_VERSION >= 3
930-
PyInit_c_metrics(void)
931-
{
932-
return moduleinit();
933-
};
934-
#else
935-
initc_metrics(void)
936-
{
937-
moduleinit();
938-
};
939-
#endif
940-
912+
PyInit_c_metrics(void) {
913+
return moduleinit();
914+
};

gimmemotifs/commands/motifs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def motifs(args):
170170
genome=args.genome,
171171
zscore=args.zscore,
172172
gcnorm=args.gc,
173+
ncpus=args.ncpus,
173174
)
174175

175176
n_input = pd.read_csv(score_table, comment="#", sep="\t").shape[0]
@@ -265,6 +266,7 @@ def motifs(args):
265266
zscore=args.zscore,
266267
gcnorm=args.gc,
267268
bgfile=bgfile,
269+
ncpus=args.ncpus,
268270
progress=False,
269271
)
270272

gimmemotifs/maelstrom/moap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def fit(self, df_X, df_y):
588588
self.columns = df_y.columns
589589
X = df_X.loc[y.index]
590590

591-
clf = LinearSVR(random_state=self.random_state)
591+
clf = LinearSVR(random_state=self.random_state, dual="auto")
592592
self.model = MultiOutputRegressor(clf, n_jobs=1)
593593
logger.debug("Fitting model")
594594
self.model.fit(df_X, df_y)

0 commit comments

Comments
 (0)