pymzml / pymzML

pymzML - an interface between Python and mzML Mass spectrometry Files
https://pymzml.readthedocs.io/en/latest/
MIT License
160 stars 91 forks source link

access fileDescription #223

Open jonas87 opened 4 years ago

jonas87 commented 4 years ago

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 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.

MKoesters commented 4 years ago

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

jonas87 commented 4 years ago

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 )

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