biocommons.seqrepo icon indicating copy to clipboard operation
biocommons.seqrepo copied to clipboard

Fail to fetch-load RefSeq sequences

Open gromdimon opened this issue 6 months ago • 0 comments

Describe the bug Currently there's a bug in fetch-load method.

To Reproduce Steps to reproduce the behavior:

  1. Install seqrepo
  2. sudo mkdir -p /usr/local/share/seqrepo
  3. sudo chown $USER /usr/local/share/seqrepo
  4. seqrepo init -i some-name
  5. seqrepo fetch-load -i some-name -n RefSeq NC_000001.10 NC_000002.11
  6. See the error (below)
Traceback (most recent call last):
  File "/Users/gromdimon/.local/share/virtualenvs/auto-acmg-zfFpTw_m/bin/seqrepo", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/gromdimon/.local/share/virtualenvs/auto-acmg-zfFpTw_m/lib/python3.12/site-packages/biocommons/seqrepo/cli.py", line 732, in main
    opts.func(opts)
  File "/Users/gromdimon/.local/share/virtualenvs/auto-acmg-zfFpTw_m/lib/python3.12/site-packages/biocommons/seqrepo/cli.py", line 466, in fetch_load
    if aliases_cur.fetchone() is not None:
       ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'generator' object has no attribute 'fetchone'

Expected behavior Fetch-load should work properly.

Additional context This fixes the problem:

sed -i -e 's/if aliases_cur.fetchone() is not None/if next(aliases_cur, None) is not None/' \
  <your-path-to-lib>/biocommons/seqrepo/cli.py

gromdimon avatar Aug 08 '24 22:08 gromdimon