Answers.Body: <p><strong>ChEBI</strong></p>
  
  <p>It should be possible to get this information from the <a href="https://www.ebi.ac.uk/chebi/" rel="nofollow noreferrer">ChEBI database</a>, see the <a href="https://www.ebi.ac.uk/chebi/downloadsForward.do" rel="nofollow noreferrer">exported tables</a>. You could download the ontologies (in OWL / OBO), parse them using some ad-hoc parser or using a dedicated library (e.g., <a href="https://pypi.python.org/pypi/pronto" rel="nofollow noreferrer">Pronto</a>), build a directed acyclic graph based on the <code>is_a</code> relationship, and extract the antibiotic subtree.</p>
  
  <p><strong>KEGG</strong> </p>
  
  <p>You could also use <a href="http://www.genome.jp/kegg/" rel="nofollow noreferrer">KEGG: Kyoto Encyclopedia of Genes and Genomes</a>, but a <a href="http://www.kegg.jp/kegg/legal.html" rel="nofollow noreferrer">subscription</a> is probably required. The <a href="ftp://ftp.genome.jp/pub/kegg/medicus/drug/drug" rel="nofollow noreferrer">exported drug table</a> should be easy to parse (e.g., in Python).</p>
  
  <p>For a quick verification of the completeness, you can download the table, filter out everything except antibacterial agents and check the number of records:</p>
  
  <pre class="lang-bash prettyprint-override"><code>curl "ftp://ftp.genome.jp/pub/kegg/medicus/drug/drug" &gt; keg_all.txt
  
  cat keg_all.txt \
     | perl -pe 's/\n/BREAK/g' \
     | perl -pe 's@///BREAK@///\n@g' \
     | grep 'CLASS       Antibacterial' \
     | perl -pe 's/BREAK/\n/g' \
     &gt; keg_antibacterial.txt
  
  cat keg_antibacterial.txt | grep "///" | wc -l
  </code></pre>
  
  <p>There are 646 records. However, some of them are almost identical (e.g., only 1 atom difference).</p>
  
  <p>If you add <code>| grep -i "antibiotic" \</code> to the pipeline, then you get only 445 records.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T21:40:28.777Z
Answers.Text: Excellent resource, but does not pass the "freely available" filter: KEGG requires a yearly license. I will update my question to include that.
Answers.UserDisplayName: BaCh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T22:09:20.197Z
Answers.Text: Would ChEBI satisfy your definition of "freely available"?
Answers.UserDisplayName: Karel Břinda
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-23T14:53:19.517Z
Answers.Text: ChEBI would, indeed! And it contains approximately what I need. OBO or OWL are not necessarily formats from which it is easy to extract the wanted information as one needs to build and traverse graphs to piece together required data, but it is doable. Can you please amend your answer to include ChEBI before KEGG? I'll accept the answer then.
Answers.UserDisplayName: BaCh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T21:33:58.947Z
Answers.LastActivityDate: 2017-06-23T15:55:14.457Z
Answers.LastEditDate: 2017-06-23T15:55:14.457Z
Answers.UserDisplayName: Karel Břinda
Body: <p>This is a tough one I think: is there a publicly available, up-to-date, free, complete database for antibiotics names and classes?</p>
  
  <p>I am specifically looking for information like, e.g., <code>cefpirome (is a) cephalosporin</code>.</p>
  
  <p>I've looked in a couple of different places, but nothing really comes close. E.g.:</p>
  
  <ol>
  <li><a href="https://card.mcmaster.ca/" rel="noreferrer">CARD</a> comes closest, but is not free (companies need to pay a license) and not complete/up-to-date (e.g., cefpirome is missing)</li>
  <li>@Karel mentioned <a href="http://www.kegg.jp/" rel="noreferrer">KEGG</a> in his answer, but this also needs a license (companies for sure, academics if they download data via FTP).</li>
  <li><a href="http://www.antibiotics.or.jp/journal/database/database-top.htm" rel="noreferrer">Novel Antiobiotics Database</a> has no class ... and stops in 2003</li>
  <li><a href="http://antibiotics.toku-e.com/" rel="noreferrer">The Antimicrobial Index</a> is web only, and terms of use apparently prohibit any kind of web-scraping.</li>
  <li>A suggestion by @Pierre on Twitter was to try <a href="https://en.wikipedia.org/w/api.php?action=query&amp;list=categorymembers&amp;cmtitle=Category:Antibiotic%20stubs&amp;format=json&amp;cmlimit=500" rel="noreferrer">Antimicrobial stubs</a> on Wikipedia. Good idea, but the class is not stored in the ChemBox and must be free-text parsed. Or writing a script which evaluates the Wikipedia category tags.</li>
  <li>I drew blank at different government agencies (EMA, FDA, EFSA, NIH, etc.). The closest I found was from the WHO a list of critically important antibiotics. But not complete, and in a PDF.</li>
  </ol>
  
  <p>Any pointer appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-22T20:33:35.527Z
