Skip to content

Commit

Permalink
Merge pull request #8 from theoplatt/master
Browse files Browse the repository at this point in the history
Pull serial number from GlobalMetadata
  • Loading branch information
mafreitas authored Apr 17, 2021
2 parents 3463d9f + ecb378d commit 79a5217
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tdf2mzml.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ def get_spectrum_dict(mzml_data_struct):
"Select Value from GlobalMetadata where key=\"AcquisitionDateTime\""
).fetchone()[0]

spectrum_dict['instrument_serial_number'] = mzml_data_struct['td'].conn.execute(
"Select Value from GlobalMetadata where key=\"InstrumentSerialNumber\""
).fetchone()[0]

spectrum_dict['mz_acq_range_lower'] = mzml_data_struct['td'].conn.execute(
"Select Value from GlobalMetadata where key=\"MzAcqRangeLower\""
).fetchone()[0]
Expand Down Expand Up @@ -487,6 +491,7 @@ def write_instrument_configuration_list(mzml_data_struct):
source = mzml_data_struct['writer'].Source(1, ["nanospray inlet", "quadrupole"])
analyzer = mzml_data_struct['writer'].Analyzer(2, ["time-of-flight"])
detector = mzml_data_struct['writer'].Detector(3, ["microchannel plate detector","photomultiplier"])
serial_number = mzml_data_struct['data_dict']['instrument_serial_number']

instrument_configurations.append(
mzml_data_struct['writer'].InstrumentConfiguration(
Expand All @@ -497,7 +502,7 @@ def write_instrument_configuration_list(mzml_data_struct):
detector
],
params=[
{"instrument serial number": "1854399.86"}
{"instrument serial number": serial_number}
]
)
)
Expand Down

0 comments on commit 79a5217

Please sign in to comment.