workflow4metabolomics / tools-metabolomics

Galaxy tools for metabolomics maintained by Workflow4Metabolomics
https://workflow4metabolomics.org/
GNU General Public License v3.0
25 stars 27 forks source link

Non-unique identifiers for ions #22

Closed melpetera closed 7 years ago

melpetera commented 8 years ago

Sometimes there are redundant ion identifiers, especially when using RT in minutes (for example "M123.32T11" for two different ions with mass 123.32 and RT 10.6 min and 11.4 min).

Since identifiers are meant to be unique, something must be done (currently users add more decimal places for mass, change RT in seconds and/or modify identifiers themselves).

lecorguille commented 7 years ago

Are we agree that it's important during the peaklist export (currently camera.annotate, camera.combinexannot and soon xcms.fillpeaks) ?

If so, do you want that those redundant ion identifiers to be spotted and corrected automatically by increasing the number of digit?

lecorguille commented 7 years ago

Crossref: https://github.com/workflow4metabolomics/camera/issues/11

lecorguille commented 7 years ago

Done for FillPeaks-2.0.8: https://github.com/workflow4metabolomics/xcms/blob/bfb80b96ab0497a8d1fd853b779a26897f765929/galaxy/xcms_fillpeaks/abims_xcms_fillPeaks.xml#L45

yguitton commented 7 years ago

just a note they're is a function called xcmss:::groupnames in xcms that can be used (with function(xcmsSet object, mzdec = 0, rtdec = 0, template = NULL) with that even if a duplicate name is found it will be converted to MxTy_z

lecorguille commented 7 years ago

@yguitton Good suggestion but ... how do you use groupnames

I try without template

ids <- groupnames(xset, mzdec = numDigitsMZ, rtdec = numDigitsRT, template = NULL)

but:

|  Error in strsplit(template[1], "[T_]") : non-character argument
|  Calls: getPeaklistW4M -> groupnames -> groupnames -> .local -> strsplit

Help is welcome because they isn't so much documentation 👎

lecorguille commented 7 years ago

@melpetera Is make.unique is enough? here

ids <- make.unique(paste0("M",round(groups[,1],numDigitsMZ),"T",round(groups[,4],numDigitsRT)))
lecorguille commented 7 years ago

@melpetera @yguitton UP!

melpetera commented 7 years ago

About make.unique: I would add the sep="_" argument because identifiers already have points in it. But I think this can do!

lecorguille commented 7 years ago

From xcms.group 2.1.1 and xcms.fillpeaks 2.1.1 as discussed here: https://github.com/workflow4metabolomics/xcms/issues/36

lecorguille commented 7 years ago

docker run -d -p 8080:80 quay.io/workflow4metabolomics/galaxy-workflow4metabolomics:beta

lecorguille commented 7 years ago

Available within the dev galaxy instance

melpetera commented 7 years ago

Tested on dev galaxy instance! It is ok for me.

lecorguille commented 7 years ago
lecorguille commented 7 years ago

Validated