EMMAA Statement (emmaa.statements)

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

Bases: object

Represents an EMMAA Statement.

Parameters:
  • stmt (indra.statements.Statement) – An INDRA Statement
  • date (datetime) – A datetime object that is attached to the Statement. Typically represents the time at which the Statement was created.
  • search_terms (list[emmaa.priors.SearchTerm]) – The list of search terms that led to the creation of the Statement.
  • metadata (dict) – Additional metadata for the statement.
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, search_terms, metadata=None)[source]

Make EMMAA statements from INDRA Statements with the given metadata.