Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
exclude scanpy
Browse files Browse the repository at this point in the history
  • Loading branch information
abearab committed Dec 4, 2023
1 parent 0c0f8ef commit 87ab191
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions screenpro/plotting.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pandas as pd
import numpy as np
import scanpy as sc
import matplotlib.pyplot as plt
import matplotlib
from .utils import ann_score_df
# import scanpy as sc

# variables
almost_black = '#111111'
Expand Down Expand Up @@ -165,26 +165,27 @@ def plot_replicate_scatter(ax, adata, x, y, title):
- x and y are sample names in `adata.obs.index`.
- counts are automatically log1p transformed
"""
bdata = adata[[x, y], :].copy()

bdata.obs.index = [f'Replicate {str(r)}' for r in bdata.obs.replicate.to_list()]
x_lab, y_lab = [f'Replicate {str(r)}' for r in bdata.obs.replicate.to_list()]

sc.pp.log1p(bdata)
sc.pl.scatter(
bdata,
x_lab, y_lab,
legend_fontsize='xx-large',
palette=[almost_black, '#BFBFBF'],
color='targetType',
title=title,
size=5,
show=False,
ax=ax
)
ax.set_ylim(-1, 11)
ax.set_xlim(-1, 11)
ax.tick_params(axis='both', labelsize=10)
ax.get_legend().remove()

ax.grid(False)
pass
# bdata = adata[[x, y], :].copy()
#
# bdata.obs.index = [f'Replicate {str(r)}' for r in bdata.obs.replicate.to_list()]
# x_lab, y_lab = [f'Replicate {str(r)}' for r in bdata.obs.replicate.to_list()]
#
# sc.pp.log1p(bdata)
# sc.pl.scatter(
# bdata,
# x_lab, y_lab,
# legend_fontsize='xx-large',
# palette=[almost_black, '#BFBFBF'],
# color='targetType',
# title=title,
# size=5,
# show=False,
# ax=ax
# )
# ax.set_ylim(-1, 11)
# ax.set_xlim(-1, 11)
# ax.tick_params(axis='both', labelsize=10)
# ax.get_legend().remove()
#
# ax.grid(False)

0 comments on commit 87ab191

Please sign in to comment.