Starlitnightly / omicverse

A python library for multi omics included bulk, single cell and spatial RNA-seq analysis.
https://starlitnightly.github.io/omicverse/
GNU General Public License v3.0
277 stars 32 forks source link

KeyError: 'content-length #9

Closed DocMonster77 closed 2 months ago

DocMonster77 commented 1 year ago

KeyError Traceback (most recent call last) Cell In[5], line 1 ----> 1 ov.utils.download_geneid_annotation_pair()

File ~/miniconda3/envs/Omicverse/lib/python3.9/site-packages/omicverse/utils/_data.py:175, in download_geneid_annotation_pair() 173 for datasets_name in _datasets.keys(): 174 print('......Geneid Annotation Pair download start:',datasets_name) --> 175 model_path = data_downloader(url=_datasets[datasets_name],path='genesets/{}.tsv'.format(datasets_name),title=datasets_name) 176 print('......Geneid Annotation Pair download finished!')

File ~/miniconda3/envs/Omicverse/lib/python3.9/site-packages/omicverse/utils/_data.py:85, in data_downloader(url, path, title) 82 res = requests.get(url, stream=True) 84 chunk_size = 1024000 ---> 85 content_size = int(res.headers["content-length"]) 86 if res.status_code == 200: 87 print('......[%s Size of file]: %0.2f MB' % (title, content_size/chunk_size/10.24))

File ~/miniconda3/envs/Omicverse/lib/python3.9/site-packages/requests/structures.py:52, in CaseInsensitiveDict.getitem(self, key) 51 def getitem(self, key): ---> 52 return self._store[key.lower()][1]

KeyError: 'content-length'

Starlitnightly commented 1 year ago

Hi,

Thanks for your support of omicverse. I believe that this problem may be caused by several reasons, and I hope that some possible suggestions for the different reasons will help you:

1) Network limitations: the geneset data is stored in figshare, please check if your environment can access https://figshare.com/ correctly.

2) Unstable network: For geneset, it is stored in https://figshare.com/articles/dataset/tsp1_bladder_scvelo_h5ad/21909810, you can also find the download address in the code source code and download it manually to the local/genesets directory.

Sincerely,

Zehua

code url: https://github.com/Starlitnightly/omicverse/blob/master/omicverse/utils/_data.py

image
Caary commented 10 months ago

Hi,

Thanks for your support of omicverse. I believe that this problem may be caused by several reasons, and I hope that some possible suggestions for the different reasons will help you:

  1. Network limitations: the geneset data is stored in figshare, please check if your environment can access https://figshare.com/ correctly.
  2. Unstable network: For geneset, it is stored in https://figshare.com/articles/dataset/tsp1_bladder_scvelo_h5ad/21909810, you can also find the download address in the code source code and download it manually to the local/genesets directory.

Sincerely,

Zehua

code url: https://github.com/Starlitnightly/omicverse/blob/master/omicverse/utils/_data.py

image

I faced the same question when i use the ov.utils.download_GDSC_data() and ov.utils.download_CaDRReS_model() for single cell drug sensitivity prediction. I could download these data through the link you provided on my local machine. I wonder how to manually load the download data in python.

Best wishes, Cary

Starlitnightly commented 10 months ago

Hi, Thanks for your support of omicverse. I believe that this problem may be caused by several reasons, and I hope that some possible suggestions for the different reasons will help you:

  1. Network limitations: the geneset data is stored in figshare, please check if your environment can access https://figshare.com/ correctly.
  2. Unstable network: For geneset, it is stored in https://figshare.com/articles/dataset/tsp1_bladder_scvelo_h5ad/21909810, you can also find the download address in the code source code and download it manually to the local/genesets directory.

Sincerely, Zehua code url: https://github.com/Starlitnightly/omicverse/blob/master/omicverse/utils/_data.py

image

I faced the same question when i use the ov.utils.download_GDSC_data() and ov.utils.download_CaDRReS_model() for single cell drug sensitivity prediction. I could download these data through the link you provided on my local machine. I wonder how to manually load the download data in python.

Best wishes, Cary

Hi,

Instead of download, you can create a new folder named models in the current runtime directory and put your files in that folder.

Caary commented 10 months ago

Hi, Thanks for your support of omicverse. I believe that this problem may be caused by several reasons, and I hope that some possible suggestions for the different reasons will help you:

  1. Network limitations: the geneset data is stored in figshare, please check if your environment can access https://figshare.com/ correctly.
  2. Unstable network: For geneset, it is stored in https://figshare.com/articles/dataset/tsp1_bladder_scvelo_h5ad/21909810, you can also find the download address in the code source code and download it manually to the local/genesets directory.

Sincerely, Zehua code url: https://github.com/Starlitnightly/omicverse/blob/master/omicverse/utils/_data.py

image

I faced the same question when i use the ov.utils.download_GDSC_data() and ov.utils.download_CaDRReS_model() for single cell drug sensitivity prediction. I could download these data through the link you provided on my local machine. I wonder how to manually load the download data in python. Best wishes, Cary

Hi,

Instead of download, you can create a new folder named models in the current runtime directory and put your files in that folder.

Hi, Problem has been solved. Wonderful work. I wonder is there wechat group for this package discussion.

Best wishes. Cary