Groups
Groups
Sign in
Groups
Groups
eQuilibrator Users
Conversations
About
Send feedback
Help
cc.search_compound confidence metric?
9 views
Skip to first unread message
Maggie Cook
unread,
Feb 4, 2025, 3:03:51 PM
Feb 4
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to eQuilibrator Users
Hello,
When using cc.search_compound, is there a way to also return some sort of score which quantifies the confidence of the returned identifiers?
Thanks!
Elad Noor
unread,
Feb 5, 2025, 3:23:14 AM
Feb 5
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to eQuilibrator Users
Hello,
Yes, search_compound is simply a wrapper for the CompoundCache function "search":
https://gitlab.com/equilibrator/equilibrator-cache/-/blob/develop/src/equilibrator_cache/compound_cache.py?ref_type=heads#L262
Here is a code example:
from equilibrator_api import ComponentContribution
cc = ComponentContribution()
search_results = cc.ccache.search("glucose", page=1, page_size=100)
The result will be a list of tuples: (Compound, score).
The score is based on the "ratio" function from the Levenshtein package:
https://rapidfuzz.github.io/Levenshtein/levenshtein.html#ratio
So the highest score will be 1 (perfect match) and will go down as the edit distance increases.
Best,
Elad
Reply all
Reply to author
Forward
0 new messages