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='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.

The SPARQL pattern used for extraction from BEL looks for a ModifiedProteinAbundance as subject and an Activiy of a ProteinAbundance as object.

Examples

proteinAbundance(HGNC:INSR,proteinModification(P,Y)) directlyIncreases kinaseActivity(proteinAbundance(HGNC:INSR))

get_activating_subs()[source]

Extract INDRA ActiveForm Statements based on a mutation from BEL.

The SPARQL pattern used to extract ActiveForms due to mutations look for a ProteinAbundance as a subject which has a child encoding the amino acid substitution. The object of the statement is an ActivityType of the same ProteinAbundance, which is either increased or decreased.

Examples

proteinAbundance(HGNC:NRAS,substitution(Q,61,K)) directlyIncreases gtpBoundActivity(proteinAbundance(HGNC:NRAS))

proteinAbundance(HGNC:TP53,substitution(F,134,I)) directlyDecreases transcriptionalActivity(proteinAbundance(HGNC:TP53))

get_activation()[source]

Extract INDRA Inhibition/Activation Statements from BEL.

The SPARQL query used to extract Activation Statements looks for patterns in which the subject is is an ActivityType (of a ProtainAbundance) or an Abundance (of a small molecule). The object has to be the ActivityType (typically of a ProteinAbundance) which is either increased or decreased.

Examples

abundance(CHEBI:gefitinib) directlyDecreases kinaseActivity(proteinAbundance(HGNC:EGFR))

kinaseActivity(proteinAbundance(HGNC:MAP3K5)) directlyIncreases kinaseActivity(proteinAbundance(HGNC:MAP2K7))

This pattern covers the extraction of Gap/Gef and GtpActivation Statements, which are recognized by the object activty or the subject activity, respectively, being gtpbound.

Examples

catalyticActivity(proteinAbundance(HGNC:RASA1)) directlyDecreases gtpBoundActivity(proteinAbundance(PFH:”RAS Family”))

catalyticActivity(proteinAbundance(HGNC:SOS1)) directlyIncreases gtpBoundActivity(proteinAbundance(HGNC:HRAS))

gtpBoundActivity(proteinAbundance(HGNC:HRAS)) directlyIncreases catalyticActivity(proteinAbundance(HGNC:TIAM1))

get_all_direct_statements()[source]

Get all directlyIncreases/Decreases BEL statements.

This method stores the results of the query in self.all_direct_stmts as a list of strings. The SPARQL query used to find direct BEL statements searches for all statements whose predicate is either DirectyIncreases or DirectlyDecreases.

get_all_indirect_statements()[source]

Get all indirect increases/decreases BEL statements.

This method stores the results of the query in self.all_indirect_stmts as a list of strings. The SPARQL query used to find indirect BEL statements searches for all statements whose predicate is either Increases or Decreases.

get_complexes()[source]

Extract INDRA Complex Statements from BEL.

The SPARQL query used to extract Complexes looks for ComplexAbundance terms and their constituents. This pattern is distinct from other patterns in this processor in that it queries for terms, not full statements.

Examples

complexAbundance(proteinAbundance(HGNC:PPARG), proteinAbundance(HGNC:RXRA)) decreases biologicalProcess(MESHPP:”Insulin Resistance”)

get_composite_activating_mods()[source]

Extract INDRA ActiveForm Statements with multiple mods from BEL.

The SPARQL pattern used for extraction from BEL looks for a CompositeAbundance as subject where two constituents of the composite are both ModifiedProteinAbundances. The object has to be a Activity of a ProteinAbundance.

Examples

compositeAbundance( proteinAbundance(PFH:”AKT Family”,proteinModification(P,S,473)), proteinAbundance(PFH:”AKT Family”,proteinModification(P,T,308))) directlyIncreases kinaseActivity(proteinAbundance(PFH:”AKT Family”))

get_conversions()[source]

Extract Conversion INDRA Statements from BEL.

The SPARQL query used to extract Conversions searches for a subject (controller) which is an AbundanceActivity which directlyIncreases a Reaction with a given list of Reactants and Products.

Examples

catalyticActivity(proteinAbundance(HGNC:HMOX1)) directlyIncreases reaction(reactants(abundance(CHEBI:heme)), products(abundance(SCHEM:Biliverdine), abundance(CHEBI:”carbon monoxide”)))

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.

Two SPARQL patterns are used for extracting Modifications from BEL:

  • q_phospho1 assumes that the subject is an AbundanceActivity, which increases/decreases a ModifiedProteinAbundance.

    Examples:

    kinaseActivity(proteinAbundance(HGNC:IKBKE)) directlyIncreases proteinAbundance(HGNC:IRF3,proteinModification(P,S,385))

    phosphataseActivity(proteinAbundance(HGNC:DUSP4)) directlyDecreases proteinAbundance(HGNC:MAPK1,proteinModification(P,T,185))

  • q_phospho2 assumes that the subject is a ProteinAbundance which increases/decreases a ModifiedProteinAbundance.

    Examples:

    proteinAbundance(HGNC:NGF) increases proteinAbundance(HGNC:NFKBIA,proteinModification(P,Y,42))

    proteinAbundance(HGNC:FGF1) decreases proteinAbundance(HGNC:RB1,proteinModification(P))

get_transcription()[source]

Extract Increase/DecreaseAmount INDRA Statements from BEL.

Three distinct SPARQL patterns are used to extract amount regulations from BEL.

  • q_tscript1 searches for a subject which is a Transcription ActivityType of a ProteinAbundance and an object which is an RNAAbundance that is either increased or decreased.

    Examples:

    transcriptionalActivity(proteinAbundance(HGNC:FOXP2)) directlyIncreases rnaAbundance(HGNC:SYK)

    transcriptionalActivity(proteinAbundance(HGNC:FOXP2)) directlyDecreases rnaAbundance(HGNC:CALCRL)

  • q_tscript2 searches for a subject which is a ProteinAbundance and an object which is an RNAAbundance. Note that this pattern typically exists in an indirect form (i.e. increases/decreases).

    Example:

    proteinAbundance(HGNC:MTF1) directlyIncreases rnaAbundance(HGNC:LCN1)

  • q_tscript3 searches for a subject which is a ModifiedProteinAbundance, with an object which is an RNAAbundance. In the BEL large corpus, this pattern is found for subjects which are protein families or mouse/rat proteins, and the predicate in an indirect increase.

    Example:

    proteinAbundance(PFR:”Akt Family”,proteinModification(P)) increases rnaAbundance(RGD:Cald1)

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.