rformassspectrometry / MetaboAnnotation

High level functionality to support and simplify metabolomics data annotation.
https://rformassspectrometry.github.io/MetaboAnnotation/
12 stars 9 forks source link

feat: add .group_standards_iteration function #106

Closed philouail closed 9 months ago

philouail commented 9 months ago

New function referring to issue #105.

This function iterates through the input matrix of compound m/z (with multiple adducts) and compounds names as row names.

Compounds are grouped if their difference is superior to the min_diff input from the user.

Users should be aware that because the function iterates through x, the compound at the bottom of the list is more complicated to group, and there's a possibility that some compounds will not be grouped with others. We advise increasing nstd and randomizing x to see if it can resolve this problem.

I will also study a bit more on how to improve this function to prevent very small groups or compounds to be left alone, either by randomizing, or ordering the matrix in some way before starting the iteration. Edit: Another function has been added to be used together, it will randomize and group until there is enough samples per groups.

Other strategies of grouping (not iterating through a matrix) might also be developed.

lastly, if anyone as a better idea for the name I am fully open to suggestion !

philouail commented 9 months ago

Minors fixes updated