Skip to content

Commit

Permalink
Merge pull request #67 from ArcInstitute/cli
Browse files Browse the repository at this point in the history
Fix bugs and improve code
  • Loading branch information
abearab authored Jun 19, 2024
2 parents 5833dcc + 84435ec commit da32a1f
Show file tree
Hide file tree
Showing 9 changed files with 458 additions and 392 deletions.
4 changes: 2 additions & 2 deletions screenpro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from . import load
from . import dashboard

from .ngs import Counter
from .ngs import GuideCounter
from .assays import PooledScreens, GImaps

__version__ = "0.3.4"
__version__ = "0.3.5"
__author__ = "Abe Arab"
__email__ = '[email protected]' # "[email protected]"
9 changes: 5 additions & 4 deletions screenpro/assays.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def calculateDrugScreen(self, t0, untreated, treated, db_untreated, db_treated,
runPhenoScoreForReplicate(
self.adata, x_label = x_label, y_label = y_label, score = score_label,
transformation=self.fc_transformation,
growth_factor_table=growth_factor_table
growth_factor_table=growth_factor_table,
**kwargs
).add_prefix(f'{score_label}_')

for x_label, y_label, score_label in [
Expand Down Expand Up @@ -190,15 +191,15 @@ def calculateFlowBasedScreen(self, low_bin, high_bin, score_level, run_name=None
# save phenotype name for reference
self._add_phenotype_results(f'delta:{delta_name}')

def getPhenotypeScores(self, score_name, run_name='auto', threshold=5, ctrl_label='negCtrl', target_col='target',pvalue_column='ttest pvalue', score_column='score'):
def getPhenotypeScores(self, score_name, run_name='auto', threshold=5, ctrl_label='control', target_col='target',pvalue_column='ttest pvalue', score_column='score'):
"""
Get phenotype scores for a given score level
Args:
run_name (str): name of the phenotype calculation run to retrieve
score_name (str): name of the score to retrieve, e.g. 'gamma', 'tau', 'rho', 'delta'
threshold (float): threshold for filtering significant hits, default is 5
ctrl_label (str): label for the negative control, default is 'negCtrl'
ctrl_label (str): label for the negative control, default is 'control'
target_col (str): column name for the target gene, default is 'target'
pvalue_column (str): column name for the p-value, default is 'ttest pvalue'
score_column (str): column name for the score, default is 'score'
Expand Down Expand Up @@ -243,7 +244,7 @@ def getPhenotypeScores(self, score_name, run_name='auto', threshold=5, ctrl_labe

return out

def getAnnotatedTable(self, run_name='auto', threshold=5, ctrl_label='negCtrl', target_col='target',pvalue_column='ttest pvalue', score_column='score'):
def getAnnotatedTable(self, run_name='auto', threshold=5, ctrl_label='control', target_col='target',pvalue_column='ttest pvalue', score_column='score'):
hit_dict = {
'gamma':{
'up_hit':'up_hit',
Expand Down
3 changes: 2 additions & 1 deletion screenpro/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def load_cas9_sgRNA_library(library_path, library_type, sep='\t', index_col=0, p

## Evaluate library table and reformat columns for downstream analysis
# I would like to name the target column 'target' if it is named 'gene'!

#TODO: Add option to keep sublibrary column!

if library_type == "single_guide_design":
eval_columns = ['target', 'sgID', 'protospacer', 'sequence']

Expand Down
Loading

0 comments on commit da32a1f

Please sign in to comment.