Skip to content

Commit

Permalink
round restored counts in some affected datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
le-ander committed Dec 21, 2023
1 parent 0c2f42e commit 5fcf932
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import anndata
import os
import scipy.sparse
import numpy as np


def load(data_dir, sample_fn, **kwargs):
fn = os.path.join(data_dir, sample_fn)
adata = anndata.read_h5ad(fn)
adata.X = np.round((np.expm1(adata.X.A) * adata.obs["nCount_RNA"][:, None] / 10000))
adata.X = scipy.sparse.csr_matrix(adata.X)

return adata
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ def load(data_dir, **kwargs):
adata = anndata.read_h5ad(fn)
adata.X = np.expm1(adata.X)
adata.X = adata.X.multiply(scipy.sparse.csc_matrix(adata.obs["nUMI"].values[:, None])).multiply(1 / 10000)
adata.X = np.round(adata.X)

return adata
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ def load(data_dir, **kwargs):
adata = anndata.read_h5ad(fn)
adata.X = np.expm1(adata.X)
adata.X = adata.X.multiply(scipy.sparse.csc_matrix(adata.obs["n_counts"].values[:, None])).multiply(1 / 10000)
adata.X + np.round(adata.X)

return adata
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ dataset_or_observation_wise:
gm_obs_key:
individual:
individual_obs_key:
organ:
organ: "cell in vitro"
organ_obs_key:
organism: "Homo sapiens"
organism_obs_key:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dataset_or_observation_wise:
gm_obs_key:
individual:
individual_obs_key:
organ:
organ: "cell in vitro"
organ_obs_key:
organism: "Homo sapiens"
organism_obs_key:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dataset_or_feature_wise:
feature_type_var_key:
dataset_or_observation_wise:
assay_sc: "10x 3' v3"
assay_sc_obs_key: "assay"
assay_sc_obs_key:
assay_differentiation:
assay_differentiation_obs_key:
assay_type_differentiation:
Expand All @@ -46,7 +46,7 @@ dataset_or_observation_wise:
gm_obs_key:
individual:
individual_obs_key: "Donor_Study_ID"
organ:
organ: colon
organ_obs_key:
organism: "Homo sapiens"
organism_obs_key:
Expand Down

This file was deleted.

0 comments on commit 5fcf932

Please sign in to comment.