Skip to content

Commit 86aa18c

Browse files
committed
update _prep_data and auto run in __init__
1 parent 3cf220a commit 86aa18c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

screenpro/dashboard/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,23 @@ def _get_html(self, p):
3838

3939
class DrugScreenDashboard(DataDashboard):
4040

41-
def __init__(self, screen, treated, untreated, t0='T0', threshold=3, ctrl_label='negative_control',run_name='auto'):
41+
def __init__(
42+
self, screen, treated, untreated,
43+
t0='T0', threshold=3, ctrl_label='negative_control',
44+
run_name='auto',
45+
score_col='score', pvalue_col='pvalue'
46+
):
4247
self.screen = screen
4348
self.threshold = threshold
4449
self.ctrl_label = ctrl_label
4550
self.run_name = run_name
4651
self.gamma_score_name = f'gamma:{untreated}_vs_{t0}'
4752
self.rho_score_name = f'rho:{treated}_vs_{untreated}'
48-
self.df = None
53+
self.df = self._prep_data(screen, score_col=score_col, pvalue_col=pvalue_col)
4954
self.plots = {}
5055
super().__init__()
5156

52-
def prep_data(self,screen, score_col='score', pvalue_col='pvalue'):
57+
def _prep_data(self,screen, score_col='score', pvalue_col='pvalue'):
5358

5459
gamma = screen.getPhenotypeScores(
5560
phenotype_name=self.gamma_score_name,
@@ -81,7 +86,7 @@ def prep_data(self,screen, score_col='score', pvalue_col='pvalue'):
8186
'-log10(gamma_pvalue)': np.log10(gamma.loc[rho.index,pvalue_col]) * -1,
8287
})
8388

84-
self.df = df
89+
return df
8590

8691
def _plot_scatter(
8792
self,

0 commit comments

Comments
 (0)