Open sdrogers opened 4 years ago
Is it easy to do @vinnydavies? Can we close this?
Should be pretty each to do. Need to do the following
noise_level
to sample method in GaussianChromatogramSampler
FunctionalChromatogram
causes the intensity to go below noise_level
We currently have this: https://github.com/sdrogers/vimms/blob/df473d640a0b02f547e0150ba234da62e438c665/vimms/Chromatograms.py#L136
When we make
GaussianChromatograms
here: https://github.com/sdrogers/vimms/blob/df473d640a0b02f547e0150ba234da62e438c665/vimms/ChemicalSamplers.py#L300 We pass 0 as the mean and sigma as the sd.Our chemical RTs are the start of the chromatogram, right?
Anyway, the cutoff is defined as a function of the ppf of the normal. This doesn't quite make sense, as it should be defined as the point at which the chromatogram disappears beneath the sea of noise. For example, here is the start of a group of isotopes of the same chemical in @mcbrider5002 data:
They all start at the same point as we'd expect from our code, but in reality we would see the most intense starting earliest. It also means that for really intense peaks we see steps as they start.
Would it be possible to make the cutoff a function of intensity? This wouldn't necessarily need to change in the
FunctionalChrmoatogram
because we pass the cutoff to that, and theGaussianChromatogramSampler
has the intensity in itssample
method:https://github.com/sdrogers/vimms/blob/df473d640a0b02f547e0150ba234da62e438c665/vimms/ChemicalSamplers.py#L283-L300
Any thoughts on the best way to achieve this? I.e. we want a cutoff such that the peak is effectively narrower when it has lower intensity...
We actually just return the un-normalised part of the Gaussian: https://github.com/sdrogers/vimms/blob/df473d640a0b02f547e0150ba234da62e438c665/vimms/Chromatograms.py#L156
This is all made a bit trickier by us defining the RT as the start of the peak, and not the, for the Gaussian ones, as the mean. Don't know how easy that would be to change?