chhh / batmass

Mass spectrometry data visualization
https://batmass.org
Apache License 2.0
36 stars 8 forks source link

writing mgf or mzXML /mzML files #11

Closed gsaxena888 closed 6 years ago

gsaxena888 commented 6 years ago

Is it possible to use BatMass to create mgf, mzXML, or mzML files? (I know we can read mzXML files.) If it is possible, do you have some test code or example code that we could follow? If it's not supported in the library, do you have any suggestions for libraries that do support writing mgf, mzXML, or mzML files in Java?

chhh commented 6 years ago

I didn't write any real "writers", you can take a look at the example for pepxml here, it will go the same way for writing mzxml. mzML is more involved as you need to know controlled vocabulary (cv) terms for everything that you write out. That mapping of cv terms is very cumbersome.
Writing mgf should not be a problem to do yourself. If you want a library for that, you can look at MSDK, might look a little overwhelming for you though. Here's a link to mgf export test in msdk: https://github.com/msdk/msdk/blob/master/msdk-io-mgf/src/test/java/io/github/msdk/io/mgf/MgfFileExportMethodTest.java