evanyeyeye / rainbow

Read chromatography and mass spectrometry binary files.
GNU General Public License v3.0
29 stars 16 forks source link

New to MS Analysis #20

Closed yipy0005 closed 6 months ago

yipy0005 commented 6 months ago

Hi, I'm the IT person for my lab and I have been tasked to obtained the detected masses and their intensities from a Agilent .D folder.

Could you provide me with the steps on how I could do so with Rainbow?

Thank you so much! :)

Best regards, Yew Mun

ekwan commented 6 months ago

Hi Yew! Welcome! Have you taken a look at the README and documentation? We're happy to help if that doesn't answer your questions.

yipy0005 commented 6 months ago

Hi Eugene,

Thank you so much for your reply!

I have looked at the README and documentation and tried:

import rainbow as rb
datadir = rb.read("mydata.D")
datafile = datadir.get_file("MSD1.MS")

After that, how could I get the mz data and their intensities from the variable, datafile?

ekwan commented 6 months ago

Hi, have you checked out our tutorial?

https://rainbow-api.readthedocs.io/en/latest/tutorial.html

yipy0005 commented 6 months ago

Yes, I have.

Would you be referring to this section:

times = datafile.xlabels
wavelengths = datafile.ylabels
absorbances = datafile.data

where xlabels are m/z values, ylabels are abundance/intensity values? 😊

ekwan commented 6 months ago

Yep, you get everything as numpy arrays. Any other specific questions?

yipy0005 commented 6 months ago

Ah, I see! Thank you so much! I think I have no questions for now. I'm so happy that you are very responsive.

Have a good day! 😊

ekwan commented 6 months ago

Good luck! Please feel free to reach out again if we can be helpful!

yipy0005 commented 6 months ago

Hi, sorry but I have just a few more naive questions pertaining to the results.

I have tried to run this:

import rainbow as rb
datadir = rb.read("tests/inputs/green.D")
datafile = datadir.get_file("MSD1.MS")

For datafile.xlabels, there is an array of values from 0.04725 to 147.69308333333333. For datafile.ylabels, there is 1 value in the array, which is 204. And for datafile.data, there is an array of values from 146 to 70968.

If xlabelsare m/z values, then a mass of 0.04725 doesn't correspond to any fragment. Could I ask then, how should I understand the values of xlabels, ylabels and data?

Thank you!