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

Add a bpc,MSnExp and bpc,OnDiskMSnExp method #168

Closed
jorainer opened this issue Nov 15, 2016 · 4 comments
Closed

Add a bpc,MSnExp and bpc,OnDiskMSnExp method #168

jorainer opened this issue Nov 15, 2016 · 4 comments

Comments

@jorainer
Copy link
Collaborator

Would be nice to have, along with the tic method, also a bpc method that extracts the base peak chromatogram from an MSnExp and OnDiskMSnExp, i.e. the maximum intensity from each spectrum.

If you would agree I could implement that.

@lgatto
Copy link
Owner

lgatto commented Nov 15, 2016

Do you mean a method that extract the basePeakIntensity feature data? Note that this data isn't available from (in memory) MSnExp objects (i.e. in the Spectrum1/Spectrum2 objects). It would need to be calculated on the fly, and I wouldn't be surprised if they didn't match fData values, or would not be after some processing. We already had this discussion, I think, of such data that would not be correct after some processing, and agreed to rename it as original or initial.

Or go you mean something like chromatogram?

But yes, it would be useful to have such a method.

@jorainer
Copy link
Collaborator Author

I guess yes, extract the basePeakIntensity feature data - haven't looked at that yet. That might however be like the totIonCurrent feature data, that represents the raw data from the MS-machine and does not match - at least for our files - the value of the centroided mzML file.

I didn't check the chromatogram method yet, eventually that does what I want. In the end would be nice to have some method to extract sum or max of intensities of a spectrum.
Actually, thinking it over an implementation of the chromatogram method might be it, with a parameter type that can be either "tic" or "bpc" and eventually a logical parameter initial to specify whether the values should be extracted from the feature data.

@lgatto
Copy link
Owner

lgatto commented Nov 15, 2016

I guess yes, extract the basePeakIntensity feature data - haven't looked at that yet. That might however be like the totIonCurrent feature data, that represents the raw data from the MS-machine and does not match - at least for our files - the value of the centroided mzML file.

Yes, same situation - I'm fine with having a bpi,OnDiskMSnExp method that returns that feature data, and document that these are the values are reported in the raw data. Not sure if we need bpi,MSnExp, that iterates over all spectra. If so, then we could have a parameter in bpi,OnDiskMSnExp that forces to recalculate the values. What do you think?

I didn't check the chromatogram method yet

There's also xic, for extracted ion chromatograms.

chromatogram and xic would be very easy to implement for OnDiskMSnExp, as they operate on an mzRramp object, that we can create (and close) from fileNames(.).

In the end would be nice to have some method to extract sum or max of intensities of a spectrum.

Could you clarify what you mean? The max or sum of all intensities in a spectrum? That would be easy to add - something along the lines of

  • quantify(sp, method = "max") would return max(intensity(sp))
  • quantify(sp, method = "sum") would return sum(intensity(sp))

(There's already a method = "sum" withreporters` defined)

jorainer added a commit that referenced this issue Nov 16, 2016
o Add bpi,OnDiskMsnExp method. Parameter initial allows to specify whether the
  original data from the mzML file is returned, or whether the values are
  calculated.
o Modify tic,OnDiskMSnExp method to always return the initial TIC from the
  mzML's header, unless parameter initial = FALSE
o Add unit tests for both methods.
@jorainer
Copy link
Collaborator Author

Done. The bpi method has an additional parameter initial that, when TRUE returns the values extracted from the mzML header and when FALSE calculates it from the actual data. I have modified the tic,OnDiskMSnExp method the same way (i.e. parameter initial) and modified the documentation accordingly.

jorainer added a commit that referenced this issue Nov 16, 2016
o Fix unit test errors related to changes due to issue #168.
o Add missing aliases for bpi in documentation.
lgatto pushed a commit that referenced this issue Nov 27, 2016
o Add bpi,OnDiskMsnExp method. Parameter initial allows to specify whether the
  original data from the mzML file is returned, or whether the values are
  calculated.
o Modify tic,OnDiskMSnExp method to always return the initial TIC from the
  mzML's header, unless parameter initial = FALSE
o Add unit tests for both methods.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124448 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Nov 27, 2016
o Fix unit test errors related to changes due to issue #168.
o Add missing aliases for bpi in documentation.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124449 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Nov 27, 2016
* master:
  update news
  Fix issue #170
  Add spectrapply method and backend option
  Fix unit test error due to recent changes
  Add bpi method (issue #168)
  set filename only when input is a character
  Update readMSnSet2 to save filename
  Cite Lazar 2016 in vignette imputation section
  add imputatation paper to bib
  update news and description
  fix typo in impute man page
  new github devel version

From: Laurent <lg390@cam.ac.uk>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124452 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Apr 9, 2017
o Add bpi,OnDiskMsnExp method. Parameter initial allows to specify whether the
  original data from the mzML file is returned, or whether the values are
  calculated.
o Modify tic,OnDiskMSnExp method to always return the initial TIC from the
  mzML's header, unless parameter initial = FALSE
o Add unit tests for both methods.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124448 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Apr 9, 2017
o Fix unit test errors related to changes due to issue #168.
o Add missing aliases for bpi in documentation.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124449 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Apr 9, 2017
* master:
  update news
  Fix issue #170
  Add spectrapply method and backend option
  Fix unit test error due to recent changes
  Add bpi method (issue #168)
  set filename only when input is a character
  Update readMSnSet2 to save filename
  Cite Lazar 2016 in vignette imputation section
  add imputatation paper to bib
  update news and description
  fix typo in impute man page
  new github devel version

From: Laurent <lg390@cam.ac.uk>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124452 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Sep 7, 2017
o Add bpi,OnDiskMsnExp method. Parameter initial allows to specify whether the
  original data from the mzML file is returned, or whether the values are
  calculated.
o Modify tic,OnDiskMSnExp method to always return the initial TIC from the
  mzML's header, unless parameter initial = FALSE
o Add unit tests for both methods.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124448 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Sep 7, 2017
o Fix unit test errors related to changes due to issue #168.
o Add missing aliases for bpi in documentation.

From: jotsetung <johannes.rainer@gmail.com>

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124449 bc3139a8-67e5-0310-9ffc-ced21a209358
lgatto pushed a commit that referenced this issue Sep 7, 2017
* master:
  update news
  Fix issue #170
  Add spectrapply method and backend option
  Fix unit test error due to recent changes
  Add bpi method (issue #168)
  set filename only when input is a character
  Update readMSnSet2 to save filename
  Cite Lazar 2016 in vignette imputation section
  add imputatation paper to bib
  update news and description
  fix typo in impute man page
  new github devel version

From: Laurent <lg390@cam.ac.uk>

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@124452 bc3139a8-67e5-0310-9ffc-ced21a209358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants