简体   繁体   English

使用 scanpy.read 时出现 FileNotFoundError

[英]FileNotFoundError when using scanpy.read

I'm following the single cell sequencing analysis tutorial from theislab on Jupyter notebook, link below我正在关注 Jupyter notebook 上 theislab 的单细胞测序分析教程,链接如下

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

#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)

I can see the file locally on my computer but I keep getting the error below我可以在我的计算机上本地查看该文件,但我不断收到以下错误


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.

Any idea what I'm doing wrong?知道我做错了什么吗? Thanks!谢谢!

I think you forgot the slash in file_base :我认为您忘记了file_base中的斜线:

file_base = '../data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW'

Instead of代替

file_base = '..data/Haber-et-al_mouse-intestinal-epithelium/GSE92332_RAW/GSM283657'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM