lgatto/MSnbase — pull request #30 by sgibb (2014-04-08 10:24:46+00:00)
Title: add precursor normalization method for MS2 spectra

Dear Laurent,

this PR adds a `"precursor"` normalization method for the `Spectrum2` class:

```s
s2 <- new("Spectrum2", mz=1:5, intensity=1:5, precursorIntensity=10)
intensity(normalize(s2, method="precursor"))
# [1] 0.1 0.2 0.3 0.4 0.5
intensity(normalize(s2, method="precursor", precursorIntensity=20))
# [1] 0.05 0.10 0.15 0.20 0.25
```

Additionally I add some test cases for normalization of spectra in general.

Best wishes,

Sebastian