Comments.Text: The [FDA's NDC](https://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm) may be a good resource. It is freely available and was updated: 6/22/2017. You'll have to do some grepping to get the info you need but I think it is mostly all there. Cefpirome is not in the db but many cephalasporins are. There is also an unfinished drug list which I did not check.
Comments.UserDisplayName: emilliman5
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-22T21:31:52.163Z
Comments.Text: Good one, didn't know it. But unfortunately error prone. Some entries contain multiple ingredients, e.g., "Erythromycin and Benzoyl Peroxide", which fall into different categories and cannot be re-assigned unambiguously with the table data.
Comments.UserDisplayName: BaCh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-22T21:42:45.277Z
Comments.Text: Can you define what classes you want? For example, are efflux pumps a class? Classification schemes are not universally; I suggested CARD on Twitter because it's a full ontology rather than just 2 columns
Comments.UserDisplayName: Chris_Rands
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-22T21:50:02.797Z
Comments.Text: Well, e.g., I'd like to have the association that `cefmenoxime` is a `cephalosporin` (bonus points for 3rd, 4th or 5th generation, but not a must). Twitter didn't show me a notification of your response until I specifically looked for it, sorry. But as I wrote in examples: CARD is not free, companies need a license.
Comments.UserDisplayName: BaCh
Tags: <database>
Title: Publicly available, free, complete database for antibiotics names and classes?
ThreadText: # Publicly available, free, complete database for antibiotics names and classes?
  
  (Asked by: username_0 on 2017-06-22)
  
  This is a tough one I think: is there a publicly available, up-to-date, free, complete database for antibiotics names and classes?
  
  I am specifically looking for information like, e.g., `cefpirome (is a) cephalosporin`.
  
  I've looked in a couple of different places, but nothing really comes close. E.g.:
  
  1. [CARD](https://card.mcmaster.ca/) comes closest, but is not free (companies need to pay a license) and not complete/up-to-date (e.g., cefpirome is missing)
  2. @username_3 mentioned [KEGG](http://www.kegg.jp/) in his answer, but this also needs a license (companies for sure, academics if they download data via FTP).
  3. [Novel Antiobiotics Database](http://www.antibiotics.or.jp/journal/database/database-top.htm) has no class ... and stops in 2003
  4. [The Antimicrobial Index](http://antibiotics.toku-e.com/) is web only, and terms of use apparently prohibit any kind of web-scraping.
  5. A suggestion by @Pierre on Twitter was to try [Antimicrobial stubs](https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Antibiotic%20stubs&format=json&cmlimit=500) on Wikipedia. Good idea, but the class is not stored in the ChemBox and must be free-text parsed. Or writing a script which evaluates the Wikipedia category tags.
  6. I drew blank at different government agencies (EMA, FDA, EFSA, NIH, etc.). The closest I found was from the WHO a list of critically important antibiotics. But not complete, and in a PDF.
  
  Any pointer appreciated.
  
  **Tags:** database
  
  > **Comments:**
  > **username_1**: The [FDA's NDC](https://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm) may be a good resource. It is freely available and was updated: 6/22/2017. You'll have to do some grepping to get the info you need but I think it is mostly all there. Cefpirome is not in the db but many cephalasporins are. There is also an unfinished drug list which I did not check.  
  > **username_0**: Good one, didn't know it. But unfortunately error prone. Some entries contain multiple ingredients, e.g., "Erythromycin and Benzoyl Peroxide", which fall into different categories and cannot be re-assigned unambiguously with the table data.  
  > **username_2**: Can you define what classes you want? For example, are efflux pumps a class? Classification schemes are not universally; I suggested CARD on Twitter because it's a full ontology rather than just 2 columns  
  > **username_0**: Well, e.g., I'd like to have the association that `cefmenoxime` is a `cephalosporin` (bonus points for 3rd, 4th or 5th generation, but not a must). Twitter didn't show me a notification of your response until I specifically looked for it, sorry. But as I wrote in examples: CARD is not free, companies need a license.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2017-06-22. Score: 6 | Accepted answer
  
  **ChEBI**
  
  It should be possible to get this information from the [ChEBI database](https://www.ebi.ac.uk/chebi/), see the [exported tables](https://www.ebi.ac.uk/chebi/downloadsForward.do). You could download the ontologies (in OWL / OBO), parse them using some ad-hoc parser or using a dedicated library (e.g., [Pronto](https://pypi.python.org/pypi/pronto)), build a directed acyclic graph based on the `is_a` relationship, and extract the antibiotic subtree.
  
  **KEGG**
  
  You could also use [KEGG: Kyoto Encyclopedia of Genes and Genomes](http://www.genome.jp/kegg/), but a [subscription](http://www.kegg.jp/kegg/legal.html) is probably required. The [exported drug table](ftp://ftp.genome.jp/pub/kegg/medicus/drug/drug) should be easy to parse (e.g., in Python).
  
  For a quick verification of the completeness, you can download the table, filter out everything except antibacterial agents and check the number of records:
  
  ```bash
  curl "ftp://ftp.genome.jp/pub/kegg/medicus/drug/drug" > keg_all.txt
  
  cat keg_all.txt \
     | perl -pe 's/\n/BREAK/g' \
     | perl -pe 's@///BREAK@///\n@g' \
     | grep 'CLASS       Antibacterial' \
     | perl -pe 's/BREAK/\n/g' \
     > keg_antibacterial.txt
  
  cat keg_antibacterial.txt | grep "///" | wc -l
  
  ```
  
  There are 646 records. However, some of them are almost identical (e.g., only 1 atom difference).
  
  If you add `| grep -i "antibiotic" \` to the pipeline, then you get only 445 records.
  
  > **Comments:**
  > **username_0**: Excellent resource, but does not pass the "freely available" filter: KEGG requires a yearly license. I will update my question to include that.  
  > **username_3**: Would ChEBI satisfy your definition of "freely available"?  
  > **username_0**: ChEBI would, indeed! And it contains approximately what I need. OBO or OWL are not necessarily formats from which it is easy to extract the wanted information as one needs to build and traverse graphs to piece together required data, but it is doable. Can you please amend your answer to include ChEBI before KEGG? I'll accept the answer then.  
  
  ---
  
  