Skip to content

Commit d6da2e4

Browse files
authored
Merge pull request #36 from brain-bican/tdt_sprint_4
Fix issue TDT 155
2 parents fd85db3 + adf5306 commit d6da2e4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
requests
2-
cas-tools==0.0.1.dev31
2+
cas-tools==0.0.1.dev40

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name="tdta",
11-
version="0.1.0.dev5",
11+
version="0.1.0.dev6",
1212
description="The aim of this project is to provide taxonomy development tools custom actions.",
1313
long_description=README,
1414
long_description_content_type="text/markdown",

src/tdta/tdt_export.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ def export_cas_data(sqlite_db: str, output_file: str, dataset_cache_folder: str
4141
if "matrix_file_id" in project_config:
4242
matrix_file_id = str(project_config["matrix_file_id"]).strip()
4343
anndata = resolve_matrix_file(matrix_file_id, dataset_cache_folder)
44-
cas_json = add_cell_ids(cta.to_dict(), anndata)
44+
labelsets = cta.labelsets.copy()
45+
labelsets.sort(key=lambda x: x.rank)
46+
labelset_names = [labelset.name for labelset in labelsets]
47+
48+
cas_json = add_cell_ids(cta.to_dict(), anndata, labelsets=labelset_names)
49+
if cas_json is None:
50+
print("WARN: Cell IDs population operation failed, skipping cell_id population")
51+
cas_json = cta.to_dict()
4552
with open(output_file, "w") as json_file:
4653
json.dump(cas_json, json_file, indent=2)
4754
else:

0 commit comments

Comments
 (0)