Skip to content

Commit

Permalink
Add feature_type column to var (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirshup authored Nov 14, 2024
1 parent f8b1862 commit 1b73528
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def get_obs_and_var(
var_df = (
adata.var.copy()
.rename_axis("feature_id")
.reset_index()[["feature_id", "feature_name", "feature_length"]]
.reset_index()[["feature_id", "feature_name", "feature_length", "feature_type"]]
)

return obs_df, var_df
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,21 @@
"feature_length",
"feature_reference",
"feature_biotype",
"feature_type",
)
CENSUS_VAR_TABLE_SPEC = TableSpec.create(
[
("soma_joinid", pa.int64()),
("feature_id", pa.large_string()),
("feature_name", pa.large_string()),
("feature_type", pa.large_string()),
("feature_length", pa.int64()),
("nnz", pa.int64()),
("n_measured_obs", pa.int64()),
],
use_arrow_dictionary=USE_ARROW_DICTIONARY,
)
_StringLabelVar = ["feature_id", "feature_name"]
_StringLabelVar = ["feature_id", "feature_name", "feature_type"]
_NumericVar = ["nnz", "n_measured_obs", "feature_length"]
CENSUS_VAR_PLATFORM_CONFIG = {
"tiledb": {
Expand Down
1 change: 1 addition & 0 deletions tools/cellxgene_census_builder/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def get_anndata(
"feature_biotype": "gene",
"feature_is_filtered": False,
"feature_name": "ERCC-00002 (spike-in control)",
"feature_type": "synthetic",
"feature_reference": organism.organism_ontology_term_id,
"feature_length": 1000,
},
Expand Down

0 comments on commit 1b73528

Please sign in to comment.