How to use the pyteomics.xml._keepstate function in pyteomics

To help you get started, we’ve selected a few pyteomics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mobiusklein / ms_deisotope / ms_deisotope / data_source / xml_reader.py View on Github external
@xml._keepstate
def get_tag_attributes(source, tag_name):
    '''Iteratively parse XML stream in ``source`` until encountering ``tag_name``
    at which point parsing terminates and return the attributes of the matched
    tag.

    Parameters
    ----------
    source: file-like
        A file-like object over an XML document
    tag_name: str
        The name of the XML tag to parse until

    Returns
    -------
    dict
    '''
github mobiusklein / ms_deisotope / ms_deisotope / data_source / xml_reader.py View on Github external
@xml._keepstate
def _find_section(source, section):
    value = next(source.iterfind(section))
    return value
github mobiusklein / ms_deisotope / ms_deisotope / data_source / xml_reader.py View on Github external
@xml._keepstate
def iterparse_until(source, target_name, quit_name):
    '''Iteratively parse XML stream in ``source``, yielding XML elements
    matching ``target_name``. If at any point a tag matching ``quit_name``
    is encountered, stop parsing.

    Parameters
    ----------
    source: file-like
        A file-like object over an XML document
    tag_name: str
        The name of the XML tag to parse until
    quit_name: str
        The name to stop parsing at.

    Yields
    ------