foldcomp icon indicating copy to clipboard operation
foldcomp copied to clipboard

Error downloading proteome subsets

Open alex-hh opened this issue 1 year ago • 2 comments

I get the following error downloading AFDB proteome subsets with foldcomp.setup Other dbs download successfully

----> 1 foldcomp.setup('h_sapiens')

File ~/envs/devo/lib/python3.10/site-packages/foldcomp/setup.py:87, in setup(db, download_chunks) 85 def setup(db="afdb_swissprot", download_chunks=16): 86 for i in ["", ".index", ".dbtype", ".lookup", ".source"]: ---> 87 asyncio.run( 88 download( 89 f"https://foldcomp.steineggerlab.workers.dev/{db}{i}", 90 f"{db}{i}", 91 chunks=download_chunks, 92 ) 93 )

File /usr/lib/python3.10/asyncio/runners.py:44, in run(main, debug) 42 if debug is not None: 43 loop.set_debug(debug) ---> 44 return loop.run_until_complete(main) 45 finally: 46 try:

File /usr/lib/python3.10/asyncio/base_events.py:649, in BaseEventLoop.run_until_complete(self, future) 646 if not future.done(): 647 raise RuntimeError('Event loop stopped before Future completed.') --> 649 return future.result()

File ~/envs/devo/lib/python3.10/site-packages/foldcomp/setup.py:35, in download(url, output, chunks) 33 async def download(url, output, chunks=16): 34 async with httpx.AsyncClient() as client: ---> 35 file_size = await get_size(client, url) 37 # check that file is not already downloaded 38 if os.path.exists(output) and os.path.getsize(output) == file_size:

File ~/envs/devo/lib/python3.10/site-packages/foldcomp/setup.py:8, in get_size(client, url) 6 async def get_size(client, url): 7 response = await client.head(url=url) ----> 8 return int(response.headers["Content-Length"])

File ~/envs/devo/lib/python3.10/site-packages/httpx/_models.py:228, in Headers.getitem(self, key) 225 if items: 226 return ", ".join(items) --> 228 raise KeyError(key)

KeyError: 'Content-Length'

alex-hh avatar Oct 12 '24 07:10 alex-hh

(the download seems to complete successfully despite the error i think?)

alex-hh avatar Oct 13 '24 20:10 alex-hh

Thank you for notifying me this. We were aware of this error log and the downloaded database seems fine. I'll try to fix this soon.

khb7840 avatar Oct 15 '24 02:10 khb7840

This issue is fixed in Foldcomp v0.1.0.

khb7840 avatar Jul 30 '25 08:07 khb7840