Skip to content
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

Added chromatogramHeader test #302

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

nilshoffmann
Copy link
Contributor

First step to demonstrate issues with index access for chromatogramHeader vs chromatogram.

@jorainer
Copy link
Collaborator

Oh - so there is an issue with indexing? I hope you then also provide a PR with a fix :)

@nilshoffmann
Copy link
Contributor Author

@jorainer @sneumann Please review and run the workflow. I have added unit tests to demonstrate the fixed indexing behavior between chromatogram and chromatogramHeader.

Copy link
Collaborator

@jorainer jorainer left a comment

Choose a reason for hiding this comment

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

Really great! thank you so much Nils!

quick question: there is not indexing issue with the getAllChromatogramsInfo(), right? All functions/methods in R for chromatogram extraction pass now R-style 1-based indices, right?

R/methods-mzRpwiz.R Show resolved Hide resolved
R/methods-mzRpwiz.R Show resolved Hide resolved
@@ -192,10 +191,11 @@ setMethod("chromatogramHeader", "mzRpwiz",
} else {
stopifnot(is.numeric(chrom))
n <- nChrom(object)
chrom <- as.integer(chrom)
Copy link
Collaborator

Choose a reason for hiding this comment

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

to be on the (very) save side I would suggest to then call as.integer(chrom) below (i.e. getChromatogramHeaderInfo(as.integer(chrom)))

Copy link
Collaborator

Choose a reason for hiding this comment

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

could be that the Rcpp makes sure the correct type is passed, but I would rather play save...

Copy link
Owner

Choose a reason for hiding this comment

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

Done.

@nilshoffmann
Copy link
Contributor Author

nilshoffmann commented Feb 5, 2025 via email

@sneumann
Copy link
Owner

sneumann commented Feb 6, 2025

Before merging, let me check that the cat() debug calls are removed in a later PR. Yours, Steffen
No, still there. Please remove. Yours, Steffen

R/methods-mzRpwiz.R Show resolved Hide resolved
@@ -192,10 +191,11 @@ setMethod("chromatogramHeader", "mzRpwiz",
} else {
stopifnot(is.numeric(chrom))
n <- nChrom(object)
chrom <- as.integer(chrom)
Copy link
Owner

Choose a reason for hiding this comment

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

Done.

sneumann added a commit that referenced this pull request Feb 6, 2025
@sneumann sneumann merged commit d770d15 into sneumann:devel Feb 6, 2025
2 of 3 checks passed
@sneumann
Copy link
Owner

sneumann commented Feb 6, 2025

Unsure whether I messed up merging, but I am getting a test failure:
checkIdentical(tic(x), chromatogram(x, 1L)) is FALSE, but instead
checkIdentical(tic(x), chromatogram(x, 2L)) is TRUE.
What I realised is that

object@backend$getChromatogramsInfo(1L)

assumes the TIC is always the first chromatogram(). Is that guaranteed, quite common or just in our MRM file ?
Yours, Steffen

@jorainer
Copy link
Collaborator

jorainer commented Feb 6, 2025

AFAIK the TIC is always the first chromatogram in the chromatogram list entry of a mzML file - as far that is what I've seen so far. But Nils @nilshoffmann will definitely have more data files seen to give a better/more reliable answer.

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.

3 participants