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

Converting .cdf to .mzml - different parsers? #26

Open
karawiggin opened this issue Jan 21, 2024 · 1 comment
Open

Converting .cdf to .mzml - different parsers? #26

karawiggin opened this issue Jan 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@karawiggin
Copy link

I am trying to convert a .cdf file from a Shimadzu machine to .mzml to use in GNPS, and when I try, it says that exporting to .mzml requires the openchrom parser, but when you use openchrom it says it doesn't recognize .cdf. Is there a way around this? From the documentation it seems like standard read_chroms parsers should recognize both .cdf and .mzml

error when I don't specify a parser:
The selected export format is currently only supported by openchrom parsers.

error when I specify openchrom:
The ‘cdf’ format can be converted using the following parsers: ‘chromconverter’.
The ‘openchrom’ parser can take the following formats as inputs:
‘msd’, ‘csd’, ‘wsd’.

Here's the code I'm trying to use (without specifying a parser), if it's simply just something wrong with how it's written:
data <- read_chroms(paths = "mypath/filename.CDF", format_in = "cdf", export = TRUE, path_out = "mypath/filename.mzml", export_format = "mzml")

Would appreciate any help!!

@ethanbass
Copy link
Owner

ethanbass commented Jan 21, 2024

Hi Kara,

Thanks for your question. chromConverter can read the ANDI mass spectrometry format, but it can't yet directly write mzML (except for the parsers that wrap OpenChrom, which is able to do this type of conversion as you noted). Unfortunately, Open Chrom recently eliminated support for the command line interface that chromConverter uses and the older version doesn't seem to be available anymore from their website. I can think of 3 options for you. Probably the simplest thing might be to use the MSnbase package instead to convert the files. The syntax would be something like:

files <- list.files(<path_to_files>, pattern="CDF", full.names = TRUE)
rawdata <- readMSData(files, msLevel = 1, verbose = FALSE)
writeMSData(rawdata, file = fs::path(<path_out>, basename(files), ext = "mzML"), outformat = "mzml")

Alternatively, if you can find OpenChrom v1.4.x, you could use the OpenChrom parser to convert the files through chromConverter.

Otherwise, you could use the OpenChrom software directly through the graphical user interface to convert the files.

I think it would be nice to incorporate better support for writing mzML into chromConverter, but unfortunately I don't think i'll have much time to look into it at least for a while.

Ethan

@ethanbass ethanbass added the enhancement New feature or request label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants