I am trying to plot a graph/chromatogram of the x and y-values located in time_dependent_intensities, but only the ones with the largest y-values.
run = pymzml.run.Reader(in_path)
time_dependent_intensities = []
for spectrum in run:
if spectrum.ms_level == 1:
has_peak_matches = spectrum.reduce(mz_range=(150,151))
if has_peak_matches != []:
for mz, I in has_peak_matches:
time_dependent_intensities.append(
[spectrum.scan_time_in_minutes(), I]
)
print("RT \ti")
for i in time_dependent_intensities:
print(i)
return
When I print i, I end up with a huge list of stuff like this ranging from 0 - 15 with about 5 different y-values per x-value:
[14.9929171, 21.0]
[14.9929171, 21.0]
[14.9929171, 20.0]
[14.9929171, 31.0]
[14.9929171, 25.0]
[14.9929171, 21.0]
[14.9929171, 18.0]
[14.9967165, 22.0]
[14.9967165, 26.0]
How do I access the lists [x,y] within the time_dependent_intensities list but only plot the ones that have the largest y value.