Skip to content

Commit fb57946

Browse files
committed
fix data format in covariate
1 parent 5732e4d commit fb57946

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scFates/tools/covariate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ def group_test(
376376
with context as cv:
377377
pr_full = cv.rpy2py(pr_full)
378378
# For amplitude test, we take the max amplitude among groups
379-
amps = [np.max(pr_full[groups_py == g]) - np.min(pr_full[groups_py == g]) for g in df[group].cat.categories]
379+
# Use categories saved before R conversion
380+
amps = [np.max(pr_full[groups_py == g]) - np.min(pr_full[groups_py == g]) for g in categories]
380381
amp = np.max(amps)
381382

382383
return (pval, amp, lfc, ovr_lfcs)

0 commit comments

Comments
 (0)