import cell_census
import scanpy as sc
census = cell_census.open_soma(census_version="latest")
lung_adata = cell_census.get_anndata(census,
organism = "Homo sapiens",
obs_query = {"tissue_general": "lung"},
var_query = {"feature_name": ["MALAT1", "AQP5"]}
)
import cell_census
import scanpy as sc
census = cell_census.open_soma(census_version="latest")
lung_adata = cell_census.get_anndata(census,
organism = "Homo sapiens",
obs_query = {"tissue_general": "lung", "is_primary_data": True},
var_query = {"feature_name": ["MALAT1", "AQP5"]}
)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In [15], line 1
----> 1 lung_adata = cell_census.get_anndata(census,
2 organism = "Homo sapiens",
3 obs_query = {"tissue_general": "lung", "is_primary_data": True},
4 var_query = {"feature_name": ["MALAT1", "AQP5"]}
5 )
File ~/scripts/repos/cell-census/api/python/cell_census/src/cell_census/get_anndata.py:118, in get_anndata(census, organism, measurement_name, X_name, obs_query, var_query, column_names)
115 if exp.soma_type != "SOMAExperiment":
116 raise ValueError(f"Unknown organism {organism} - not a SOMA Experiment")
--> 118 _obs_query = _build_query(obs_query)
119 _var_query = _build_query(var_query)
120 with experiment_query(exp, measurement_name=measurement_name, obs_query=_obs_query, var_query=_var_query) as query:
File ~/scripts/repos/cell-census/api/python/cell_census/src/cell_census/get_anndata.py:57, in _build_query(query_defn)
55 query_conditions.append(f"{name} in {val}")
56 else:
---> 57 raise TypeError("Query must be string or list of strings")
59 if len(query_conditions) == 0:
60 return None
TypeError: Query must be string or list of strings