XML/OWL processing utilities

pybiopax.xml_util.camel_to_snake(txt)[source]

Return snake case from camel case

pybiopax.xml_util.get_attr_tag(element)[source]

Return the tag of an element as an attribute name.

pybiopax.xml_util.get_datatype(attrib)[source]

Return the RDF data type of an element attribute.

pybiopax.xml_util.get_id_or_about(element)[source]

Return the ID or the about associated with an element

pybiopax.xml_util.get_ns(element)[source]

Return the name space of a given element.

pybiopax.xml_util.get_resource(attrib)[source]

Return the resource associated with an element attribute.

pybiopax.xml_util.get_tag(element)[source]

Return the tag of an element.

pybiopax.xml_util.has_ns(element, ns)[source]

Return True if the element is from a given name space.

pybiopax.xml_util.is_datatype(attrib, prefix, datatype)[source]

Return True of the given attribute is of a given type.

pybiopax.xml_util.is_url(txt)[source]

Return true if the given string is an URL.

pybiopax.xml_util.nselem(ns, elem)[source]

Return a full namespaced string with curly brackets with a suffix.

pybiopax.xml_util.nssuffix(ns, suffix)[source]

Return a full namespaced string with a suffix.

pybiopax.xml_util.snake_to_camel(txt)[source]

Return camel case from snake case.

pybiopax.xml_util.wrap_xml_elements(elements, xml_base)[source]

Return a valid BioPAX OWL wrapping XML-serialized BioPAX objects.

pybiopax.xml_util.xml_to_file(xml, fname)[source]

Write an XML element tree to a given file.

pybiopax.xml_util.xml_to_str(xml)[source]

Return the OWL string for an XML element tree.