rformassspectrometry / MetaboCoreUtils

Core utilities for metabolomics.
https://rformassspectrometry.github.io/MetaboCoreUtils/index.html
7 stars 6 forks source link

Transfer adduct definitions #3

Open jorainer opened 4 years ago

jorainer commented 4 years ago

Transfer the adduct definitions and functions from metabolomicsUtils.

@michaelwitting, can you create a new branch, add these functions and make a pull request?

I would suggest to put all these functions into a file adducts.R.

michaelwitting commented 4 years ago

I made a devel_michael branch which contains everything from metabolomicsUtils. Before we go on: Shall we have all individual adducts hardcoded (current version) or create a generic function and a file containing all the defintions?

jorainer commented 4 years ago

I think having the adduct definition in a file would be easier to extend it. This file could then be read automatically upon package loading and assigned to a variable which will then be available from within the package (see https://github.com/EuracBiomedicalResearch/CompoundDb/blob/master/R/zzz.R, the data.frame can then be accessed from within the package with the variable ADDUCTS)

jorainer commented 4 years ago

But let's do that in a second step. Let's first work on your PR.

michaelwitting commented 4 years ago

Okay. Hope that one is fine now. Sorry for messing up ;-)

jorainer commented 4 years ago

Ultimate goal would be to have the adduct definitions in a table (easier to expand).

michaelwitting commented 4 years ago

Watch this space: https://github.com/michaelwitting/adductDefinitions It will soon contain a .tsv file with the adduct definitions and their calculation.

michaelwitting commented 4 years ago

Here is an example: adducts_pos.txt

sgibb commented 4 years ago

Isn't something like that available in the CAMERA package?

michaelwitting commented 4 years ago

Yes, but we are harmonizing many different sources. CAMERA is also not up-to-date with the current XCMS version. This a first step to have them working together and move functions utilized by different packages into MetaboCoreUtils

sgibb commented 4 years ago

Ok, fine. FYI I am not familiar with any of these packages nor their status, sry.

michaelwitting commented 4 years ago

No problem.

jorainer commented 4 years ago

But the goal is then that you add this adduct definitions to MetaboCoreUtils @michaelwitting, isn't it?

michaelwitting commented 4 years ago

Yes, we can have the files in the inst folder and load their content with .onLoad().

michaelwitting commented 4 years ago

I don't know if you want the scripts that generate the textfiles in the package. It uses rcdk, which is quite a heavy dependency.

jorainer commented 4 years ago

Ideally, I would put the files into something like inst/txt and the scripts to create them into inst/scripts. Then they are included in the package (without being exported). That way we have everything bundled if we want to update/extend the definitions.