Skip to content

Commit

Permalink
Fix AnnData tmap parameter if layers already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cavenel committed Feb 9, 2024
1 parent b8c5075 commit 85ee1f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tissuumaps/read_h5ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ def h5ad_to_tmap(basedir, path, library_id=None):
obsList = getObsList(adata)
new_tmap_project = copy.deepcopy(tmap_template)

new_tmap_project["layers"] = layers
new_tmap_project["plugins"] = plugins
if "tmap" in list(adata.get("uns", [])):
new_tmap_project = json.loads(
adata.get(
Expand All @@ -295,6 +293,14 @@ def h5ad_to_tmap(basedir, path, library_id=None):
)
if "markerFiles" not in new_tmap_project.keys():
new_tmap_project["markerFiles"] = []
if "layers" in new_tmap_project.keys():
new_tmap_project["layers"] += layers
else:
new_tmap_project["layers"] = layers
if "plugins" in new_tmap_project.keys():
new_tmap_project["plugins"] += plugins
else:
new_tmap_project["plugins"] = plugins
obsListCategorical = []
obsListNumerical = []
palette = {}
Expand Down

0 comments on commit 85ee1f3

Please sign in to comment.