Skip to content

Commit

Permalink
remove genes w/ nan or inf values
Browse files Browse the repository at this point in the history
  • Loading branch information
safiyecelik committed Nov 13, 2023
1 parent b345b2a commit cf870cd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions efaar_benchmarking/data_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,5 @@ def load_replogle(gene_type: str, data_type: str, data_path: str = "data/") -> s
wget.download(src, data_path + filename)

adata = sc.read_h5ad(data_path + filename)
mask = adata.X.isna() | np.isinf(adata.X)
print(mask.sum() > 0).sum()
# adata.X = np.nan_to_num(adata.X)
adata.X = adata.X[:, np.all(~adata.X.isna() & ~np.isinf(adata.X), axis=0)]
return adata

0 comments on commit cf870cd

Please sign in to comment.