Skip to content

Conversation

@tew42
Copy link

@tew42 tew42 commented Jan 23, 2021

Hi @Zhiqiang-PANG,

In my efforts to get OptiLCMS parameter optimization working with custom parameters, I believe I discovered a bug in calculateSet_doe.

Specifically, the function checks the length() of Set_parameters to determine how to call updateRawSpectraParam() (<31 --> pass on Set_parameters directly; otherwise pass on sub-set).

However, since Set_parameters is a list of lists (!), length() actually only returns the number of sub-lists (i.e., number of parameter sets), rather than the total number of elements. If the DoE setup has less than 31 parameter sets, the entire DoE gets passed on to updateRawSpectraParam(), leading to errors.

Using sum(lengths()) instead avoids this issue by counting the total number of list entries (across lists), so 20-30 per parameter set, leading to correct behavior.

This bug probably also applies to OptiLCMS_web and MetaboAnalystR...

@Zhiqiang-PANG
Copy link
Collaborator

Thanks for this advice, I will check later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants