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

error writeMgfData when using connections #505

Closed
ricoderks opened this issue Apr 20, 2020 · 2 comments
Closed

error writeMgfData when using connections #505

ricoderks opened this issue Apr 20, 2020 · 2 comments

Comments

@ricoderks
Copy link
Contributor

ricoderks commented Apr 20, 2020

Hi,

I'am trying to use writeMgfData with a file connection. If I use this code:

con <- file(description = "test.mgf",
            open = "w")
writeMgfData(object = swath_spectrum[[1]],
             con = con)
close(con)

I get the following error: Error in file(description = con, open = "at") : invalid 'description' argument

And the full traceback:

Error in file(description = con, open = "at") : invalid 'description' argument
5. file(description = con, open = "at")
4. writeMgfDataFile(list(object), con = con, COM = COM, TITLE = TITLE, verbose = isMSnbaseVerbose())
3. .local(object, ...)
2. writeMgfData(object = swath_spectrum[[1]], con = con)
1. writeMgfData(object = swath_spectrum[[1]], con = con)

I'am also wondering why it says open = "at" while I specified open = "w"?

I would like to use connections, because later I would like to append more MSMS spectra to the same mgf ile.

Using R 3.6.3 and MSnbase 2.12.0.

Best regards,
Rico

@ricoderks
Copy link
Contributor Author

I just had a look at the code and I think I fixed it. I'll send a PR. I haven't done this that often so I hope I get it right.

@ricoderks ricoderks changed the title writeMgfData when using connections error writeMgfData when using connections Apr 20, 2020
@lgatto
Copy link
Owner

lgatto commented Apr 20, 2020

Thank you for the PR.

@lgatto lgatto closed this as completed Apr 20, 2020
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