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

TypeError: NDFrame._add_numeric_operations.<locals>.any() takes 1 positional argument but 2 were given #5

Open
kwonej0617 opened this issue May 15, 2023 · 7 comments

Comments

@kwonej0617
Copy link

Hi, Thank you for developing the useful tool.
It is my first time running Differr. My command line was as follows.

differr -a ${ko_bam} -b ${wt_bam} -r ${ref} -o differr.bed -f 2 --median-expr-threshold 0 --min-expr-threshold 0 -p 16

However, I got an error message. Could you please help me how to solve the error?

joblib.externals.loky.process_executor._RemoteTraceback:

Traceback (most recent call last):
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py", line 428, in _process_worker
r = call_item()
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py", line 275, in call
return self.fn(*self.args, **self.kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/_parallel_backends.py", line 620, in call
return self.func(*args, **kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/parallel.py", line 288, in call
return [func(*args, **kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/parallel.py", line 288, in
return [func(*args, **kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/main.py", line 65, in _parallel_differr
stats, mismatch_counts = test_significant_der_sites(counts, fdr_threshold, fasta)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/statistics.py", line 33, in test_significant_der_sites
c = filter_empty_cols(c.unstack(-1))
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/statistics.py", line 22, in filter_empty_cols
c_t = c_t[c_t.any(1)]
TypeError: NDFrame._add_numeric_operations..any() takes 1 positional argument but 2 were given
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/share/pkg/conda/differr_nanopore_drs/0.2/bin/differr", line 33, in
sys.exit(load_entry_point('differr==0.2', 'console_scripts', 'differr')())
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/main.py", line 170, in differr
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/main.py", line 101, in run_differr_analysis
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/parallel.py", line 1098, in call
self.retrieve()
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/parallel.py", line 975, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/joblib/_parallel_backends.py", line 567, in wrap_future_result
return future.result(timeout=timeout)
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
TypeError: NDFrame._add_numeric_operations..any() takes 1 positional argument but 2 were given

Thank you so much!

@Madhurananda
Copy link

Hi @kwonej0617

Change line 22 in statistics.py
from c_t = c_t[c_t.any(1)] to:
c_t = c_t[c_t.any(axis=1)]

Then:
python setup.py install

This issue should be solved.

@kwonej0617
Copy link
Author

Thank you for your help! I will try it.

@kwonej0617
Copy link
Author

Hi, I modified the script in statistics.py and rerun setup.py to reinstall as you suggested.
Then, I run the script again, but it printed out the following message in the error log file.

PLEASE NOTE: the differr_nanopore_drs/0.2 module is loading a conda environment
in an experimental way. If you encounter problems please report them to
[email protected]. This installation has been modified per the recommendation at
https://github.com/bartongroup/differr_nanopore_DRS/issues/5 

It has been running for a day, but nothing was generated in the output directory. Should I wait for a few more hours/days to get the output? I would appreciate it if you could give me any advice on this. Thank you!

@Madhurananda
Copy link

Hi @kwonej0617

I am also having the same issue and I need to investigate deeper.
I will share my success here if I can find any.

Also in the meantime, if you can get something interesting, please also share it here for everyone's benefit.

@kwonej0617
Copy link
Author

kwonej0617 commented Jun 29, 2023

Hi, @Madhurananda, @mparker2

I just wanted to share another error message I got during the process.
/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/output.py:37: RuntimeWarning: divide by zero encountered in log10

Though I got the messages, I just kept it running, and it generated an output file.
However, my result looks weird. It doesn't have the score value, G statistic for the homogeneity test of mutant replicates, -log10 P value for the homogeneity test of mutant replicates, G statistic for the homogeneity test of wild type replicates, -log10 P value for the homogeneity test of wild type replicates.

ENST00000618786 249     250     DER_site        -0      +       -0.63   0.00    -0.00   -0.00   nan     nan     nan     nan
ENST00000618786 252     253     DER_site        -0      +       -2.49   0.01    0.03    -0.00   nan     nan     nan     nan
ENST00000618786 258     259     DER_site        -0      +       0.28    0.00    -0.00   -0.00   nan     nan     nan     nan
ENST00000618786 256     257     DER_site        -0      +       0.93    0.00    -0.00   -0.00   nan     nan     nan     nan
ENST00000618786 257     258     DER_site        -0      +       1.83    0.18    0.17    -0.00   nan     nan     nan     nan
ENST00000618786 259     260     DER_site        -0      +       0.28    3.65    0.79    -0.00   nan     nan     nan     nan
ENST00000618786 260     261     DER_site        -0      +       -3.39   3.80    0.83    -0.00   nan     nan     nan     nan
ENST00000618786 268     269     DER_site        -0      +       0.93    0.00    -0.00   -0.00   nan     nan     nan     nan

Please let me know if you solve the problem. Thank you so much!

@peterthorpe5
Copy link

@kwonej0617 Im not part of the team that made this ... I am here for another error. I would say that the version of python you are using may be too new. 3.10 is a lot newer than when the code was written. This may or may not be the issue. I hope that help.

@peterthorpe5
Copy link

I got this error "/share/pkg/conda/differr_nanopore_drs/0.2/lib/python3.10/site-packages/differr-0.2-py3.10.egg/differr/output.py:37: RuntimeWarning: divide by zero encountered in log10" - but more sensible output using python 3.6

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

3 participants