cheminfo / mass-tools

Various projects dealing with molecular formula
https://cheminfo.github.io/mass-tools/
MIT License
7 stars 0 forks source link

feat(ms-spectrum): Charge is not calcluated on peaks anymore #184

Closed lpatiny closed 5 months ago

lpatiny commented 5 months ago

Calculating the charge of peaks is a limiting step and therefore it is better to calculate on a selection of peaks when needed.

Before you could have a code like const bestPeaks = spectrum.getBestPeaks()

Now it should be done in 2 steps if you need the charge:

const bestPeaks = spectrum.getBestPeaks()
spectrum.getSelectedPeaksWithCharge(bestPeaks)