fgcz / rawrr

Access Orbitrap data in R lang using C# mono assembly - bioconductor package
https://bioconductor.org/packages/rawrr/
52 stars 8 forks source link

How to access S/N values #46

Open papanlipotype opened 2 years ago

papanlipotype commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Sorry, my bad- of course I meant the noise value, not S/N... However, we always acquire our data in profile mode, from what I know, the recuced profile mode was only available on the LTQ-Orbi, not the Q-Exactives. Is there any way to get the noise values for profile mode data? Thanks, Cyrus

From: Tobias Kockmann @.> Sent: Monday, February 14, 2022 11:22 AM To: fgcz/rawrr @.> Cc: Dr. Cyrus Papan @.>; Mention @.> Subject: Re: [fgcz/rawrr] How to access S/N values (Issue #46)

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear @papanlipotypehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpapanlipotype&data=04%7C01%7Cpapan%40lipotype.com%7C9a477cbbe4c5496bdb6308d9efa4dfda%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804313674483243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=IrqJw65JUBpAaKgCLtwZd4Q2nE6Ro9tZnoA%2BAxqXwPI%3D&reserved=0,

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

- Reply to this email directly, view it on GitHubhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffgcz%2Frawrr%2Fissues%2F46%23issuecomment-1038908616&data=04%7C01%7Cpapan%40lipotype.com%7C9a477cbbe4c5496bdb6308d9efa4dfda%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804313674483243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6SvtL%2Be2MPqKQiAne9cZJ3J%2BtbdBXmLL4xYoqwStFkI%3D&reserved=0, or unsubscribehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARGKATHEZZZLCE3W3YRWZGDU3DJS3ANCNFSM5MENH3PA&data=04%7C01%7Cpapan%40lipotype.com%7C9a477cbbe4c5496bdb6308d9efa4dfda%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804313674483243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=UTLL0MBKczJ1Tr4GhEk9LcBA5L6Pn3Pd%2FraLswMrMbs%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cpapan%40lipotype.com%7C9a477cbbe4c5496bdb6308d9efa4dfda%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804313674483243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=RO%2BWBYppmZ6X7n2rEbVwAEFkjz556kRWjgPu5UsbLGM%3D&reserved=0 or Androidhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cpapan%40lipotype.com%7C9a477cbbe4c5496bdb6308d9efa4dfda%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804313674639461%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=SV7X1t3bwbEW3dR05ATiMOYibGfzKV4Hco0Tz6GMsdA%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

[https://www.lipotype.com/cms/wp-content/uploads/2020/07/lipotype_logo_signatur-e1593700444849.png] https://www.lipotype.com

Lipotype GmbH Tatzberg 47 01307 Dresden Germany

Tel.: +49 351 796 5345 Fax: +49 351 796 5349 Email: @.**@.> Web: www.lipotype.comhttps://www.lipotype.com/

Follow us on [LinkedIn] https://www.linkedin.com/company/lipotype/ [Twitter] https://twitter.com/lipotype_gmbh/ [Instagram] https://www.instagram.com/lipotype_gmbh/ [Facebook] https://www.facebook.com/lipotype/ , and subscribe to our newsletterhttps://www.lipotype.com/mailing-list/ to receive the latest news about lipidomics research and Lipotype.

VAT ID: DE282974828 County Court Dresden HRB 31124 Managing Directors: Prof. Dr. Kai Simons (CEO), Dr. Oliver Uecke (COO) and Dr. Christian Klose (CTO)

This message is intended for the addressee only as it contains private and confidential information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to comply with the above and to inform the sender immediately of any errors in transmission.

tobiasko commented 2 years ago

Apparently reduced profile mode is what the Q Exactive series uses when you select profile mode in the instrument method. see https://github.com/fgcz/rawrr/issues/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 commented 2 years ago

Hi Tobias, Yes, the noise value is definitely written to the raw files, as we read it out with out own raw-converter. We had just discovered the rawrr library (I guess it is still pretty new after all). It would be very useful if that could become available for profile mode in rawrr too. Thanks for your help and replies, Cyrus

From: Tobias Kockmann @.> Sent: Monday, February 14, 2022 2:11 PM To: fgcz/rawrr @.> Cc: Dr. Cyrus Papan @.>; Mention @.> Subject: Re: [fgcz/rawrr] How to access S/N values (Issue #46)

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Apparently reduced profile mode is what the Q Exactive series uses when you select profile mode in the instrument method. see #37https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffgcz%2Frawrr%2Fissues%2F37&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NFxH8Hw1YwguFjSwVPLkMkvCPuWxK%2B%2FEaXFgCk%2FxKWc%3D&reserved=0. 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 #37https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffgcz%2Frawrr%2Fissues%2F37&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NFxH8Hw1YwguFjSwVPLkMkvCPuWxK%2B%2FEaXFgCk%2FxKWc%3D&reserved=0).

@cpansehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcpanse&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Z4maVY8560q%2F%2BU4oBn5%2FuLUBdeXCQv2jqzRWFIWxjyI%3D&reserved=0 We should really push the code changes to make this stream available!

- Reply to this email directly, view it on GitHubhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffgcz%2Frawrr%2Fissues%2F46%23issuecomment-1039068984&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=j4clOYEEwEoC3PbRVAjr1gQ0Hf3VDAJSd8m8XufxMSc%3D&reserved=0, or unsubscribehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARGKATGXTDJQZS2TUUVCDLDU3D5OJANCNFSM5MENH3PA&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jXmmFCxclGnBBW0dPlttrGAQgON6YjGDP9u6HsN5wlk%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=XPvtakMKv61G4c6w6xKQduhBvgZRpntot7zd6EuviqM%3D&reserved=0 or Androidhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cpapan%40lipotype.com%7C8f094581bef54861506608d9efbec9e5%7C7b048e80fe7d4ef8b97cc5d9b777f519%7C1%7C0%7C637804424977146107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Bit8YACCnUWg4bc0K8N3SeDnfgdz%2FkGcoxhA6fXaAP8%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

[https://www.lipotype.com/cms/wp-content/uploads/2020/07/lipotype_logo_signatur-e1593700444849.png] https://www.lipotype.com

Lipotype GmbH Tatzberg 47 01307 Dresden Germany

Tel.: +49 351 796 5345 Fax: +49 351 796 5349 Email: @.**@.> Web: www.lipotype.comhttps://www.lipotype.com/

Follow us on [LinkedIn] https://www.linkedin.com/company/lipotype/ [Twitter] https://twitter.com/lipotype_gmbh/ [Instagram] https://www.instagram.com/lipotype_gmbh/ [Facebook] https://www.facebook.com/lipotype/ , and subscribe to our newsletterhttps://www.lipotype.com/mailing-list/ to receive the latest news about lipidomics research and Lipotype.

VAT ID: DE282974828 County Court Dresden HRB 31124 Managing Directors: Prof. Dr. Kai Simons (CEO), Dr. Oliver Uecke (COO) and Dr. Christian Klose (CTO)

This message is intended for the addressee only as it contains private and confidential information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to comply with the above and to inform the sender immediately of any errors in transmission.

tobiasko commented 2 years ago

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

Linda24bc commented 1 week ago

I was wondering if the noise value can be extract from the raw file now with readSpectrum? Thank you

cpanse commented 1 week ago

I was wondering if the noise value can be extract from the raw file now with readSpectrum? Thank you

sorry not yet