首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用FileNotFoundError时使用scanpy.read

使用FileNotFoundError时使用scanpy.read
EN

Stack Overflow用户
提问于 2020-12-26 20:35:22
回答 1查看 485关注 0票数 1

我在木星笔记本上学习他们实验室的单细胞测序分析教程,链接如下

https://github.com/theislab/single-cell-tutorial/blob/master/latest_notebook/Case-study_Mouse-intestinal-epithelium_1906.ipynb

代码语言:javascript
复制
#Data files
sample_strings = ['Duo_M1', 'Duo_M2', 'Jej_M1', 'Jej_M2', 'Il_M1', 'Il_M2']
sample_id_strings = ['3', '4', '5', '6', '7', '8']
file_base = '..data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW'
exp_string = '_Regional_'
data_file_end = '_matrix.mtx'
barcode_file_end = '_barcodes.tsv'
gene_file_end = '_genes.tsv'
cc_genes_file = '../Macosko_cell_cycle_genes.txt'

# First data set load & annotation
#Parse Filenames
sample = sample_strings.pop(0)
sample_id = sample_id_strings.pop(0)
data_file = file_base+sample_id+exp_string+sample+data_file_end
barcode_file = file_base+sample_id+exp_string+sample+barcode_file_end
gene_file = file_base+sample_id+exp_string+sample+gene_file_end

#Load data
adata = sc.read(data_file, cache=True)

我可以在我的计算机上本地看到这个文件,但是我一直收到下面的错误。

代码语言:javascript
复制
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-92-d3e19569f3db> in <module>()
----> 1 adata = sc.read(data_file, cache=True)

~/anaconda3/lib/python3.6/site-packages/scanpy/readwrite.py in read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, cache_compression, **kwargs)
    120             cache=cache,
    121             cache_compression=cache_compression,
--> 122             **kwargs,
    123         )
    124     # generate filename and read to dict

~/anaconda3/lib/python3.6/site-packages/scanpy/readwrite.py in _read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, cache_compression, suppress_cache_warning, **kwargs)
    713 
    714     if not is_present:
--> 715         raise FileNotFoundError(f'Did not find file {filename}.')
    716     logg.debug(f'reading {filename}')
    717     if not cache and not suppress_cache_warning:

FileNotFoundError: Did not find file ..data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW/GSM2836573_Regional_Duo_M1_matrix.mtx.

知道我做错什么了吗?谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-27 08:55:02

我想你忘了file_base里的斜杠

代码语言:javascript
复制
file_base = '../data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW'

而不是

代码语言:javascript
复制
file_base = '..data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW/GSM283657'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65460491

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档