Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code #90

Merged
merged 6 commits into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions cellxgene_lamin/curate.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,13 @@ def _fetch_bionty_source(
# fmt: on

entity_to_sources = {
entity_key: source_obj
for entity, entity_params in entity_mapping.items()
for entity_key, source_obj in [
(entity, _fetch_bionty_source(*entity_params)),
(f"{entity}_ontology_id", _fetch_bionty_source(*entity_params)),
]
}
entity_to_sources = {
entity: source
for entity, source in entity_to_sources.items()
if entity in adata.obs.columns or entity in {"var_index"}
key: source
for entity, params in entity_mapping.items()
for key, source in {
entity: _fetch_bionty_source(*params),
f"{entity}_ontology_id": _fetch_bionty_source(*params),
}.items()
if key in adata.obs.columns or key == "var_index"
}

return entity_to_sources
Expand Down
Loading