Skip to content
Discussion options

You must be logged in to vote

Hi!

Generally, you shouldn't need to do anything special to achieve this. use_index=True is needed if you create the parser with mzxml.read(); if you call mzxml.MzXML instead, indexing is enabled by default.

In any case, the created object should have _offset_index populated with byte offsets of elements. You can check len(reader) and get the amount of items in the index.

The behavior you need is indeed defined in get_by_id, but not the version on the XML class, rather the one on IndexedXML. You don't need to call it directly though, you can just use dict-like syntax on the reader object. You should even be able to get all your spectra at once by requesting a list of IDs.

build_id_cache i…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CCranney
Comment options

Answer selected by CCranney
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants