-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Trying to access and plot my total ion chromatogram is not working. It does not seem to recognise it for my data. I exported my data from mzmine 3, and there definitely should be a TIC present. Has anyone had a similar issue? How do I access my chromatogram?
Issue using JupyterLab on Ubuntu 20.04.4.
My CODE:
mzml_basename = os.path.basename("22Jun0804.mzML")
pf = Factory()
pf.new_plot()
pf.add(run["TIC"].peaks(), color=(0, 0, 0), style="lines", title=mzml_basename)
pf.save(
"chromatogram_{0}.html".format(mzml_basename),
layout={"xaxis": {"title": "Retention time"}, "yaxis": {"title": "TIC"}},
)
ERROR OUTPUT:
StopIteration Traceback (most recent call last)
Input In [24], in <cell line: 4>()
2 pf = Factory()
3 pf.new_plot()
----> 4 pf.add(run["TIC"].peaks(), color=(0, 0, 0), style="lines", title=mzml_basename)
5 pf.save(
6 "chromatogram_{0}.html".format(mzml_basename),
7 layout={"xaxis": {"title": "Retention time"}, "yaxis": {"title": "TIC"}},
8 )
File ~/anaconda3/lib/python3.9/site-packages/pymzml/run.py:198, in Reader.getitem(self, identifier)
196 except:
197 pass
--> 198 spectrum = self.info["file_object"][identifier]
199 spectrum.calling_instance = self
200 if isinstance(spectrum, spec.Spectrum):
File ~/anaconda3/lib/python3.9/site-packages/pymzml/file_interface.py:101, in FileInterface.getitem(self, identifier)
90 """
91 Access the item with id 'identifier' in the file.
92
(...)
97 data (str): text associated with the given identifier
98 """
99 # if type(self.offset_dict) == dict:
100 # self.offset_dict.update(self.file_handler.offset_dict)
--> 101 return self.file_handler[identifier]
File ~/anaconda3/lib/python3.9/site-packages/pymzml/file_classes/standardMzml.py:103, in StandardMzml.getitem(self, identifier)
99 spectrum = spec.Chromatogram(
100 element, measured_precision=5e-6
101 )
102 elif event == "STOP":
--> 103 raise StopIteration
105 elif identifier in self.offset_dict:
107 start = self.offset_dict[identifier]
StopIteration: