Skip to content

Conversation

@ALuesink
Copy link
Contributor

@ALuesink ALuesink commented Dec 15, 2025

  • Removed SST mix and positive controls from the plots in the Excel files.
  • Moved code to functions
  • Added unit tests for new functions

@ALuesink ALuesink changed the title Feature/dims excel plots Feature/DIMS_Excel_plots Dec 15, 2025
@ALuesink ALuesink marked this pull request as ready for review December 19, 2025 08:08
@rernst rernst self-requested a review January 13, 2026 08:31
Copy link
Member

@rernst rernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ziet er goed uit, ik denk dat je naamgeving soms wat duidelijker/simpeler kan maken. Verder zit er nog een stukje code duplicatie in wat je volgens mij bij de create_boxplot_excel functie kan toevoegen.

#' @param hmdb_id: HMDB ID of the selected metabolite
#'
#' @returns boxplot_excel: ggplot2 object containing the plot of intensities
create_boxplot_excel <- function(intensities_plots_df_long, hmdb_id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ook hier zo ik van maken: create_boxplot. Excel toevoegingen zijn niet echt nodig omdat het een functie is van de generate_excel_functions.R. Eventueel zou je hem 'private' kunnen maken. In python zou je dan doen: _create_boxplot -> dat geeft aan dat het niet de bedoeling is om de functie buiten de context van deze file te gebruiken. Weet niet of dat een ding is in de R 'wereld'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik heb de functie naam aangepast. Volgens mij kan je in R niks 'private' maken. Ik kon alleen iets vinden over internal functions, maar dat heeft weer met packages te maken. De functie create_boxplot wordt nu, na andere aanpassingen, alleen in de generate_excel_functions.R gebruikt.

Comment on lines 168 to 175
plot.new()
tmp_png_helix <- paste0("plots/plot_helix_", hmdb_id, ".png")
png(filename = tmp_png_helix, width = plot_width, height = 300)

boxplot_excel_helix <- create_boxplot_excel(intensities_plots_df_long, hmdb_id)

print(boxplot_excel_helix)
dev.off()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zou dit ook niet in de 'create_boxplot_excel' functie passen? Het lijkt er nu op de het maken van de boxplot feitelijk nog hier gebeurd, create boxplot genereerd nu enkel de ggplot config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze code is iets anders dan het maken van een boxplot. Om de plot in de Excel te plaatsen moet je de plot als png opslaan om daarna deze met de insertImage() functie in de Excel te zetten. Ik heb deze code plus de insertImage() code verplaatst naar een nieuwe save_plot_to_excel_workbook functie.

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.

3 participants