Numerical Functions (VIOLIN.numeric)

This page details the numeric operators of VIOLIN.

These functions discretize qualitative operations within VIOLIN:

  1. searching for an element in the reading output,

  2. comparing attributes, indentifying whether a given attribute

    • matches exactly an attribute in a corresponding model interaction (MI),

    • is missing where a MI attribute is present,

    • is present where a MI attribute is missing,

    • differs from an attribute in a corresponding MI.

Both functions return numerical values to represent the outcome of the function.

Functions

VIOLIN.numeric.find_element(search_type, element_name, element_type, model_df)[source]

This function finds the correct indices of an element within the model. Because elements can exists as multiple types (Protein, RNA, gene, etc.), this function checks the element name/ID along with the element type. Function may return a list, if a given element of a specific type exists with varying attributes (such as different locations)

Parameters
  • search_type (str) – Whether the element is being searched for by ‘name’ or ‘ID’

  • element_name (str) – The name (or ID) of the element being searched for

  • element_type (str) – The type of element searched for (‘protein’, ‘protein family’, etc.)

  • model_df (pd.DataFrame) – The model dataframe

Returns

location – All rows of the model spreadsheet in which the element is found (returns -1 if not found)

Return type

list

VIOLIN.numeric.compare(model_atts, reading_atts)[source]

Compares a list of model attributes to the corresponding LEE attributes, returns numeric value

Attributes are the same (strong corroboration): 0

Some or all LEE attributes are missing (weak corroboration): 1

Some or all of the model attributes are missing (specification): 2

One or more model attribue differs from the LEE attributes (contradiction): 3

Parameters
  • model_att (list) – List of attributes from the model interaction

  • reading_att (list) – List of attributes from the literature extracted event (LEE)

Returns

value – Numerical representation of comparison outcome

Return type

int

Dependencies

Python: pandas library

VIOLIN: none

Usage

This example searches for the index of protein family AMPK in the model spreadsheet.:

find_element_index("name","ampk","protein family",model_df)
>> 2

This example compares the location of the reading interaction to the location of its counterpart interaction in the model.:

reading_att = "nan"
model_att = "GO:0005737"
compare(model_att,reading_att)
>> 2