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

Problems running any of the tools due to PyVCF #887

Closed
bozbezbozzel opened this issue Dec 22, 2022 · 4 comments
Closed

Problems running any of the tools due to PyVCF #887

bozbezbozzel opened this issue Dec 22, 2022 · 4 comments

Comments

@bozbezbozzel
Copy link

  • pvactools version: 3.1.9
  • Python version: 3.7.12
  • Operating System: Ubuntu

Describe the bug

Cannot run pvacseq due to weird errors that are very likely related to the PyVCF package.
I did some digging and this is a known problem with PyVCF: jamescasbon/PyVCF#332

I don't know how to solve this last error since it's possibly related to a defunct package using Python 2.*

To Reproduce

I am able to cleanly install pvactools with mamba, pip and the requirements.txt file from this repo:

mamba create -n pvactools python=3.7.12
mamba activate pvactools
python -m pip install pvactools -r requirements.txt 

Log Output

When I run pvactools I get normal output

usage: pvactools [-h] [-v] {download_cwls} ...

positional arguments:
  {download_cwls}
    download_cwls  Download pVACtools CWLs for each tool's main pipeline

optional arguments:
  -h, --help       show this help message and exit
  -v, --version    Display the currently installed pvactools version (default:
                   False)
Error: No command specified

when I run pvacseq, this happens:

Traceback (most recent call last):
  File "/home/a.vliet/miniconda3/envs/pvactools/bin/pvacseq", line 5, in <module>
    from pvactools.tools.pvacseq.main import main
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/tools/pvacseq/__init__.py", line 18, in <module>
    from . import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/tools/pvacseq/run.py", line 7, in <module>
    from pvactools.lib.prediction_class import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/lib/__init__.py", line 22, in <module>
    from . import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/lib/input_file_converter.py", line 1, in <module>
    import vcf
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/vcf/__init__.py", line 9, in <module>
    from vcf.parser import Reader, Writer
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/vcf/parser.py", line 25, in <module>
    from model import _Call, _Record, make_calldata_tuple
ModuleNotFoundError: No module named 'model'

I solved this error by adding lines to __init__.py in the PyVCF package (not ideal).
After solving that error, the one below popped up:

Traceback (most recent call last):
  File "/home/a.vliet/miniconda3/envs/pvactools/bin/pvacseq", line 5, in <module>
    from pvactools.tools.pvacseq.main import main
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/tools/pvacseq/__init__.py", line 18, in <module>
    from . import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/tools/pvacseq/run.py", line 7, in <module>
    from pvactools.lib.prediction_class import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/lib/__init__.py", line 22, in <module>
    from . import *
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/pvactools/lib/input_file_converter.py", line 1, in <module>
    import vcf
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/vcf/__init__.py", line 9, in <module>
    from vcf.parser import Reader, Writer
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/vcf/parser.py", line 635, in <module>
    class Writer(object):
  File "/home/a.vliet/miniconda3/envs/pvactools/lib/python3.7/site-packages/vcf/parser.py", line 639, in Writer
    counts = dict((v,k) for k,v in field_counts.iteritems())
AttributeError: 'dict' object has no attribute 'iteritems'
@susannasiebert
Copy link
Contributor

That's odd; we haven't run into a problem like this before. We're actually no longer using the pyvcf package so that import can be removed. There are, however, some downstream dependencies using that package so you might still get errors.

@susannasiebert
Copy link
Contributor

I removed the import and made a new release (3.1.1). I'm still working on the docker containers but since you're installing it directly, please try to upgrade to the latest version and see if that fixes the error you're seeing.

@bozbezbozzel
Copy link
Author

Thanks so much for your quick reply. Will give it a go tomorrow and let you know what happened. I was surprised I could not find someone who encountered the same problem but I've been breaking my head over it for 2 days.

@bozbezbozzel
Copy link
Author

bozbezbozzel commented Dec 23, 2022

I did

mamba create -n pvactools python=3.7.12
mamba activate pvactools
python -m pip install pvactools==3.1.1 -r requirements.txt 

And that got rid of the error! Thanks so much for your help, Susanna. Happy holidays and happy new year :)

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