Skip to content

Commit

Permalink
bug: remove include_groups flag
Browse files Browse the repository at this point in the history
this does not work with all versions of pandas
  • Loading branch information
jcharkow committed Mar 28, 2024
1 parent aab89fe commit a1c38f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions massdash/loaders/access/OSWDataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def getIdentifiedPrecursors(self, qvalue: float = 0.01, run: Optional[str] = Non
WHERE SCORE_MS2.QVALUE <= {qvalue} AND PRECURSOR.DECOY = 0 AND SCORE_PEPTIDE.QVALUE <= {qvalue} AND SCORE_PROTEIN.QVALUE <= {qvalue} and SCORE_MS2.RANK == 1"""
df = pd.read_sql(stmt, self.conn)
df = df.merge(self.runHashTable, left_on='RUN_ID', right_on='ID')
return df[['RUN_NAME', 'Precursor']].groupby('RUN_NAME').apply(lambda x: set(x['Precursor']), include_groups=False).to_dict()
return df[['RUN_NAME', 'Precursor']].groupby('RUN_NAME').apply(lambda x: set(x['Precursor'])).to_dict()

def getIdentifiedPrecursorIntensities(self, qvalue: float = 0.01, run: Optional[str] = None, precursorLevel=False):
if isinstance(run, str):
Expand Down Expand Up @@ -568,7 +568,7 @@ def getIdentifiedPeptides(self, qvalue: float = 0.01, run: Optional[str] = None)
WHERE SCORE_PEPTIDE.QVALUE <= {qvalue} AND PEPTIDE.DECOY = 0 """
df = pd.read_sql(stmt, self.conn)
df = df.merge(self.runHashTable, left_on='RUN_ID', right_on='ID')
return df[['RUN_NAME', 'Peptide']].groupby('RUN_NAME').apply(lambda x: set(x['Peptide']), include_groups=False).to_dict()
return df[['RUN_NAME', 'Peptide']].groupby('RUN_NAME').apply(lambda x: set(x['Peptide'])).to_dict()

def getIdentifiedProteins(self, qvalue: float = 0.01, run: Optional[str] = None) -> Union[set, Dict[str, set]]:
if isinstance(run, str):
Expand All @@ -589,7 +589,7 @@ def getIdentifiedProteins(self, qvalue: float = 0.01, run: Optional[str] = None)
WHERE SCORE_PROTEIN.QVALUE <= {qvalue} AND PROTEIN.DECOY = 0 """
df = pd.read_sql(stmt, self.conn)
df = df.merge(self.runHashTable, left_on='RUN_ID', right_on='ID')
return df[['RUN_NAME', 'Protein']].groupby('RUN_NAME').apply(lambda x: set(x['Protein']), include_groups=False).to_dict()
return df[['RUN_NAME', 'Protein']].groupby('RUN_NAME').apply(lambda x: set(x['Protein'])).to_dict()

def getSoftware(self):
return "OpenSWATH"
Expand Down

0 comments on commit a1c38f0

Please sign in to comment.