Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Sep 25, 2024
1 parent 321faa9 commit 6c85040
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/datasets/loaders/allen_brain_cell_atlas/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,9 @@
f"releases/{VERSION}/manifest.json"
)

print("Downloading metadata", flush=True)
metadata_files = [
"cell_metadata_with_cluster_annotation",
]
for file_name in metadata_files:
abc_cache.get_metadata_path(directory="WMB-10X", file_name=file_name)

print("Reading obs", flush=True)
obs = pd.read_csv(
TMP_DIR / f"metadata/WMB-10X/{VERSION}/views/cell_metadata_with_cluster_annotation.csv",
abc_cache.get_metadata_path(directory="WMB-10X", file_name="cell_metadata_with_cluster_annotation"),
index_col=0,
dtype=defaultdict(
lambda: "category",
Expand Down Expand Up @@ -90,7 +83,7 @@
file_name = f"WMB-10Xv2-{region}/raw"
adata_path = abc_cache.get_data_path(directory="WMB-10Xv2", file_name=file_name)

adata = ad.read_h5ad(str(adata_path), backed=True)
adata = ad.read_h5ad(str(adata_path))

adata_ = adata[adata.obs_names.isin(obs.index)]
adata.obs["region"] = region
Expand Down

0 comments on commit 6c85040

Please sign in to comment.