Skip to content

Commit

Permalink
Use weights for cell fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
szabogtamas committed Mar 27, 2020
1 parent c1ca51a commit e918400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scirpy/_tools/_vdj_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def vdj_usage(
"""

if fraction is None:
fraction = _normalize_counts(adata.obs, normalize=False)
fraction = 1 / _normalize_counts(adata.obs, normalize=False)
else:
if isinstance(fraction, (bool, str)):
fraction = _normalize_counts(adata.obs, normalize=fraction)
fraction = 1 / _normalize_counts(adata.obs, normalize=fraction)

observations = adata.obs.loc[:, target_cols]
observations[size_column] = fraction
Expand Down

0 comments on commit e918400

Please sign in to comment.