Skip to content

Commit

Permalink
use dynamic maldi msms mode key instead of hardcoded key
Browse files Browse the repository at this point in the history
  • Loading branch information
gtluu committed Jun 3, 2024
1 parent 09e5b66 commit e1d72c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions pyTDFSDK/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,10 @@ def get_maldi_tsf_data(self):
self.ms_level = 1
# MS/MS
elif int(frames_dict['MsMsType']) in [2, 8, 9]:
if self.tsf_data.analysis['GlobalMetadata']['AcquisitionSoftwareVersion'] == '5.0.9':
msms_mode = self.tsf_data.analysis['Properties'][(self.tsf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tsf_data.analysis['Properties']['Property'] == 124)].to_dict(orient='records')[0]['Value']
else:
msms_mode = self.tsf_data.analysis['Properties'][(self.tsf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tsf_data.analysis['Properties']['Property'] == 41)].to_dict(orient='records')[0]['Value']
msms_mode_id = self.tsf_data.analysis['PropertyDefinitions'][(self.tsf_data.analysis['PropertyDefinitions']['PermanentName'] ==
'Mode_ScanMode')].to_dict(orient='records')[0]['Id']
msms_mode = self.tsf_data.analysis['Properties'][(self.tsf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tsf_data.analysis['Properties']['Property'] == msms_mode_id)].to_dict(orient='records')[0]['Value']
framemsmsinfo_dict = self.tsf_data.analysis['FrameMsMsInfo'][self.tsf_data.analysis['FrameMsMsInfo']['Frame'] ==
self.frame].to_dict(orient='records')[0]
# MALDI MS/MS, coded as MRM in the schema
Expand Down Expand Up @@ -630,12 +628,11 @@ def get_maldi_tdf_data(self):
self.scan_type = 'MS1 spectrum'
self.ms_level = 1
elif int(frames_dict['MsMsType']) in [2, 8, 9]:
if self.tdf_data.analysis['GlobalMetadata']['AcquisitionSoftwareVersion'] == '5.0.9':
msms_mode = self.tdf_data.analysis['Properties'][(self.tdf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tdf_data.analysis['Properties']['Property'] == 124)].to_dict(orient='records')[0]['Value']
else:
msms_mode = self.tdf_data.analysis['Properties'][(self.tdf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tdf_data.analysis['Properties']['Property'] == 41)].to_dict(orient='records')[0]['Value']
msms_mode_id = self.tdf_data.analysis['PropertyDefinitions'][self.tdf_data.analysis['PropertyDefinitions']['PermanentName'] ==
'Mode_ScanMode'].to_dict(orient='records')[0]['Id']
msms_mode = self.tdf_data.analysis['Properties'][(self.tdf_data.analysis['Properties']['Frame'] == self.frame) &
(self.tdf_data.analysis['Properties']['Property'] == msms_mode_id)].to_dict(orient='records')[0][
'Value']
framemsmsinfo_dict = self.tdf_data.analysis['FrameMsMsInfo'][self.tdf_data.analysis['FrameMsMsInfo']['Frame'] ==
maldiframeinfo_dict['Frame']].to_dict(orient='records')[0]
# MALDI MS/MS, coded as MRM in the schema
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='pyTDFSDK',
version='0.3.7',
version='0.3.8',
description='Python wrapper for Bruker TDF-SDK',
url='https://github.com/gtluu/pyTDFSDK',
author='Gordon T. Luu',
Expand Down

0 comments on commit e1d72c6

Please sign in to comment.