Metadata

Functions to modify the metadata of graphs, their edges, and their nodes.

pybel.struct.mutation.metadata.strip_annotations(graph)[source]

Strip all the annotations from a BEL graph.

Parameters

graph (BELGraph) – A BEL graph

Return type

None

pybel.struct.mutation.metadata.add_annotation_value(graph, annotation, value, strict=True)[source]

Add the given annotation/value pair to all qualified edges.

Parameters
  • graph (BELGraph) – A BEL graph

  • annotation (str) –

  • value (str) –

  • strict (bool) – Should the function ensure the annotation has already been defined?

Return type

None

pybel.struct.mutation.metadata.remove_annotation_value(graph, annotation, value)[source]

Remove the given annotation/value pair to all qualified edges.

Parameters
  • graph (BELGraph) – A BEL graph

  • annotation (str) –

  • value (str) –

Return type

None

pybel.struct.mutation.metadata.remove_extra_citation_metadata(graph)[source]

Remove superfluous metadata associated with a citation (that isn’t the db/id).

Best practice is to add this information programmatically.

Return type

None

pybel.manager.enrich_pubmed_citations(graph, *, manager=None, group_size=None, offline=False)[source]

Overwrite all PubMed citations with values from NCBI’s eUtils lookup service.

Parameters
  • graph (BELGraph) – A BEL graph

  • manager (Optional[Manager]) – A PyBEL database manager

  • group_size (Optional[int]) – The number of PubMed identifiers to query at a time. Defaults to 200 identifiers.

  • offline (bool) – An override for when you don’t want to hit the eUtils

Return type

Set[str]

Returns

A set of PMIDs for which the eUtils service crashed

pybel.manager.enrich_pmc_citations(graph, *, manager=None, group_size=None, offline=False)[source]

Overwrite all PubMed citations with values from NCBI’s eUtils lookup service.

Parameters
  • graph (BELGraph) – A BEL graph

  • manager (Optional[Manager]) – A PyBEL database manager

  • group_size (Optional[int]) – The number of PubMed identifiers to query at a time. Defaults to 200 identifiers.

  • offline (bool) – An override for when you don’t want to hit the eUtils

Return type

Set[str]

Returns

A set of PMIDs for which the eUtils service crashed