BEL (indra.bel)

BEL API (indra.bel.bel_api)

indra.bel.bel_api.process_belrdf(rdf_str, print_output=True)[source]

Return a BelProcessor for a BEL/RDF string.

Parameters:rdf_str (str) – A BEL/RDF string to be processed. This will usually come from reading a .rdf file.
Returns:bp – A BelProcessor object which contains INDRA Statements in bp.statements.
Return type:BelProcessor

Notes

This function calls all the specific get_type_of_mechanism() functions of the newly constructed BelProcessor to extract INDRA Statements.

indra.bel.bel_api.process_ndex_neighborhood(gene_names, network_id=None, rdf_out=u'bel_output.rdf', print_output=True)[source]

Return a BelProcessor for an NDEx network neighborhood.

Parameters:
  • gene_names (list) – A list of HGNC gene symbols to search the neighborhood of. Example: [‘BRAF’, ‘MAP2K1’]
  • network_id (Optional[str]) – The UUID of the network in NDEx. By default, the BEL Large Corpus network is used.
  • rdf_out (Optional[str]) – Name of the output file to save the RDF returned by the web service. This is useful for debugging purposes or to repeat the same query on an offline RDF file later. Default: bel_output.rdf
Returns:

bp – A BelProcessor object which contains INDRA Statements in bp.statements.

Return type:

BelProcessor

Notes

This function calls process_belrdf to the returned RDF string from the webservice.

BEL Processor (indra.bel.processor)

class indra.bel.processor.BelProcessor(g)[source]

The BelProcessor extracts INDRA Statements from a BEL RDF model.

Parameters:g (rdflib.Graph) – An RDF graph object containing the BEL model.
g

rdflib.Graph – An RDF graph object containing the BEL model.

statements

list[indra.statement.Statements] – A list of extracted INDRA Statements representing direct mechanisms. This list should be used for assembly in INDRA.

indirect_stmts

list[indra.statement.Statements] – A list of extracted INDRA Statements representing indirect mechanisms. This list should be used for assembly or model checking in INDRA.

converted_direct_stmts

list[str] – A list of all direct BEL statements, as strings, that were converted into INDRA Statements.

converted_indirect_stmts

list[str] – A list of all indirect BEL statements, as strings, that were converted into INDRA Statements.

degenerate_stmts

list[str] – A list of degenerate BEL statements, as strings, in the BEL model.

all_direct_stmts

list[str] – A list of all BEL statements representing direct interactions, as strings, in the BEL model.

all_indirect_stmts

list[str] – A list of all BEL statements that represent indirect interactions, as strings, in the BEL model.

get_activating_mods()[source]

Extract INDRA ActiveForm Statements with a single mod from BEL.

get_activating_subs()[source]

Extract INDRA ActiveForm Statements based on a mutation from BEL.

get_activation()[source]

Extract INDRA Activation Statements from BEL.

get_all_direct_statements()[source]

Get all directlyIncreases/Decreases BEL statements.

Stores the results of the query in self.all_direct_stmts.

get_all_indirect_statements()[source]

Get all indirect increases/decreases BEL statements.

Stores the results of the query in self.all_indirect_stmts.

get_complexes()[source]

Extract INDRA Complex Statements from BEL.

get_composite_activating_mods()[source]

Extract INDRA ActiveForm Statements with multiple mods from BEL.

get_degenerate_statements()[source]

Get all degenerate BEL statements.

Stores the results of the query in self.degenerate_stmts.

get_modifications()[source]

Extract INDRA Modification Statements from BEL.

get_transcription()[source]

Get statements of the form tscript(X) inc/dec r(Y).

print_statement_coverage()[source]

Display how many of the direct statements have been converted.

Also prints how many are considered ‘degenerate’ and not converted.

print_statements()[source]

Print all extracted INDRA Statements.

indra.bel.processor.namespace_from_uri(uri)[source]

Return the entity namespace from the URI. Examples: http://www.openbel.org/bel/p_HGNC_RAF1 -> HGNC http://www.openbel.org/bel/p_RGD_Raf1 -> RGD http://www.openbel.org/bel/p_PFH_MEK1/2_Family -> PFH

indra.bel.processor.term_from_uri(uri)[source]

Removes prepended URI information from terms.