Open jorainer opened 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?
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
)
But let's do that in a second step. Let's first work on your PR.
Okay. Hope that one is fine now. Sorry for messing up ;-)
Ultimate goal would be to have the adduct definitions in a table (easier to expand).
Watch this space: https://github.com/michaelwitting/adductDefinitions It will soon contain a .tsv file with the adduct definitions and their calculation.
Here is an example: adducts_pos.txt
Isn't something like that available in the CAMERA
package?
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
Ok, fine. FYI I am not familiar with any of these packages nor their status, sry.
No problem.
But the goal is then that you add this adduct definitions to MetaboCoreUtils
@michaelwitting, isn't it?
Yes, we can have the files in the inst
folder and load their content with .onLoad()
.
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.
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.
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.