Skip to content

Commit

Permalink
Merge pull request bigbio#19 from bigbio/dev
Browse files Browse the repository at this point in the history
Itraq_support
  • Loading branch information
ypriverol authored Oct 21, 2023
2 parents 3316266 + 9d53855 commit 1216e73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion python/quantmsio/quantms_io/core/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _fetch_msstats_feature(
key = None
if "LABEL FREE" in feature_dict["Channel"]:
key = peptidoform + ":_:" + str(charge) + ":_:" + feature_dict["Reference"]
elif "TMT" in feature_dict["Channel"]:
elif "TMT" in feature_dict["Channel"] or "ITRAQ" in feature_dict["Channel"]:
key = (
peptidoform
+ ":_:"
Expand Down
20 changes: 13 additions & 7 deletions python/quantmsio/quantms_io/core/openms.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ def get_intensity_map(
if experiment_type is not None and "LABEL FREE" in experiment_type.upper():
return self._get_intensity_map_lfq(df)
elif experiment_type is not None and "TMT" in experiment_type.upper():
return self._get_intensity_map_tmt(df)

return self._get_intensity_map_tmt_or_itraq(df,experiment_type)
elif experiment_type is not None and 'ITRAQ' in experiment_type.upper():
return self._get_intensity_map_tmt_or_itraq(df,experiment_type)
return self._get_intensity_map_lfq(
df
) # If not experiment type is provided, we assume it is label free
Expand Down Expand Up @@ -100,7 +101,7 @@ def _get_intensity_map_lfq(df):
return intensity_map

@staticmethod
def _get_intensity_map_tmt(df):
def _get_intensity_map_tmt_or_itraq(df,experiment_type):
"""
Get the intensity map for TMT experiments
:param df: pandas dataframe with the consensusxml data
Expand All @@ -115,10 +116,15 @@ def _get_intensity_map_tmt(df):
for column in intensity_columns:
if np.float64(row[f"{column}"]) > 0.0:
reference_file = row.file.split(".")[0]
channel = (
"TMT" + column.split("_")[1]
) # A TMT channel has in consesusXML the following format:
# tmt10plex_129N -> TMT129N
if "TMT" in experiment_type.upper():
channel = (
"TMT" + column.split("_")[1]
) # A TMT channel has in consesusXML the following format:
# tmt10plex_129N -> TMT129N
else:
channel = (
"ITRAQ" + column.split("_")[1]
)
key = (
row.sequence
+ ":_:"
Expand Down

0 comments on commit 1216e73

Please sign in to comment.