psamm.bayesian_util – Bayesian Matching Utility Functions

Utility functions.

psamm.bayesian_util.id_equals(id1, id2)

Return True if the two IDs are considered equal.

psamm.bayesian_util.name_equals(name1, name2)

Return True if the two names are considered equal.

psamm.bayesian_util.name_similar(name1, name2)

Return the possibility that two names are considered equal.

psamm.bayesian_util.formula_equals(f1, f2, charge1, charge2)

Return True if the two formulas are considered equal.

psamm.bayesian_util.genes_equals(g1, g2, gene_map={})

Return True if the two gene association strings are considered equal.

Parameters:
  • g2 (g1,) – gene association strings
  • gene_map – a dict that maps gene ids in g1 to gene ids in g2 if they have different naming system
psamm.bayesian_util.formula_exact(f1, f2)

Return True if the two formulas are considered equal.

psamm.bayesian_util.pairwise_distance(i1, i2, distance, threshold=None)

Pairwise distances.

psamm.bayesian_util.levenshtein(s1, s2)

Edit distance function.

psamm.bayesian_util.jaccard(s1, s2)

Jaccard similarity function.