Skip to content

Commit

Permalink
Merge pull request #98 from isabelleliuu/master
Browse files Browse the repository at this point in the history
  • Loading branch information
abearab authored Nov 14, 2024
2 parents ea93151 + adfdb34 commit 02cd10d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion screenpro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
from .dashboard import DrugScreenDashboard


__version__ = "0.4.15"
__version__ = "0.4.16"
__author__ = "Abe Arab"
__email__ = '[email protected]' # "[email protected]"
25 changes: 16 additions & 9 deletions screenpro/assays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,22 +286,29 @@ def calculateFlowBasedScreen(self, low_bin, high_bin, score_level, run_name=None
run_name (str): name for the phenotype calculation run
**kwargs: additional arguments to pass to runPhenoScore
"""
if not run_name: run_name = score_level
if run_name in self.phenotypes.keys():
raise ValueError(f"Phenotype calculation run '{run_name}' already exists in self.phenoypes!")
else:
self.phenotypes[run_name] = {}
self.phenotypes[run_name]['config'] = {
'method':'ScreenPro2 - phenoscore',
'low_bin':low_bin,
'high_bin':high_bin,
'test':self.test,
'score_level':score_level,
}
self.phenotypes[run_name]['results'] = {}

# calculate phenotype scores
delta_name, delta = runPhenoScore(
self.adata, cond_ref=low_bin, cond_test=high_bin, n_reps=self.n_reps,
test=self.test, score_level=score_level,
**kwargs
)

if not run_name: run_name = score_level
# save all results into a multi-index dataframe
self.phenotypes[run_name] = pd.concat({
f'delta:{delta_name}': delta
}, axis=1)

# save phenotype name for reference
self._add_phenotype_results(f'delta:{delta_name}')

self._add_phenotype_results(run_name, f'delta:{delta_name}', delta)

def listPhenotypeScores(self, run_name='auto'):
"""
List available phenotype scores for a given run_name
Expand Down
4 changes: 4 additions & 0 deletions screenpro/phenoscore/_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
'rho':{
'up_hit':'resistance_hit',
'down_hit':'sensitivity_hit'
},
'delta':{
'up_hit':'up_hit',
'down_hit':'down_hit'
}
}

Expand Down

0 comments on commit 02cd10d

Please sign in to comment.