Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulated data from scRNA data Example Error #18

Open
monoplasty opened this issue May 11, 2023 · 0 comments
Open

Simulated data from scRNA data Example Error #18

monoplasty opened this issue May 11, 2023 · 0 comments

Comments

@monoplasty
Copy link

When I executed the Simulated data from scRNA data code of the SimulatedData.ipynb file, the following error occurred:

OSError                                   Traceback (most recent call last)
Cell In[7], line 4
      1 scRNADir1 = 'Brain_10X'
      2 scRNADir2 = 'Brain_Smart-seq'
----> 4 generate_dataset_data(scRNADir1, scRNADir2, celltype_key = 'celltype_final',reverse = False)
      5 generate_dataset_data(scRNADir1, scRNADir2, celltype_key = 'celltype_final',reverse = True)

Cell In[5], line 2, in generate_dataset_data(scRNADir1, scRNADir2, celltype_key, reverse)
      1 def generate_dataset_data(scRNADir1, scRNADir2, celltype_key,reverse = False):
----> 2     scrna, spatial = check_dataset(scRNADir1, scRNADir2, top_genes=200, plot=False,reverse=reverse,check=False)
      3     if not reverse:
      4         output_dir = scRNADir1

Cell In[3], line 37, in check_dataset(scRNADir1, scRNADir2, top_genes, plot, reverse, check)
     34 assert len(celltype_meta_1['celltype_final'][celltype_meta_1['celltype_final'] != 'Not_specific'].unique()) == len(overlaped_celltype), data_ident_1+': unique celltype length dont match.'
     35 assert len(celltype_meta_2['celltype_final'][celltype_meta_2['celltype_final'] != 'Not_specific'].unique()) == len(overlaped_celltype), data_ident_2+': unique celltype length dont match.'
---> 37 data_1 = sc.read_h5ad(scRNADir1 + '/scRNA.h5ad')
     38 data_2 = sc.read_h5ad(scRNADir2 + '/scRNA.h5ad')
     40 data_1 = check_adata(data_1, os.path.join(scRNADir1, 'Processed_scRNA.h5ad'))

File ~/miniconda3/envs/py38/lib/python3.8/site-packages/anndata/_io/h5ad.py:219, in read_h5ad(filename, backed, as_sparse, as_sparse_fmt, chunk_size)
    211         raise NotImplementedError(
    212             "Currently only `X` and `raw/X` can be read as sparse."
    213         )
    215 rdasp = partial(
    216     read_dense_as_sparse, sparse_format=as_sparse_fmt, axis_chunk=chunk_size
    217 )
--> 219 with h5py.File(filename, "r") as f:
    221     def callback(func, elem_name: str, elem, iospec):
    222         if iospec.encoding_type == "anndata" or elem_name.endswith("/"):

File ~/miniconda3/envs/py38/lib/python3.8/site-packages/h5py/_hl/files.py:424, in File.__init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, **kwds)
    422 with phil:
    423     fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0, **kwds)
--> 424     fid = make_fid(name, mode, userblock_size,
    425                    fapl, fcpl=make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
    426                    fs_persist=fs_persist, fs_threshold=fs_threshold),
    427                    swmr=swmr)
    429 if isinstance(libver, tuple):
    430     self._libver = libver

File ~/miniconda3/envs/py38/lib/python3.8/site-packages/h5py/_hl/files.py:190, in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
    188     if swmr and swmr_support:
    189         flags |= h5f.ACC_SWMR_READ
--> 190     fid = h5f.open(name, flags, fapl=fapl)
    191 elif mode == 'r+':
    192     fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)

File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File h5py/h5f.pyx:96, in h5py.h5f.open()

OSError: Unable to open file (truncated file: eof = 3001450496, sblock->base_addr = 0, stored_eof = 5047473549)

I searched for similar issues and got the answer that the original file is corrupted.
my env:

Package             Version
------------------- -------
anndata             0.9.1
asttokens           2.0.5
backcall            0.2.0
blosc2              2.0.0
comm                0.1.2
contourpy           1.0.7
cycler              0.11.0
Cython              0.29.34
debugpy             1.5.1
decorator           5.1.1
dunamai             1.16.0
executing           0.8.3
fonttools           4.39.3
get_version         3.5.4
h5py                3.1.0
importlib-metadata  6.0.0
importlib-resources 5.12.0
ipykernel           6.19.2
ipython             8.12.0
jedi                0.18.1
joblib              1.2.0
jupyter_client      8.1.0
jupyter_core        5.3.0
kiwisolver          1.4.4
legacy-api-wrap     1.2
llvmlite            0.40.0
matplotlib          3.3.4
matplotlib-inline   0.1.6
msgpack             1.0.5
natsort             8.3.1
nest-asyncio        1.5.6
networkx            3.1
numba               0.57.0
numexpr             2.8.4
numpy               1.24.3
packaging           23.0
pandas              1.1.5
parso               0.8.3
patsy               0.5.3
pexpect             4.8.0
pickleshare         0.7.5
Pillow              9.5.0
pip                 23.0.1
platformdirs        2.5.2
prompt-toolkit      3.0.36
psutil              5.9.0
ptyprocess          0.7.0
pure-eval           0.2.2
py-cpuinfo          9.0.0
Pygments            2.15.1
pynndescent         0.5.10
pyparsing           3.0.9
python-dateutil     2.8.2
pytz                2023.3
pyzmq               25.0.2
scanpy              1.7.2
scikit-learn        1.2.2
scipy               1.10.1
seaborn             0.12.2
setuptools          66.0.0
sinfo               0.3.4
six                 1.16.0
stack-data          0.2.0
statsmodels         0.14.0
stdlib-list         0.8.0
tables              3.8.0
threadpoolctl       3.1.0
tornado             6.2
tqdm                4.65.0
traitlets           5.7.1
typing_extensions   4.5.0
tzdata              2023.3
umap-learn          0.5.3
wcwidth             0.2.5
wheel               0.38.4
zipp                3.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant