Hi wenshifu
It seems that the output file of your mass spectrometer does not include which element the measured mass is. iolite does not assume which element it is (e.g. mass204 could be Pb or Hg). You can however get iolite to determine the element from the most abundant isotope at that mass using iolite's builtin periodic table data:
for ch in data.timeSeriesList(data.Input):
if ch.name == 'TotalBeam':
continue
mass = float(ch.property('Mass'))
mass = round(mass)
# Find isotopes with this mass
matches = {}
for el, d in data.elements.items():
for iso in d['isotopes']:
if iso['massNumber'] == mass:
matches[el] = iso['abundance']
#For matches, use most abundant to label channel
sorted_matches = sorted(matches, key=lambda x:x[1])
print(f'Changing {ch.name} element to {sorted_matches[0]}')
ch.setProperty('Element', sorted_matches[0])
If you copy and paste those lines of code into iolite's Python Workspace, and save it as a new script (using the Save As button at the top of the Python Workspace), it will fill in the element property of each of your channels. If the script picks an incorrect element (sometimes we don't measure the most abundant element at a particular mass) you can manually change this in the Channels Browser by entering the following in the Python Console:
data.timeSeries('nameOfChannel').setProperty('Element', 'Symbol')
where nameOfChannel
would be the name of the channel you want to change, and Symbol
is the element symbol you want to assign to this channel.
Sorry that this is a bit manual, but it would be ideal if the mass spec data included the element information in the export file. We'll add a user interface in the future so that you don't have to do this via the python workspace/console.
Please let me know if that doesn't work.
-Bence