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

Visualization Enhancement #3

Open
alan-jarmusch opened this issue Oct 4, 2019 · 5 comments

Comments

@alan-jarmusch
Copy link

commented Oct 4, 2019

provide m/z labels for peaks >5% intensity

@mwang87 mwang87 changed the title enhancement Visualization Enhancement Oct 4, 2019
@bittremieux

This comment has been minimized.

Copy link

commented Oct 4, 2019

The plot might become pretty crowded if multiple peaks are close to each other though. Anyway:

spec = spec.scale_intensity(max_intensity=1)
for fragment_mz, fragment_in in zip(spec.mz, spec.intensity):
    if fragment_in >= 0.05:
        spec.annotate_mz_fragment(fragment_mz, None, 0.1, 'Da')
@schymane

This comment has been minimized.

Copy link

commented Oct 5, 2019

If you select the most intense peak within a certain window (e.g. 10 mz, or scale the window with the max(mz) so it's a larger window for higher mz spectra) for annotation, you will be able to avoid most overlap automatically, but still be informative (at least those values are what worked for us in R). Depends how you wish to orient the text. I piggybacked off the satellite peak filtering in RMassBank:
https://github.com/schymane/ReSOLUTION/blob/master/R/MS1_functions.R#L115

@sdrogers

This comment has been minimized.

Copy link
Collaborator

commented Oct 5, 2019

I could easily implement Emma's suggestion within the app...

@sdrogers

This comment has been minimized.

Copy link
Collaborator

commented Oct 6, 2019

Done - it's a bit messy, but we can tidy up.

  • Plots just 2dp of mz
  • Doesn't plot things too close in mz to one another
  • Width (for exclusion) is calculated based upon min and max mz range to ensure zoomed in regions can still get plenty of labels
@schymane

This comment has been minimized.

Copy link

commented Oct 6, 2019

Can we have 4 dp please? Or an option to add more than 2? It's essential for interpretation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.