Skip to content

Commit

Permalink
Fix a bug when --key-added is not specified for find-cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
nh3 committed Aug 30, 2019
1 parent c0c5b23 commit e3ef960
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scanpy_scripts/lib/_leiden.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def leiden(
if not isinstance(resolution, (list, tuple)):
if key_added is not None and not key_added.startswith('leiden_'):
key_added = f'leiden_{key_added}'
elif key_added is None:
key_added = 'leiden'
sc.tl.leiden(
adata,
resolution=resolution,
Expand Down
2 changes: 2 additions & 0 deletions scanpy_scripts/lib/_louvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def louvain(
if not isinstance(resolution, (list, tuple)):
if key_added is not None and not key_added.startswith('louvain_'):
key_added = f'louvain_{key_added}'
elif key_added is None:
key_added = 'louvain'
sc.tl.louvain(
adata,
resolution=resolution,
Expand Down

0 comments on commit e3ef960

Please sign in to comment.