New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate MALDIquant's baseline estimation #119
Comments
@sgibb - the MALDIquant code is licensed under GPL (>=3), while MsCoreUtils is Artistic-2.0. How do you prefer to handle porting the code? Should we use two licenses, of switch the the latter? |
I see that in
I will be using this one for the new c files. |
The code with unit test and documentation is available in this branch. An example is however currently missing. I could re-use the example data from
Do we want to add such a variable to the data? @sgibb @jorainer Alternatively, I could suggest |
I tentatively implemented the second solution, but happy to adapt.
|
@lgatto thanks for looking into this. I am fine with Artistic-2.0 for my code. I guess we could add a line "License: Artistic-2.0" to be clear? I could also change Instead of adding 0.5 Mb of data or adding nmz <- 5000
mz <- seq(1000, length.out = nmz)
## create peaks
center <- seq(50, nmz, by = 500)
peaks <- lapply(center, function(cc)1000 * dpois(0:100, (1000 + cc) / 75))
## create baseline
intensity <- 100 * exp(-seq_len(nmz)/2000)
## add peaks to baseline
for (i in seq(along = center)) {
intensity[center[i]:(center[i] + 100)] <-
intensity[center[i]:(center[i] + 100)] + peaks[[i]]
}
## add noise
intensity <- intensity + rnorm(nmz, mean = 0, sd = 1)
plot(mz, intensity, type = "l") Created on 2023-12-27 with reprex v2.0.2 |
Thanks, changed here. |
* feat: prepare matrix aggregation * prepare common annotate manual page * work on annotate manual page * add aggregate_by_matrix() examples * test: add aggregate_by_matrix tests * docs: improve aggregate man page * docs: import aggregate man * fix error with man link * fix type news * Apply suggestions from code review Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Implement sgibb's review suggestions * docs: fix defintion of MAT * docs: name Samuel's contribution in aggregate man page * fix: import as and revert back to lies * review: no need to set factor, but set names * fix: specify Matrix::crossproduct() * fix: set colnames after aggregation * refact: use Matrix::colSums() by default, also for matrix * porting MALDIquant's baseline estimation * export C functions * fix unit tests * clean up/fix tests and man page * use bioc 3.19 * add baseline estimation example * update example * gha release and devel * update description * use simulated data, export individual baseline functions * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> * Update R/estimateBaseline.R Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de> --------- Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de>
To replace
MALDIquant
with the more modern RforMassSpectrometry pipeline we have to integrate some of its functionality, e.g. baseline estimation and removal. The following functions, their C-code, documentation and tests have to be copied toMsCoreUtils
:.estimateBaselineConvexHull
: https://github.com/sgibb/MALDIquant/blob/master/src/lowerConvexHull.c.estimateBaselineMedian
.estimateBaselineSnip
: https://github.com/sgibb/MALDIquant/blob/master/src/snip.c.estimateBaselineTopHat
: https://github.com/sgibb/MALDIquant/blob/master/R/morphologicalFilter-functions.R, https://github.com/sgibb/MALDIquant/blob/master/src/morphologicalFilters.c, https://github.com/sgibb/MALDIquant/blob/master/tests/testthat/test_morphologicalFilter-functions.Rhttps://github.com/sgibb/MALDIquant/blob/master/R/estimateBaseline-functions.R
https://github.com/sgibb/MALDIquant/blob/master/tests/testthat/test_estimateBaseline-methods.R
They already work with just
double
s ormatrix
as input so I assume we don't need any recoding here. But the documentation has to be taken from https://github.com/sgibb/MALDIquant/blob/master/man/estimateBaseline-methods.Rd and its example section needs to be rewritten to work without theMALDIquant
classes.CC: @lgatto, @cpauvert
The text was updated successfully, but these errors were encountered: