Skip to content

Commit

Permalink
refactor: add back searchResultAnalysis plots
Browse files Browse the repository at this point in the history
Refactor SearchResultAnalysisPlotter for plotting search results
  • Loading branch information
jcharkow committed Mar 26, 2024
1 parent e1c88dc commit 78165df
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 316 deletions.
8 changes: 4 additions & 4 deletions massdash/loaders/access/OSWDataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@ def getScoreTable(self,
DECOY,
RUN_ID
FROM {score_table}
INNER JOIN PRECURSOR ON {score_table}.FEATURE_ID = PRECURSOR.ID
INNER JOIN SCORE_MS2 ON {score_table}.FEATURE_ID = SCORE_MS2.FEATURE_ID
INNER JOIN FEATURE ON {score_table}.FEATURE_ID = FEATURE.ID
INNER JOIN PRECURSOR ON FEATURE.PRECURSOR_ID = PRECURSOR.ID
WHERE RANK == 1
'''
elif score_table in ['SCORE_MS2']:
Expand Down Expand Up @@ -778,11 +778,11 @@ def getScoreTable(self,
raise ValueError(f"Score table {score_table} not recognized or not yet implemented")

df = pd.read_sql(stmt, self.conn)
if context != 'global':
if context == 'global' and score_table in ['SCORE_PEPTIDE', 'SCORE_PROTEIN']: # no run name for global context
return df[['DECOY', 'SCORE']]
else:
df = df.merge(self.runHashTable, left_on='RUN_ID', right_on='ID')
return df[['RUN_NAME', 'DECOY', 'SCORE']]
else: # context is global, no runs associated
return df[['DECOY', 'SCORE']]


def get_score_tables(self):
Expand Down
311 changes: 0 additions & 311 deletions massdash/plotting/SearchResultAnalysisPlots.py

This file was deleted.

Loading

0 comments on commit 78165df

Please sign in to comment.