-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix error when calling multiple Spectra objects in addFragments #20
base: main
Are you sure you want to change the base?
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 <[email protected]>
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
Unit tests need to be revisited. If the above is fine for you, I can change them accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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. |
This PR is linked to #18 and the discussed topics in this Spectra issue.
The motivation for this PR:
addFragments
used to throw an error when multiple spectra where calledvariable_modifications
parameter necessitated a newaddFragments
function to distinguish annotationsThe solution:
addFragments
now 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,
plotSpectra
won't work.