README.md in mspire-0.10.7.1 vs README.md in mspire-0.10.7.2
- old
+ new
@@ -54,15 +54,26 @@
#### reading
```ruby
require 'mspire/mzml'
+# get the intensity of the highest peak from each spectrum
+intensities = Mspire::Mzml.foreach(mzml_file).map do |spectrum|
+ spectrum.intensities.max
+end
+
+# open the file for other operations
Mspire::Mzml.open(mzml_file) do |mzml|
+ # read each spectra
+ mzml.each do |spectrum|
+ # do something with each spectrum ...
+ end
- # random access by index or id (even if file wasn't indexed)
+ # or random access by index or id (even if file wasn't indexed)
spectrum = mzml[0]
spectrum = mzml["controllerType=0 controllerNumber=1 scan=2"]
+ # some things to do with a spectrum
spectrum.mzs
spectrum.intensities
# first 5 peaks
spectrum.peaks[0,5].each do |mz, intensity|