RECETOX / MFAssignR

The MFAssignR package was designed for multi-element molecular formula (MF) assignment of ultrahigh resolution mass spectrometry measurements. A number of tools for internal mass recalibration, MF assignment, signal-to-noise evaluation, and unambiguous formula selections are provided.
GNU General Public License v3.0
0 stars 3 forks source link

Refactor the MFAssignCHO module #19

Open hechth opened 11 months ago

hechth commented 11 months ago

As the function is really long and the code is hard to read, the function should be refactored so that it also becomes easier to re-use code and extend the module in the future.

It also seems that some code from the IsoFiltR is copy-pasted in the MFAssignCHO module, so it is worth checking where code was potentially taken from or whether some steps might already be contained in other functions.

While refactoring, the following procedure often makes sense. After every change, unit tests should be run to make sure that the code still does the same

When extracting functions. the best way is to refactor layer by layer. Look at the top level function and see if you can see multiple things happening at the same level which are the overarching steps. Basically, try to split the highest layer.