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

Error running test #661

Open
ytakemon opened this issue Sep 23, 2021 · 4 comments
Open

Error running test #661

ytakemon opened this issue Sep 23, 2021 · 4 comments

Comments

@ytakemon
Copy link

I'm rather new to python, so apologies for the naive question. I installed all the dependencies as in your tutorial but for some reason, I can't get the test to run correctly. It seems to be that pandas was not installed, but after checking pandas seemed to have been installed correctly.

Also, I am using an alias for python py-3.9 (due to how my institution had structured our environment), which I see wasn't used properly below in the error message. Is there a way to specify which Python version to use in this make execution?

$ cd test
$ make

python ../cnvkit.py import-picard picard/p2-5_5.antitargetcoverage.csv picard/p2-9_5.targetcoverage.csv picard/p2-9_5.antitargetcoverage.csv picard/p2-20_5.targetcoverage.csv picard/p2-5_5.targetcoverage.csv picard/p2-20_5.antitargetcoverage.csv -d build/
Traceback (most recent call last):
  File "../cnvkit.py", line 4, in <module>
    from cnvlib import commands
  File "/home/ytakemon/.local/lib/python3.9/site-packages/cnvkit-master/cnvlib/__init__.py", line 1, in <module>
    from skgenome.tabio import write
  File "/home/ytakemon/.local/lib/python3.9/site-packages/cnvkit-master/skgenome/__init__.py", line 1, in <module>
    from . import tabio
  File "/home/ytakemon/.local/lib/python3.9/site-packages/cnvkit-master/skgenome/tabio/__init__.py", line 10, in <module>
    import pandas as pd
ImportError: No module named pandas
make: *** [build/reference-picard.cnn] Error 1
@tetedange13
Copy link
Contributor

Hi @ytakemon ,

Not an author of CNVkit, but if I understand correctly you installed CNVkit from sources ? Installing each Python package through pip associated to your py-3.9 installation?
=> If so, your problem is probably due to using an alias for Python3.9

Makefile file that should be present under test/ directory contains hard-written python calls
=> A quick fix could be to 1st create a temporary alias, typing in your shell: alias python=/absolute/path/to/your/py-3.9/executable and then re-run make

Also using conda is the recommended and much easier way to install CNVKit (and a lot of other tools by the way)
=> No root required so you should not have any issue related to your institution's permissions
=> So maybe give it a try?

Hope this helps.
Have a nice day.
Felix.

@ytakemon
Copy link
Author

ytakemon commented Sep 23, 2021

Thanks for the tip, Felix!

I was semi-resolved this initial issue by opening the Makefile and editing the 5th file to
cnvkit=/absolute/path/to/bin/python3.9 /absolute/path/to/bin/cnvkit.py. (Changing the alias didn't work as the alias isn't recognized within the Makefile).

This partially ran the Makefile, but now similar to the first issue I need to specify which executable Rscript to use which is a bit more of a hassle as I need to add the --rscript-path option to each line for the segment function. Anyways, I am satisfied my installation is working, it's just a matter of pointing to the right executable python/R files.

Perhaps a note to the authors of CNVkit is to allow the paths to python/R to be set initially to avoid this problem as not everyone will be running this in a local environment with only a single version of python or R is installed.

@tetedange13
Copy link
Contributor

Good to know it is working for you!

Here you were in a specific case of running CNVkit's tests, meaning a serie of commands on internal test data through a written Makefile
=> But CNVkit is basically a Python script, so on a "normal" (not-testing) usage you just have to run: py-39 /path/to/bin/cnvkit.py (+ using --rscript-path parameter if needed)
=> As you would do for any Python script and you can even set a permanent alias for this (should work this time)

A not-costly way to do what you say would be to set a variable inside Makefile, similar to 5th line cnvkit= but for rscript=Rscript
=> And to explicitly set by default --rscript-path $(rscript) at every segment call
=> Like that people wanting to run tests and having a specific Python/R installation can modify these variables by hand to match their paths

Have a nice day.
Felix.

@tetedange13
Copy link
Contributor

Should be closed by #699.

Kind regards,
Felix.

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

2 participants