Answers.Body: <p>Your question encompasses a number of different scenarios:</p>
  <ol>
  <li>Your search term is not the primary label for the MeSH concept, but is an accepted alias or synonym (which may or may not be recorded in MeSH)</li>
  <li>Given an input term, find a broader category of terms (e.g Benz[a]anthracene is narrower than PAC, which is your example)</li>
  <li>The input term is a substring or superstring of the actual term or alias</li>
  <li>The input term has typos and you want to search using string distance</li>
  </ol>
  <p>There are a number of online APIs that can help with this, but they may differ in how well they handle each of the above scenarios, as well as other factors such as update frequency.</p>
  <p>Most ontology portals such as OLS or Bioportal provide <em>search</em> endpoints that help with 1. These should all make use of official aliases. They may differ in how they deal with 3 or 4, but relevancy ranking is typically used with exact matches returned first.</p>
  <p>An example is the bioportal API here: <a href="http://data.bioontology.org/documentation#nav_search" rel="nofollow noreferrer">http://data.bioontology.org/documentation#nav_search</a></p>
  <p>Note you will want to parameterize your search to restrict it to MeSH, but expanding the number of ontologies can be a good strategy to increase recall.</p>
  <p>Bioportal and other ontology APIs also provide hierarchy endpoints to get parent concepts like PAC.</p>
  <p>Another service is the NCATS Biomedical Translator Name Resolution service. This makes use of multiple different ontologies and chemical databases to increase recall, but can give back results mapped to your favored system, eg MeSh</p>
  <p>The service is here: <a href="https://name-resolution-sri.renci.org/docs" rel="nofollow noreferrer">https://name-resolution-sri.renci.org/docs</a></p>
  <p>Your example: <a href="https://name-resolution-sri.renci.org/lookup?string=Benz%5Ba%5Danthracene&amp;autocomplete=true&amp;offset=0&amp;limit=10&amp;only_prefixes=MESH" rel="nofollow noreferrer">https://name-resolution-sri.renci.org/lookup?string=Benz%5Ba%5Danthracene&amp;autocomplete=true&amp;offset=0&amp;limit=10&amp;only_prefixes=MESH</a></p>
  <p>This returns the correct MeSH term even though it is a lexical variant of the input</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-17T17:04:31.850Z
Answers.LastActivityDate: 2024-08-17T17:04:31.850Z
Answers.UserDisplayName: Chris Mungall
Body: <p>Given a list of substance (which can be expressed in any form: general terms or chemical taxonomy) I need to find the specific MeSH term.</p>
  <p>I understood that I can use those web services: <a href="https://id.nlm.nih.gov/mesh/swagger/ui" rel="nofollow noreferrer">https://id.nlm.nih.gov/mesh/swagger/ui</a>
  More specifically, the webservice <a href="https://id.nlm.nih.gov/mesh/lookup/term" rel="nofollow noreferrer">https://id.nlm.nih.gov/mesh/lookup/term</a> does a sort of &quot;lookup&quot; and, if found, it returns label, mesh term and URI. However, this web service works only if the input string is part of the mesh term.</p>
  <p>Eg: <strong>input</strong> = arsenit
  <strong>output</strong> = {'substance': 'Arsenite', 'MeSH': 'arsenite', 'URI': 'http://id.nlm.nih.gov/mesh/T093970'}</p>
  <p><strong>Essentially, the web service it works by comparing strings</strong> (arsenit is substring of arsenite).</p>
  <p>Often the substance I use as input is expressed in a way that the string comparison will fail. Is there any service/library that can overcome this limit?</p>
  <p>eg: <strong>input</strong> = Benz[a]anthracene
  <strong>expected output</strong> = Polycyclic Aromatic Hydrocarbons</p>
  
Tags: <public-databases><data-retrieval>
Title: Finding related Mesh Terms given a substance
ThreadText: # Finding related Mesh Terms given a substance
  
  (Asked by: username_0 on 2024-08-16)
  
  Given a list of substance (which can be expressed in any form: general terms or chemical taxonomy) I need to find the specific MeSH term.
  
  I understood that I can use those web services: <https://id.nlm.nih.gov/mesh/swagger/ui>
  More specifically, the webservice <https://id.nlm.nih.gov/mesh/lookup/term> does a sort of "lookup" and, if found, it returns label, mesh term and URI. However, this web service works only if the input string is part of the mesh term.
  
  Eg: **input** = arsenit
  **output** = {'substance': 'Arsenite', 'MeSH': 'arsenite', 'URI': 'http://id.nlm.nih.gov/mesh/T093970'}
  
  **Essentially, the web service it works by comparing strings** (arsenit is substring of arsenite).
  
  Often the substance I use as input is expressed in a way that the string comparison will fail. Is there any service/library that can overcome this limit?
  
  eg: **input** = Benz[a]anthracene
  **expected output** = Polycyclic Aromatic Hydrocarbons
  
  **Tags:** public-databases, data-retrieval
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-08-17. Score: 1 | Accepted answer
  
  Your question encompasses a number of different scenarios:
  
  1. Your search term is not the primary label for the MeSH concept, but is an accepted alias or synonym (which may or may not be recorded in MeSH)
  2. Given an input term, find a broader category of terms (e.g Benz[a]anthracene is narrower than PAC, which is your example)
  3. The input term is a substring or superstring of the actual term or alias
  4. The input term has typos and you want to search using string distance
  
  There are a number of online APIs that can help with this, but they may differ in how well they handle each of the above scenarios, as well as other factors such as update frequency.
  
  Most ontology portals such as OLS or Bioportal provide *search* endpoints that help with 1. These should all make use of official aliases. They may differ in how they deal with 3 or 4, but relevancy ranking is typically used with exact matches returned first.
  
  An example is the bioportal API here: <http://data.bioontology.org/documentation#nav_search>
  
  Note you will want to parameterize your search to restrict it to MeSH, but expanding the number of ontologies can be a good strategy to increase recall.
  
  Bioportal and other ontology APIs also provide hierarchy endpoints to get parent concepts like PAC.
  
  Another service is the NCATS Biomedical Translator Name Resolution service. This makes use of multiple different ontologies and chemical databases to increase recall, but can give back results mapped to your favored system, eg MeSh
  
  The service is here: <https://name-resolution-sri.renci.org/docs>
  
  Your example: <https://name-resolution-sri.renci.org/lookup?string=Benz%5Ba%5Danthracene&autocomplete=true&offset=0&limit=10&only_prefixes=MESH>
  
  This returns the correct MeSH term even though it is a lexical variant of the input
  
  
  ---
  
  