pypath.core.evidence.Evidence§
- class pypath.core.evidence.Evidence(resource, references=None, attrs=None)[source]§
Bases:
AttributeHandlerRepresents an evidence supporting a relationship such as molecular interaction, molecular complex, enzyme-PTM interaction, annotation, etc.
The evidence consists of two main parts: the database and the literature references. If a relationship is supported by multiple databases, for each one Evidence object should be created and
- Parameters:
resource (pypath.resource.ResourceAttributes) – An object derived from
pypath.resource.ResourceAttributes.references (str,list,set,NoneType) – Optional, one or more literature references (preferably PubMed IDs).
Methods
__init__(resource[, references, attrs])asdict()Dictionary representation of the evidence.
contains_database(database)contains_reference(reference)has_data_model(data_model)has_database_via(database, via)has_interaction_type(interaction_type[, ...])If
viaisFalsethen it will be ignored, otherwise ifNoneonly primary resources are considered.match([resource, data_model, ...])merge(other)Merges two evidences.
reload()Reloads the object from the module level.
serialize(**kwargs)Generates a JSON string with the full contents of the attributes, without any whitespace or line break.
update_attrs([attrs])Updates the attributes stored here.
Attributes
resourcereferencesdatasetattrskeyPubMed IDs of the references supporting this evidence.
- has_interaction_type(interaction_type, database=None, via=False)[source]§
If
viaisFalsethen it will be ignored, otherwise ifNoneonly primary resources are considered.
- merge(other)[source]§
Merges two evidences. Returns set of either one or two evidences depending on whether the two evidences are from the same resource.
- property pubmeds: list[str]§
PubMed IDs of the references supporting this evidence.
- serialize(**kwargs)§
Generates a JSON string with the full contents of the attributes, without any whitespace or line break.
- Returns
(str): The attributes JSON serialized.
- update_attrs(attrs=None, **kwargs)§
Updates the attributes stored here. The attributes with identical keys are merged using the
pypath.share.common.combine_attrs()function.The new attributes can be provided three ways: an object with an attribute called attrs; a dictionary of attributes; or the attributes as keyword arguments.