Skip to content

Commit

Permalink
final revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmchartrand committed Sep 1, 2023
1 parent 92d8f69 commit f45eb84
Show file tree
Hide file tree
Showing 8 changed files with 3,084 additions and 1,675 deletions.
165 changes: 124 additions & 41 deletions notebooks/l1_cross_species.ipynb

Large diffs are not rendered by default.

848 changes: 848 additions & 0 deletions notebooks/l1_depth_revisions.ipynb

Large diffs are not rendered by default.

1,783 changes: 321 additions & 1,462 deletions notebooks/l1_dprime.ipynb
100755 → 100644

Large diffs are not rendered by default.

459 changes: 428 additions & 31 deletions notebooks/l1_rosehip.ipynb

Large diffs are not rendered by default.

752 changes: 746 additions & 6 deletions notebooks/l1_subclass_distinctness.ipynb

Large diffs are not rendered by default.

743 changes: 612 additions & 131 deletions notebooks/l1_tnfaip.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions patchseq_utils/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ def plot_box_cluster_feature(data, y, x='cluster', x_fine=None, label=None, ax=N
drop_box=False,
test='mannwhitney', pairs='all', cutoff=0.05, fdr_method='fdr_bh', test_label=None,
invert_y=False, label_yaxis=False, pad_title=0, title_loc='right',
label_counts=True, label_color=False, size=3, highlight=None,
label_counts=True, label_color=False, size=4, highlight=None,
label_align='right',
legend=None, **kwargs
):
data = remove_unused_categories(data.dropna(subset=[x,y]).copy())
# data = remove_unused_categories(data.dropna(subset=[x,y]).copy())
if not hasattr(data[x], 'cat'):
# make column ordered categorical
data[x] = data[x].astype('category')
Expand Down Expand Up @@ -559,7 +559,7 @@ def run_twosamp(df, features, variable, fdr_method='fdr_bh', sort_by='pval_mw'):
subsets = [group[feature] for val, group in grouped]
assert len(subsets) == 2
nums = grouped.size().values
u, pval_mw = stats.mannwhitneyu(subsets[0], subsets[1])
u, pval_mw = stats.mannwhitneyu(subsets[0], subsets[1], method='exact')
roc_auc = u/(nums[0]*nums[1])
roc_auc = roc_auc if roc_auc > 0.5 else 1 - roc_auc
mw_r = 2*roc_auc - 1
Expand Down
3 changes: 2 additions & 1 deletion patchseq_utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ def plot_subclass_focus(df, y, x, ax, subclasses, label=None, cluster="t-type",
palette_fine=palette_fine, palette=palette)
args.update(**kwargs)
utils.plot_box_cluster_feature(data, y, x, x_fine=cluster, ax=ax, pairs=None, **args)
else:
utils.outline_boxplot(ax)
if pairs is not None:
utils.plot_test_bars(df, y, x, test=test, group_vals=None, pairs=pairs, fdr_method=fdr_method,
ax=ax, cutoff=cutoff, label=None)
utils.outline_boxplot(ax)
ax.set_xlabel(None)

def plot_scatter(*args, legend=False, figsize=(8,8), **kwargs):
Expand Down

0 comments on commit f45eb84

Please sign in to comment.