EMMAA Statement (emmaa.statements)

class emmaa.statements.EmmaaStatement(stmt, date=None, search_terms=None, metadata=None)[source]

Bases: object

Represents an EMMAA Statement.

Parameters
  • stmt (Statement) – An INDRA Statement

  • date (Optional[datetime]) – A datetime object that is attached to the Statement. Typically represents the time at which the Statement was created.

  • search_terms (Optional[List[SearchTerm]]) – The list of search terms that led to the creation of the Statement.

  • metadata (Optional[Mapping[str, Any]]) –

    Additional metadata for the statement. The metadata dict is expected to contain the following keys:

    • ’internal’: a Boolean indicating whether the statement is internal to the model or not. A statement is internal if it was picked up using the model’s scope definition (through e.g., literature searches and subsequent text mining), and is typically not internal, if it was added to the model to provide additional knowledge, such as statements representing drug targets or phenotypic readouts that are meant to aid explanation construction but are not internal to the model.

emmaa.statements.add_emmaa_annotations(indra_stmt, annotation)[source]

Add EMMAA annotations to inner INDRA statement.

emmaa.statements.check_stmt(stmt, conditions, evid_policy='any')[source]

Decide whether a statement meets the conditions.

Parameters
  • stmt (indra.statements.Statement) – INDRA Statement that should be checked for conditions.

  • conditions (dict) – Conditions represented as key-value pairs that statements’ metadata can be compared to. NOTE if there are multiple conditions provided, the function will require that all conditions are met to return True.

  • evid_policy (str) – Policy for checking statement’s evidence objects. If ‘all’, then the function returns True only if all of statement’s evidence objects meet the conditions. If ‘any’, the function returns True as long as at least one of statement’s evidences meets the conditions.

Returns

meets_conditions – Whether the Statement meets the conditions.

Return type

bool

emmaa.statements.filter_emmaa_stmts_by_metadata(estmts, conditions)[source]

Filter EMMAA statements to those where conditions are met.

Parameters
  • estmts (list[emmaa.statements.EmmaaStatement]) – A list of EMMAA Statements to filter.

  • conditions (dict) – Conditions to filter on represented as key-value pairs that statements’ metadata can be compared to. NOTE if there are multiple conditions provided, the function will require that all conditions are met to keep a statement.

Returns

estmts_out – A list of EMMAA Statements which meet the conditions.

Return type

list[emmaa.statements.EmmaaStatement]

emmaa.statements.filter_indra_stmts_by_metadata(stmts, conditions, evid_policy='any')[source]

Filter INDRA statements to those where conditions are met.

Parameters
  • stmts (list[indra.statements.Statement]) – A list of INDRA Statements to filter.

  • conditions (dict) – Conditions to filter on represented as key-value pairs that statements’ metadata can be compared to. NOTE if there are multiple conditions provided, the function will require that all conditions are met to keep a statement.

  • evid_policy (str) – Policy for checking statement’s evidence objects. If ‘all’, then the statement is kept only if all of it’s evidence objects meet the conditions. If ‘any’, the statement is kept as long as at least one of its evidences meets the conditions.

Returns

stmts_out – A list of INDRA Statements which meet the conditions.

Return type

list[indra.statements.Statement]

emmaa.statements.is_internal(stmt)[source]

Check if statement has any internal evidence.

emmaa.statements.to_emmaa_stmts(stmt_list, date=None, search_terms=None, metadata=None)[source]

Make EMMAA statements from INDRA Statements with the given metadata.