sneumann / mzR

This is the git repository matching the Bioconductor package mzR: parser for netCDF, mzXML, mzData and mzML files (mass spectrometry data)
42 stars 26 forks source link

Header output from header() does not match required columns in copyWriteMSData() when using .CDF files #238

Open krispir opened 3 years ago

krispir commented 3 years ago

Hi,

The output from header() does not contain all the columns required by copyWriteMSData() in the .validateHeader() function. Looking at the code for header() it doesn't make sense why these columns are not included in the output since most of the other columns are initialized as "empty_val" anyway.

Affected code in .validateHeader(): https://github.com/sneumann/mzR/blob/09d5907dac19bb336a25a5cd61b39349bd009889/R/functions-utils.R#L62 Affected code in header(): https://github.com/sneumann/mzR/blob/09d5907dac19bb336a25a5cd61b39349bd009889/R/methods-mzRnetCDF.R#L54

I don't know how to create a reproducible example from this without uploading my .CDF-file but the output from header() has columns seqNum, acquisitionNum, msLevel, peaksCount, totIonCurrent, retentionTime, basePeakMZ, basePeakIntensity, collisionEnergy, ionisationEnergy, highMZ, precursorScanNum, precursorMZ, precursorCharge, precursorIntensity, mergedScan, mergedResultScanNum, mergedResultStartScanNum, mergedResultEndScanNum, injectionTime, spectrumId, centroided, ionMobilityDriftTime, isolationWindowTargetMZ, isolationWindowLowerOffset, isolationWindowUpperOffset, scanWindowLowerLimit, and scanWindowUpperLimit. After some digging I found that the missing columns are polarity, lowMZ, and filterString, and these are, in fact, omitted in header() for CDF-files (see links above).

Best regards, Kristian Pirttilä

jorainer commented 3 years ago

Thanks for reporting @krispir ! I will have a look into it!

jorainer commented 3 years ago

This should be fixed in PR https://github.com/sneumann/mzR/pull/239