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

How to access S/N values #46

Open
papanlipotype opened this issue Jan 17, 2022 · 5 comments
Open

How to access S/N values #46

papanlipotype opened this issue Jan 17, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@papanlipotype
Copy link

Dear all,
is there a way of accessing the S/N values from a readSpectrum-Object? I cant seem to find the info in the list.
Thanks

@tobiasko
Copy link
Collaborator

Dear @papanlipotype,

the S/N values are never stored in the raw file. They need to be calculated. This is for instance done by the plot method for rawrrSpectrum objects in case SN = TRUE:

plot.rawrrSpectrum <- function(x, relative = TRUE, centroid = FALSE, SN = FALSE,
                              legend = TRUE, diagnostic = FALSE, ...){

    stopifnot(is.rawrrSpectrum(x))

    if (centroid) {

        stopifnot(x$centroidStream)

        if (SN) {

            plot(x = x$centroid.mZ, y = x$centroid.intensity/x$noise,
                 type = "h",
                 xlim = x$massRange,
                 xlab = "Centroid m/z",
                 ylab = "Centroid Signal/Noise",
                 frame.plot = FALSE, ...
            )

Currently the plot function only supports this for centroided data, although it has meanwhile become clear that the noise attribute is also available for (reduced) profile mode data.

But you could easily write a function that combines data retrieval and S/N calculation.

Hope this helps,
Tobi

@papanlipotype
Copy link
Author

papanlipotype commented Feb 14, 2022 via email

@tobiasko
Copy link
Collaborator

tobiasko commented Feb 14, 2022

Apparently reduced profile mode is what the Q Exactive series uses when you select profile mode in the instrument method. see #37. I also thought that full profile mode would be triggered by selecting profile mode acquisition, but that doesn't seem to be the case.

I had a look at recent data from our Q Exactive for a "FTMS + p NSI Full ms [350.0000-1500.0000]" scan. rawrr just gives access to the intensity and m/z values (no noise attributes). But I guess the noise was written to the raw file. Most likely to a different data stream that our managed code currently ignores (again, have a look at issue #37).

@cpanse We should really push the code changes to make this stream available!

btw: I already filed a GitHub project for this: Support for reduced profile mode spectra

@papanlipotype
Copy link
Author

papanlipotype commented Feb 14, 2022 via email

@tobiasko tobiasko added the enhancement New feature or request label Feb 17, 2022
@tobiasko
Copy link
Collaborator

tobiasko commented Feb 17, 2022

ok. We will try to do our best to make this happen in the near future, since quite some people requested this already!

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

No branches or pull requests

3 participants