Closed ricoderks closed 4 years ago
Hi,
I'am trying to use writeMgfData with a file connection. If I use this code:
writeMgfData
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
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"?
open = "at"
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
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.
Thank you for the PR.
Hi,
I'am trying to use
writeMgfData
with a file connection. If I use this code:I get the following error:
Error in file(description = con, open = "at") : invalid 'description' argument
And the full traceback:
I'am also wondering why it says
open = "at"
while I specifiedopen = "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