Input and Output Functions (VIOLN.in_out)

This page details the functions which handle the input files and output of VIOLIN.

For more information on the types of accepted inputs, see Input and Output Files.

Functions

VIOLIN.in_out.input_biorecipes(model, model_cols=['Element Name', 'Element Type', 'Element IDs', 'Variable', 'Positive Regulators', 'Positive Regulators Connection Type', 'Negative Regulators', 'Negative Regulators Connection Type'])[source]

This function imports a model file which is already in the BioRECIPES format, and converts all characters to lower case

Parameters
  • model (str) – Directory and filename of the file containing the model spreadsheet in BioRECIPES format Accepted files: .txt, .csv, .tsv, .xlsx

  • model_cols (list) – Column names of the model file. Default names found in model_columns

Returns

new_model – Formatted model dataframe

Return type

pd.DataFrame

VIOLIN.in_out.input_reading(reading, evidence_score_cols=['Element Name', 'Element Type', 'Element ID', 'Positive Reg Name', 'Positive Reg Type', 'Positive Reg ID', 'Negative Reg Name', 'Negative Reg Type', 'Negative Reg ID', 'Connection Type'], atts=[])[source]

This function imports the reading file into the correct mode

Parameters
  • reading (str) – Directory and filename of the machine reading spreadsheet output Accepted files: .txt, .csv, .tsv, .xlsx

  • evidence_score_cols (list) – Column headings used to identify identical interactions in the machine reading output

  • atts (list) – List of additional attributes which are available in LEE output Default is none

Returns

new_reading – Formatted reading dataframe, including evidence count and list of PMCIDs

Return type

pd.DataFrame]

VIOLIN.in_out.output(reading_df, file_name, kind_values={'att contradiction': 12, 'dir contradiction': 10, 'flagged1': 20, 'flagged2': 20, 'flagged3': 20, 'full extension': 40, 'hanging extension': 40, 'internal extension': 40, 'sign contradiction': 11, 'specification': 30, 'strong corroboration': 2, 'weak corroboration1': 1, 'weak corroboration2': 1, 'weak corroboration3': 1})[source]

This function outputs the scored reading interactions. This writes output files, there are no return variables

Parameters
  • reading_df (pd.DataFrame) – Dataframe of the scored reading dataframe

  • file_name (str) – Directory and filename of the output suffix

  • kind_values (dict) – Dictionary containing the numerical values for the Kind Score classifications Default values are found in kind_dict

Dependencies

Python: pandas and NumPy libraries, and os.path module

VIOLIN: formatting and network modules.

Defaults

Default Reading Columns

34
35
36
37
reading_columns = ['Element Name', 'Element Type', 'Element ID',
                   'Positive Reg Name', 'Positive Reg Type', 'Positive Reg ID',
                   'Negative Reg Name', 'Negative Reg Type', 'Negative Reg ID',
                   'Connection Type', 'Mechanism', 'Paper ID', 'Evidence']

Default Model Columns (From BioRECIPES format)

38
39
40
model_columns = ['Element Name', 'Element Type', 'Element IDs', 'Variable',
                 'Positive Regulators', 'Positive Regulators Connection Type',
                 'Negative Regulators', 'Negative Regulators Connection Type']