pymzml / pymzML

pymzML - an interface between Python and mzML Mass spectrometry Files
https://pymzml.readthedocs.io/en/latest/
MIT License
163 stars 92 forks source link

Errors in example scripts #43

Closed SJGolden closed 6 years ago

SJGolden commented 8 years ago

Admittedly very new to python and pymzml, but I'm trying to run the example scripts and I can't get any of them to work properly. For example, PlotASpec.py is throwing this:

%run "c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py"

UnboundLocalError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py in () 33 34 if name == 'main': ---> 35 main()

c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py in main(file) 27 for spec in run: 28 p.newPlot() ---> 29 p.add(spec.peaks, color=(200,0,0), style='squares') 30 p.add(spec.centroidedPeaks, color=(0,0,0), style='sticks') 31 p.add(spec.reprofiledPeaks, color=(25,0,200), style='circles')

C:\Users\Rachelle Jacobson\Desktop\Python Extensions\pymzML-master\pymzML-master\pymzml\plot.py in add(self, data, color, style, mzRange, opacity, name, plotNum) 314 'color' : 'rgb'+str(color), 315 'width' : 1, --> 316 #'shape' : shape 317 }, 318 'fill' : filling,

UnboundLocalError: local variable 'shape' referenced before assignment


And extractIonChromatogram.py is throwing this:

%run "c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py"

KeyError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in () 41 42 if name == 'main': ---> 43 main()

c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in main(verbose) 34 if matchList != []: 35 for mz,I in matchList: ---> 36 timeDependentIntensities.append( [ spectrum['scan time'], I , mz ]) 37 print('RT \ti \tmz') 38 for rt, i, mz in timeDependentIntensities:

KeyError: 'scan time'


%run "c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py"

KeyError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in () 41 42 if name == 'main': ---> 43 main()

c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in main(verbose) 34 if matchList != []: 35 for mz,I in matchList: ---> 36 timeDependentIntensities.append( [ spectrum['scan time'], I , mz ]) 37 print('RT \ti \tmz') 38 for rt, i, mz in timeDependentIntensities:

KeyError: 'scan time'

Can someone help me figure out what I'm doing wrong? If the example scripts wont work surely any real data wouldn't either so I'm stuck.

fu commented 8 years ago

Hi Rachel,

Sorry for the very late reply. I will have a closer look in the next days.

Best regards,

Christian

On 26 Apr 2016, at 18:09, rjacobsonGWU notifications@github.com wrote:

Admittedly very new to python and pymzml, but I'm trying to run the example scripts and I can't get any of them to work properly. For example, PlotASpec.py is throwing this:

%run "c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py"

UnboundLocalError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py in () 33 34 if name == 'main': ---> 35 main()

c:\users\rachel~1\appdata\local\temp\tmpjp_r1v.py in main(file) 27 for spec in run: 28 p.newPlot() ---> 29 p.add(spec.peaks, color=(200,0,0), style='squares') 30 p.add(spec.centroidedPeaks, color=(0,0,0), style='sticks') 31 p.add(spec.reprofiledPeaks, color=(25,0,200), style='circles')

C:\Users\Rachelle Jacobson\Desktop\Python Extensions\pymzML-master\pymzML-master\pymzml\plot.py in add(self, data, color, style, mzRange, opacity, name, plotNum) 314 'color' : 'rgb'+str(color), 315 'width' : 1, --> 316 #'shape' : shape 317 }, 318 'fill' : filling,

UnboundLocalError: local variable 'shape' referenced before assignment

And extractIonChromatogram.py is throwing this:

%run "c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py"

KeyError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in () 41 42 if name == 'main': ---> 43 main()

c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in main(verbose) 34 if matchList != []: 35 for mz,I in matchList: ---> 36 timeDependentIntensities.append( [ spectrum['scan time'], I , mz ]) 37 print('RT \ti \tmz') 38 for rt, i, mz in timeDependentIntensities:

KeyError: 'scan time'

%run "c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py"

KeyError Traceback (most recent call last) c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in () 41 42 if name == 'main': ---> 43 main()

c:\users\rachel~1\appdata\local\temp\tmpgl7nnu.py in main(verbose) 34 if matchList != []: 35 for mz,I in matchList: ---> 36 timeDependentIntensities.append( [ spectrum['scan time'], I , mz ]) 37 print('RT \ti \tmz') 38 for rt, i, mz in timeDependentIntensities:

KeyError: 'scan time'

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

JB-MS commented 7 years ago

I do not know if this is solved, but have you tried 'scan start time' instead?

JB-MS commented 6 years ago

Closed after a year idle time.