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

Exception on motif enrichment analysis #311

Open
Mitmischer opened this issue Mar 15, 2024 · 0 comments
Open

Exception on motif enrichment analysis #311

Mitmischer opened this issue Mar 15, 2024 · 0 comments

Comments

@Mitmischer
Copy link

Describe the bug
I'm currently preparing a motif enrichment analysis. Preliminarily, I wanted to test the enrichment on just a single gene, but the program terminates prematurely.

To Reproduce
Steps to reproduce the behavior:

$ gimme motifs IFIH1.fasta -p consensus_pwms_stripped.jaspar gimme_out -g Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa -f 0.99 --known -N 36

IFIH1.fasta and consensus_pwms_stripped.jaspar are attached: consensus_pwms_stripped.zip
IFIH1.zip
Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa can be downloaded from
here.

Expected behavior
I expected the program to run in full or to provide a concise error message.

Error logs

2024-03-15 15:58:49,937 - WARNING - Will use the sequences from the FASTA input. If size is specified, this will be ignored.
2024-03-15 15:58:49,938 - INFO - creating background (matched GC%)
2024-03-15 16:00:17,614 - INFO - creating motif scan tables
Scanning: 100%|████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 20.18 sequences/s]Scanning: 100%|████████████████████████████████████████████████████████████████████████| 9992/9992 [00:01<00:00, 7159.13 sequences/s]
2024-03-15 16:00:20,133 - INFO - calculating stats
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: The least populated class in y has only 1 members, which is less than n_splits=5.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: FitFailedWarning:
1 fits failed out of a total of 5.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
1 fits failed with the following error:
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 895, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py", line 1221, in fit
    self.coef_, self.intercept_, self.n_iter_ = _fit_liblinear(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/svm/_base.py", line 1174, in _fit_liblinear
    raise ValueError(
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0.0

  _warn(*args, **kwargs)
2024-03-15 16:00:22,278 - INFO - selecting non-redundant motifs
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: The least populated class in y has only 1 members, which is less than n_splits=5.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: FitFailedWarning:
1 fits failed out of a total of 5.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
1 fits failed with the following error:
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 895, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py", line 1221, in fit
    self.coef_, self.intercept_, self.n_iter_ = _fit_liblinear(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/svm/_base.py", line 1174, in _fit_liblinear
    raise ValueError(
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0.0

  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: The least populated class in y has only 1 members, which is less than n_splits=5.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: FitFailedWarning:
1 fits failed out of a total of 5.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
1 fits failed with the following error:
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 895, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py", line 1221, in fit
    self.coef_, self.intercept_, self.n_iter_ = _fit_liblinear(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/svm/_base.py", line 1174, in _fit_liblinear
    raise ValueError(
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0.0

  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: The least populated class in y has only 1 members, which is less than n_splits=5.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: FitFailedWarning:
1 fits failed out of a total of 5.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
1 fits failed with the following error:
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 895, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py", line 1221, in fit
    self.coef_, self.intercept_, self.n_iter_ = _fit_liblinear(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/svm/_base.py", line 1174, in _fit_liblinear
    raise ValueError(
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0.0

  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: The least populated class in y has only 1 members, which is less than n_splits=5.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: FitFailedWarning:
1 fits failed out of a total of 5.
The score on these train-test partitions for these parameters will be set to nan.
If these failures are not expected, you can try to debug them by setting error_score='raise'.

Below are more details about the failures:
--------------------------------------------------------------------------------
1 fits failed with the following error:
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/model_selection/_validation.py", line 895, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py", line 1221, in fit
    self.coef_, self.intercept_, self.n_iter_ = _fit_liblinear(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/svm/_base.py", line 1174, in _fit_liblinear
    raise ValueError(
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0.0

  _warn(*args, **kwargs)
/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/__init__.py:30: UserWarning: No positive class found in y_true, recall is set to one for all thresholds.
  _warn(*args, **kwargs)
Traceback (most recent call last):
  File "/home/mabe/.conda/envs/mabe/bin/gimme", line 12, in <module>
    cli(sys.argv[1:])
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/cli.py", line 755, in cli
    args.func(args)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/commands/motifs.py", line 240, in motifs
    nr_motifs = select_nonredundant_motifs(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/gimmemotifs/comparison.py", line 944, in select_nonredundant_motifs
    roc_auc = roc_auc_score(y_test, y_pred)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/utils/_param_validation.py", line 213, in wrapper
    return func(*args, **kwargs)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/metrics/_ranking.py", line 640, in roc_auc_score
    return _average_binary_score(
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/metrics/_base.py", line 75, in _average_binary_score
    return binary_metric(y_true, y_score, sample_weight=sample_weight)
  File "/home/mabe/.conda/envs/mabe/lib/python3.10/site-packages/sklearn/metrics/_ranking.py", line 382, in _binary_roc_auc_score
    raise ValueError(
ValueError: Only one class present in y_true. ROC AUC score is not defined in that case.

Installation information (please complete the following information):

  • OS: [Ubuntu 22.04.4 LTS]
  • Installation [conda]
  • Version [0.18.0]

Additional context
As I am new to the software, this might as well be an error on my side. Still, I think that the error message should be better!

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

No branches or pull requests

1 participant