Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutoff parameterisation in Gaussian Chromatogram #192

Open
sdrogers opened this issue Oct 9, 2020 · 2 comments
Open

Cutoff parameterisation in Gaussian Chromatogram #192

sdrogers opened this issue Oct 9, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@sdrogers
Copy link
Collaborator

sdrogers commented Oct 9, 2020

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:

Screenshot 2020-10-09 at 09 15 28

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 the GaussianChromatogramSampler has the intensity in its sample 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?

@joewandy joewandy added question Further information is requested enhancement New feature or request labels Nov 13, 2020
@joewandy
Copy link
Member

Is it easy to do @vinnydavies? Can we close this?

@vinnydavies
Copy link
Collaborator

Should be pretty each to do. Need to do the following

  • add a parameter noise_level to sample method in GaussianChromatogramSampler
  • in the sample method, work out what cut-off in FunctionalChromatogram causes the intensity to go below noise_level
  • put that cut-off value into the returned chromatogram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants