vanmooylipidomics/LOBSTAHS

new lipid class in db

ricoderks opened this issue · 5 comments

Hi James,

Thanks for the great package for doing lipidomics in R! :-)
I have a problem generating a new database with a new lipid class. I would like to add some extra lipids to the database and started as a test how to do it with LPC lipids. For the LPC's I tried to add a new lipid class to the file LOBSTAHS_acyl_prop_ranges.csv. But, when I try to create the new database I get the this error:

Error in FUN(newX[, i], ...) : 
  object 'num_compounds.this_species' not found

In more detail what I did :
In the basic_component_matrix file I added :

  • LPC,8,19,0,1,8,1,0,0,0,0,0,0,0,0,IP_MAG

In the acyl_prop_ranges file I added :

  • two more columns called IP_MAG_min and IP_MAG_max, specifying which total carbon number and double bonds I want

In the addl_oxy_ranges file I added :

  • two more columns called IP_MAG_min and IP_MAG_max with values 0 and 4

In the adduct_ion_hierarchies file I added :

  • one more column called LPC and I took the values from the PC column

I looked at the code in generateLOBdbase and saw that the acyl ranges are only calculated for IP_DAG,FFA, TAG, and PUA. Is this correct or am I doing it wrong?

Cheers, Rico

Hi Rico,

You are correct: Acyl ranges in the initial release were calculated only for IP_DAG, FFA, TAG, and PUA. (This was why you were receiving the error.)

I just pushed some new code that should enable calculations for lyso lipids under a new lipid family ("IP_MAG," using your abbreviation). In the new default DB & tables I just pushed along with the code, I only created a single default IP_MAG class, LPC. But the code is now there and it should be easy for you to generate similar analogous lyso classes (LPE, LPG, etc.) if you desire. I've tested it a bit and have verified some of the LPC masses, but please let me know if you find problems in the mass calculations. I defined the IP_MAG "backbone" as:

  • LPC,8,19,0,1,7,1,0,0,0,0,0,0,0,0,IP_MAG

This is one less oxygen atom than what you had used:

  • LPC,8,19,0,1,8,1,0,0,0,0,0,0,0,0,IP_MAG

Please let me know if this seems correct; it is obviously all dictated by how generateLOBdbase() does its simulation.

You will have to reinstall the package; let me know if you have problems doing this.

Please let me know if this seems to work for you, and whether you find the masses correct. I will then close the ticket.

Glad you are finding LOBSTAHS useful!

Jamie

Also, I should add that we have not formally verified that the adduct hierarchy for a given group of lyso lipids is the same as the corresponding IP-DAG class.

Hi James,

Thanks for the quick addition! I tested creating a new database by copying the csv files to a new location and in generateLOBdbase() I pointed to these files. It looks like everything is created correctly, but I get four warning messages:

Warning messages:
1: In generateLOBdbase(polarity = c("positive", "negative"), gen.csv = TRUE,  :
  User specified external source for basic component composition matrix. Ensure .csv file is properly formatted and sufficient entries exist in other external files to support any additional adducts, lipid classes, or molecules.

2: In generateLOBdbase(polarity = c("positive", "negative"), gen.csv = TRUE,  :
  User specified external source for adduct ion hierarchy matrix. Ensure .csv file is properly formatted and sufficient entries exist in other external files to support any additional adducts, lipid classes, or molecules.

3: In generateLOBdbase(polarity = c("positive", "negative"), gen.csv = TRUE,  :
  User specified external source for in silico simulation acyl property ranges. Ensure .csv file is properly formatted and sufficient entries exist in other external files to support any additional adducts, lipid classes, or molecules.

4: In generateLOBdbase(polarity = c("positive", "negative"), gen.csv = TRUE,  :
  User specified external source for additional oxygen atoms to be considered. Ensure .csv file is properly formatted and sufficient entries exist in other external files to support any additional adducts, lipid classes, or molecules.

When I set everything to NULL, I don't get these warning messages.

Cheers, Rico

Hi James,

I just saw in your code that the warnings are there to inform the user. Sorry, should looked at your code first before posting this.
For the rest it works great :-)

Cheers, Rico

Awesome, no apologies necessary - sorry code didn't work right the first time!