Pyteomics documentation v3.4.2

unimod - interface to the Unimod database

Contents

unimod - interface to the Unimod database

This module provides an interface to the relational Unimod database. The main class is Unimod.

Dependencies

This module requres lxml and sqlalchemy.

class pyteomics.mass.unimod.HasFullNameMixin[source]

Bases: object

A simple mixin to standardize equality operators for models with a full_name attribute.

__init__

x.__init__(…) initializes x; see help(type(x)) for signature

class pyteomics.mass.unimod.Unimod(path=None)[source]

Bases: object

Main class representing the relational Unimod database.

Methods

by_name(identifier[, strict]) Get a modification matching identifier.
by_title(identifier[, strict]) Get a modification matching identifier.
get(identifier[, strict]) Get a modification matching identifier.
__init__(path=None)[source]

Initialize the object from a database file.

Parameters:

path : str or None, optional

If str, should point to a database. Use a dialect-specific prefix, like 'sqlite://'. If None (default), a relational XML file will be downloaded from default location.

by_name(identifier, strict=True)

Get a modification matching identifier. Replaces both by_name and by_title methods in the old class.

Parameters:

identifier : str

strict : bool, optional

Defaults to True.

Returns:

out : Modification

by_title(identifier, strict=True)

Get a modification matching identifier. Replaces both by_name and by_title methods in the old class.

Parameters:

identifier : str

strict : bool, optional

Defaults to True.

Returns:

out : Modification

get(identifier, strict=True)[source]

Get a modification matching identifier. Replaces both by_name and by_title methods in the old class.

Parameters:

identifier : str

strict : bool, optional

Defaults to True.

Returns:

out : Modification

pyteomics.mass.unimod.has_composition(attr_name)[source]

A decorator to simplify flagging a Model with a column to be treated as a formula for parsing. Calls _composition_listener() internally.

pyteomics.mass.unimod.load(doc_path, output_path=’sqlite://’)[source]

Parse the relational table-like XML file provided by http://www.unimod.org/downloads.html and convert each <tag>_row into an equivalent database entry.

By default the table will be held in memory.

pyteomics.mass.unimod.preprocess_xml(doc_path)[source]

Parse and drop namespaces from an XML document.

Parameters:doc_path : str
Returns:out : etree.ElementTree
pyteomics.mass.unimod.remove_namespace(doc, namespace)[source]

Remove namespace in the passed document in place.

Contents