Hello I am trying to read expression matrix using the code :
adata.var = sc.read_csv('/home/sidrah19220/rna/auxfile/EXP0001_PCG_beforeQC.txt')
But I am facing this error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 48, in read_csv return read_text(filename, delimiter, first_column_names, dtype) File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 322, in read_text return _read_text(f, delimiter, first_column_names, dtype) File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 352, in _read_text raise ValueError(f"Did not find delimiter {delimiter!r} in first line.") ValueError: Did not find delimiter ',' in first line.
adata.var = sc.read_csv('/home/sidrah19220/rna/auxfile/EXP0001_PCG_beforeQC.txt') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 48, in read_csv return read_text(filename, delimiter, first_column_names, dtype) File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 322, in read_text return _read_text(f, delimiter, first_column_names, dtype) File "/home/sidrah19220/anaconda3/envs/scenic_protocol/lib/python3.6/site-packages/anndata/_io/read.py", line 352, in _read_text raise ValueError(f"Did not find delimiter {delimiter!r} in first line.") ValueError: Did not find delimiter ',' in first line.
Please suggest the solution.
I even tried using the delimiter argument, but no help.
what's the delimiter in input file? By default, delimiter is comma. Seems that is not found in the very first line.
Since the input file is
txt
while it is looking forcsv
file you have to specify the delimiter argument. Else re-save the file with extension.csv
. that should work.It did work now. Thank you.