Spaces:
Sleeping
Sleeping
| import os | |
| import urllib.request | |
| import scanpy as sc | |
| def collect_data(): | |
| os.makedirs("celldreamer/data/raw", exist_ok=True) | |
| # Source: https://scanpy-tutorials.readthedocs.io/en/latest/integrating-data-using-ingest.html | |
| url = "https://www.dropbox.com/s/qj1jlm9w10wmt0u/pancreas.h5ad?dl=1" | |
| save_path = "celldreamer/data/raw/panc8_raw.h5ad" | |
| urllib.request.urlretrieve(url, save_path) | |
| adata = sc.read(save_path) | |
| print(f"{adata.shape[0]} cells x {adata.shape[1]} genes") | |