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

Writing/exporting raw data objects #259

Closed
lgatto opened this issue Sep 19, 2017 · 7 comments
Closed

Writing/exporting raw data objects #259

lgatto opened this issue Sep 19, 2017 · 7 comments

Comments

@lgatto
Copy link
Owner

lgatto commented Sep 19, 2017

This discusses naming the function in PR #257, also discussed here. Current suggestions are

  1. write - Jo's first choice
  2. writeMSData as a generic with methods in mzR and MSnbase
  3. export - suggested on bioc-devel

Please share you opinions/votes below.

@lgatto
Copy link
Owner Author

lgatto commented Sep 19, 2017

Given the feedback on bioc-devel, I suggest we drop write.

From a user's perspective, I think writeMSData fits well with readMSData. Also, the equivalent of export, would be import, which we don't use. I think having writeMSData in mzR makes me want this option even more, as we would keep the naming consistent across packages.

So my vote would go for 2.

Quick question - what would be the difference in writing an MSnExp object and an mzRpwiz object?

@jorainer
Copy link
Collaborator

Jup, let's drop write. I tend to 3 (export) - for 2 we have to make writeMSData a generic with arguments becoming potentially tricky:

  • writeMSData in mzR needs: files (character), header (data.frame) and data (list).
  • writeMSData in MSnbase does not have a header. We would need to make the generic as writeMSData signature(data = "MSnExp", file = "character")... thinking it over its doable. So OK for me to go for that.

@lgatto
Copy link
Owner Author

lgatto commented Sep 19, 2017

We could have

setGeneric("writeMSData", function(object, file, ...) standardGeneric("writeMSData"))

and then in mzR

setMethod("writeMSData", 
           c("list", ## list of spectra
             "character", ## file name 
             "data.frame", ## header 
             ...) 
   function(object, filenames, header) { ... })

and in MSnbase

setMethod("writeMSData", 
           c("MSnExp", ## list of spectra
             "character", ## file name 
             ...) { 
  function(object, files) {
    header <- fData(object)
     ...
})

By the way, I would prefer filename rather than filenames, given #257.

@jorainer
Copy link
Collaborator

OK, let's go for that - do you add the generic to ProtGenerics @lgatto ?

@jorainer
Copy link
Collaborator

Made a pull request in ProtGenerics: rformassspectrometry/ProtGenerics#5

@lgatto
Copy link
Owner Author

lgatto commented Sep 20, 2017

Merged. Will push to bioc asap (but I'm at a meeting whole day).

@lgatto
Copy link
Owner Author

lgatto commented Sep 20, 2017

Done

jorainer added a commit that referenced this issue Sep 20, 2017
- Require ProtGenerics 1.9.1 (defining the writeMSData generic).
- Require most recent mzR (>= 2.11.11).
- Change write,MSnExp to writeMSData,MSnExp (issue #259).
- Add argument merge = FALSE to writeMSData,MSnExp to enable future merging of
  MS data into a single file.
@lgatto lgatto closed this as completed Sep 22, 2017
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

No branches or pull requests

2 participants