Skip to content

Fail to fetch-load RefSeq sequences #166

@gromdimon

Description

@gromdimon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions