From 99718cac68932839b0b51783d20096cc09b1c498 Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Thu, 9 Jan 2025 11:19:53 +0100 Subject: [PATCH] Fix type check for organism --- scdataloader/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scdataloader/utils.py b/scdataloader/utils.py index f16cfbe..d79b7dd 100644 --- a/scdataloader/utils.py +++ b/scdataloader/utils.py @@ -611,9 +611,9 @@ def populate_my_ontology( ) source = bt.PublicSource.filter(name="ensembl", organism=organism_clade).last() records = [ - i[0] if type(i) is list else i - for i in [ - bt.Organism.from_source(ontology_id=i, source=source) for i in names + organism_or_organismlist if isinstance(organism_or_organismlist, bt.Organism) else organism_or_organismlist[0] + for organism_or_organismlist in [ + bt.Organism.from_source(ontology_id=name, source=source) for name in names ] ] ln.save(records)