pymzML icon indicating copy to clipboard operation
pymzML copied to clipboard

access fileDescription

Open jonas87 opened this issue 5 years ago • 2 comments

I went through the documentation but didn't find how to access the information inside specific xml elements inside the mzml file, like for example <fileDescription> What I'm doing now is accessing the chromatogram data with pymzML and loading the file another time with Beautiful Soup to access the information inside specific xml elements.

jonas87 avatar May 09 '20 22:05 jonas87

Hi Jonas,

Accessing the information using BeautifulSoup is of course not optimal .. Do you want to access all the cvParams in fileDescription? Currently, all params in the spectrum elements are accessible but not the ones in the mzML "header" However it should not be hard to implement.

Could you tell me a bit more which information you are trying to access?

Best, Manuel

MKoesters avatar May 13 '20 09:05 MKoesters

Hi Manuel,

I needed the name of the source file, which is available in the fileDescription/sourceFileList/sourceFile tag, see attached file. (fileDescription is a direct child of <mzML>)

Don't do this on my behalf though, Im using lxml now to access this, as well as the chromatogram data (which I'm decoding with base64, zlib and struct). My use case is actually simple enough that I don't need pymzML

example.txt

jonas87 avatar May 13 '20 12:05 jonas87