Skip to content

Feature/refactor_DIMS_CollectFilled#97

Open
mraves2 wants to merge 4 commits intodevelopfrom
feature/refactor_DIMS_CollectFilled
Open

Feature/refactor_DIMS_CollectFilled#97
mraves2 wants to merge 4 commits intodevelopfrom
feature/refactor_DIMS_CollectFilled

Conversation

@mraves2
Copy link
Contributor

@mraves2 mraves2 commented Feb 13, 2026

Verschillende functies gemaakt en naar aparte file verplaatst (preprocessing/collect_filled_functions.R).
Unit tests toegevoegd, fixtures/test_peakgroup_list.txt aangepast.
Er stond in de oude versie een filter op geannoteerde piekgroepen met een ppm deviatie groter dan 5; dat is niet meer gewenst. De output van deze stap moet alle piekgroepen bevatten. Het filter is verwijderd.

@@ -0,0 +1,145 @@
# CollectFilled functions

collapse <- function(column_label, peakgroup_list, index_dup) {

Choose a reason for hiding this comment

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

This function name should be more descriptive collapse_...

Comment on lines +72 to +73
case_label <- "P"
control_label <- "C"

Choose a reason for hiding this comment

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

are these always the same labels? Otherwise it make sense to add them as parameters

Comment on lines +111 to +121
for (row_index in seq_len(nrow(peakgroup_list))) {
if (!is.na(peakgroup_list$theormz_HMDB[row_index]) &&
!is.null(peakgroup_list$theormz_HMDB[row_index]) &&
(peakgroup_list$theormz_HMDB[row_index] != "")) {
peakgroup_list$ppmdev[row_index] <- 10^6 * (as.numeric(as.vector(peakgroup_list$mzmed.pgrp[row_index])) -
as.numeric(as.vector(peakgroup_list$theormz_HMDB[row_index]))) /
as.numeric(as.vector(peakgroup_list$theormz_HMDB[row_index]))
} else {
peakgroup_list$ppmdev[row_index] <- NA
}
}

Choose a reason for hiding this comment

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

This part is very hard to read. It would benefit from a refactor

outlist_ident <- outlist_ident[, -which(colnames(outlist_ident) %in% remove_columns)]
write.table(outlist_ident, file = paste0("outlist_identified_", scanmode, ".txt"), sep = "\t", row.names = FALSE)
# output in RData format
# generate output in RData format

Choose a reason for hiding this comment

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

Suggested change
# generate output in RData format
# export output in RData format

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