KGBN.KG_BN

KGBN.KG_BN.all_boolean_combos(n)[source]

Generates all boolean strings of length n, as tuples of 1s and 0s.

KGBN.KG_BN.load_signor_network(gene_list, input_format='symbol', joiner='&', kg_filename='SIGNOR_2025_08_14.tsv', only_proteins=True, score_cutoff=None)[source]

Creates a boolean network from SigNOR using all of the provided genes. Tries to build a connected Steiner subgraph…

Args:

gene_list - list of gene symbols, gene ids, or uniprot ids. input_format - “symbol”, “id”, or “uniprot” joiner - “&”, “|”, “inhibitor_wins”, or “majority”, or “plurality” (difference between the last two: in plurality, a tie indicates 1, in majority, a tie indicates 0) kg_filename - “SIGNOR_2025_08_14.tsv” by default. “SIGNOR_formatted.tsv” can also be used (this is an older version of SigNOR). only_proteins - whether to only use protein nodes in SIGNOR for getting the subgraph (default: True) score_cutoff - minimum score threshold for edges to be included (default: None, includes all edges)

KGBN.KG_BN.merge_PBN_string(original_string, KG_string, prob=0.5)[source]

Merge the original model and the KG model to a PBN prob: probability of the equations from the original model

KGBN.KG_BN.load_translator_network(gene_list, type=None, joiner='&', n_hop=1, sele_predicate=['biolink:regulates'], sele_tax_id=9606, sele_API=None, sele_KG=None)[source]

Creates a boolean network from Translator using all of the provided genes. Tries to build a connected Steiner subgraph among input nodes (via n_hop paths).

Args:

gene_list - list of symbols for genes, proteins, chemicals, or drugs type - “gene”, “protein”, “chemical”, “drug”, “disease”, “phenotype”, or None (all possible types) joiner - “&”, “|”, “inhibitor_wins”, or “majority”, or “plurality”

(difference between the last two: in plurality, a tie indicates 1, in majority, a tie indicates 0)

n_hop - number of hops to build the subgraph, e.g., n_hop=1 means only

direct connections between input, n_hop=2 means one hop away, etc. * currently only n_hop=1 is supported in TCT

sele_predicate - list of predicates to query from Translator sele_tax_id - tax id to use when looking up genes/proteins, default is 9606 (human) sele_API - list of APIs to select from Translator sele_KG - list of KG to select from results (matches sources resource_id

or attribute provided_by / knowledge_source values)

Returns:

(bn_string, all_relations) where bn_string is a boolean network string and all_relations is a list of (source, target, direction, score) tuples.