Fix error when calling multiple Spectra objects in addFragments#20
Fix error when calling multiple Spectra objects in addFragments#20lgatto merged 60 commits intorformassspectrometry:mainfrom
Conversation
feat: calculateFragments2 Provides modifications to the generated theoretical fragments
feat: tests for calculateFragments2
Updates based on reviewed PR
Updates according to reviewed PR
Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de>
Corrected .cumsumFragmentMasses
Change modified peptide layout into AGC[57.02]AK instead of AG[C]AK to specify the modified mass
Merge branch 'main' of https://github.com/guideflandre/PSMatch # Conflicts: # R/fragments-calculate2.R
sgibb
left a comment
There was a problem hiding this comment.
IMHO the return value of addFragments is not correct or would be surprising in some cases.
BTW: maybe we should use this change to rename the addFragments function to labelFragments? or fragmentLabels or something else? addFragments suggests that some fragments where added to the Spectra object. Instead this function returns fragment labels.
Co-authored-by: Sebastian Gibb <mail@sebastiangibb.de>
Yes, this makes sense. Maybe add a warning that says |
|
I am also in favour of adding a new function, addFragment <- function(x, tolerance = 0, ppm = 20, ...) {
.Deprecated("labelFragments")
labelFragments(x, tolevance, ppm, ...)
}
labelFragments <- function(x, tolerance = 0, ppm = 20, ...) {
## new code comes here
} |
I added this as well. |
|
I have checked the package the reverse deps, and all is fine. |
This PR is linked to #18 and the discussed topics in this Spectra issue.
The motivation for this PR:
addFragmentsused to throw an error when multiple spectra where calledvariable_modificationsparameter necessitated a newaddFragmentsfunction to distinguish annotationsThe solution:
addFragmentsnow returns a list of named elements (peptide sequence that include modifications) containing acharacter()vector with the annotations. Each element of the list has an attribute linking the annotations to the spectrum it belonged to.For instance:
Expand example
This PR can only be accepted if the corresponding PR in Spectra is accepted !! Otherwise,
plotSpectrawon't work.