ShixiangWang / sigminer

🌲 An easy-to-use and scalable toolkit for genomic alteration signature (a.k.a. mutational signature) analysis and visualization in R https://shixiangwang.github.io/sigminer/reference/index.html
https://shixiangwang.github.io/sigminer/
Other
141 stars 18 forks source link

Please do not change future options #451

Closed HenrikBengtsson closed 5 months ago

HenrikBengtsson commented 6 months ago

Hello. Please do not set future options from within your package, as in:

https://github.com/ShixiangWang/sigminer/blob/f987957272c74fd1c257efa69c42c8d7826dbc13/R/globalVariables.R#L10

This might have unintended side effects for other packages and risk producing incorrect results elsewhere. R options are meant for end-users, not developers. If you need to tweak the settings, please do so temporarily, as explained in https://future.futureverse.org/articles/future-7-for-package-developers.html#avoid-changing-the-future-options.

ShixiangWang commented 6 months ago

Hi @HenrikBengtsson

Thanks for your warm reminder. I have dropped the setting from this package in the latest commit. As the future setting is utilized in multiple functions of my package, if I want to inject the future options temporarily, is there a good way to set such options only once (e.g., add some code in the following function set_future_strategy) so I don't need to modify too much code?

https://github.com/ShixiangWang/sigminer/blob/f987957272c74fd1c257efa69c42c8d7826dbc13/R/utils.R#L37

https://github.com/ShixiangWang/sigminer/blob/f987957272c74fd1c257efa69c42c8d7826dbc13/R/sig_auto_extract.R#L147-L149


https://github.com/search?q=repo%3AShixiangWang%2Fsigminer%20future&type=code