Skip to content

Feature/refactor_DIMS_GenerateBreaks#95

Open
mraves2 wants to merge 6 commits intodevelopfrom
feature/refactor_DIMS_GenerateBreaks
Open

Feature/refactor_DIMS_GenerateBreaks#95
mraves2 wants to merge 6 commits intodevelopfrom
feature/refactor_DIMS_GenerateBreaks

Conversation

@mraves2
Copy link
Contributor

@mraves2 mraves2 commented Feb 13, 2026

Code refactored, moved into functions. Output for trim_parameters and breaks separated. This has implications for other steps in the pipeline, but this has already been set up in refactor_PeakFinding (which is not in develop yet).
Unit tests added.

Comment on lines +13 to +14
trim_left_pos <- round(pos_times[length(pos_times) * (trim * 1.5)])
trim_right_pos <- round(pos_times[length(pos_times) * (1 - (trim * 0.5))])

Choose a reason for hiding this comment

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

I am a bit confused what trim is exactly?
Why is trim a parameter, but the 1.5 and 0.5 are hard coded. I would make all of them function parameters (with a default value)

Comment on lines +5 to +6
#' @param scantimes: vector of scan times in seconds
#' @param polarities: vector of polarities (positive or negative)

Choose a reason for hiding this comment

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

I am missing a description of the trim param


# trim (remove) scans at the start and end (10%) for negative
trim_left_neg <- round(neg_times[length(neg_times) * trim])
trim_right_neg <- round(neg_times[length(neg_times) * (1 - trim)])

Choose a reason for hiding this comment

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

No percentages here?

#' @param mzrange: vector of minimum and maximum m/z values (integeers)
#' @param resol: value for resolution (integer)

# initialize

Choose a reason for hiding this comment

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

Suggested change
# initialize

Choose a reason for hiding this comment

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

in get_breaks_for_bins() you have as a comment fwhm (width of peaks) is assumed to be constant within a segment.

Would it make sense to add a test to see what happens if that is not the case?

script:
"""
Rscript ${baseDir}/CustomModules/DIMS/GenerateBreaks.R $mzML_file ./ $params.trim $params.resolution
Rscript ${baseDir}/CustomModules/DIMS/GenerateBreaks.R $mzML_file $params.trim $params.resolution

Choose a reason for hiding this comment

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

Please refrain from referencing params and baseDir in the script block.

See #94 (comment) and #94 (comment)

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