<commit_before><!DOCTYPE html>
<html>
<head>
  <title>SNiPhunter API</title>
 <!--HTML metatags-->
<meta charset="UTF-8"/>
<meta name="description" content="SNiPhunter SNP search engine: Single Nucleotide Polymorphisms (SNP) Application Programming Interface (API)"/>
<meta name="keywords" content="SNP, API"/>
<!--Dublin Core metatags-->
<meta name="DC.title" content="SNiPhunter"/>
<meta name="DC.subject" content="bioinformatics"/>
<meta name="DC.publisher" content="South African National Bioinformatics Institute"/>
<meta name="DC.creator" content="<NAME>">
<meta name="DC.date" scheme="W3CDTF" content="2015-10-01">
<!--Script and stylesheet references-->
<script language="javascript" type="text/javascript" src="/scripts/jquery-2.1.4.min.js"></script>
<script language="javascript" type="text/javascript" src="/stylesheet/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="/stylesheet/bootstrap-3.3.5-dist/css/bootstrap.css">
<link rel="stylesheet" href="/stylesheet/mystyle.css">
<link rel="icon" href="http://sniphunter.sanbi.ac.za/favicon.ico">
<link rel="stylesheet" href="/scripts/highlight/styles/darkula.css">
<script src="/scripts/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!--Google tracking code-->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-68718403-1', 'auto');
  ga('send', 'pageview');
</script>
</head>
<!--RDFa tags-->
<body vocab="http://schema.org/" typeof="MedicalWebPage">
<link property="audience" href="http://schema.org/MedicalResearcher"/>
<link property="audience" href="http://schema.org/Clinician"/>
<!--Navigation bar-->
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="/index.html" class="navbar-brand myFont">SNiPhunter</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="/index.html" alt="SNP identifiers">Search by rs identifier</a></li>
        <li><a href="/multiple.html" alt="Multiple queries">Search by rs identifier (multiple)</a></li>
        <li><a href="/keywords.html" alt="Article keywords">Search by keyword</a></li>
        <li><a href="/API.html" alt="API">API</a></li>
        <li><a href="/VCFparse.html" alt="VCF parsing">VCF file parse</a></li>
        <li><a href="/download.html" alt="Downloads">Download SNiPhunter</a></li>
        <li><a href="/contact.html" alt="Contact information">Contact</a></li>
      </ul>
    </div>
  </div>
</nav>
<!-- Main content -->
<div class = "divspecs" vocab="http://schema.org/" typeof="APIReference">
  <a href="https://www.plos.org/open-access/"><img src="/images/Open.png" alt="Open Access" style="margin: 0px 0px 15px" height="55px" width="70px"></a><a href="https://opensource.org/"><img src="/images/source.png" alt="Open Source" height="75px" width="75px"></a>
  <h1 class="myFont">SNP search engine<span style="font-size:15px; color:red"> beta</span></h1><br>
  <h3 property = "about"><b>Calls can be made to <span property = "name">SNiPhunter's API</span> using HTTP GET requests</b></h3> <br>
  <h4><u>Example 1</u></h4>
  <h4 property = "featureList">Return objects to browser in JSON if they contain the reference SNP ID <i>rs5743810</i>:</h4>
  <h4 property = "url" ><a style="color:Royalblue" href="http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810"><b>http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810</b></a></h4><br><br>
  <h4><u>Example 2</u></h4>
  <h4 property = "featureList">Return objects to browser in JSON if they contain both <i>cancer</i> and <i>USF</i> as keywords:</h4>
  <h4 property = "url" ><a style="color:Royalblue" href="http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?keywords[]=cancer&keywords[]=USF"><b>http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?keywords[]=cancer&keywords[]=USF</b></a></h4><br><br>
  <h4><u>Example 3</u></h4>
  <h4 property = "featureList">Return a list containing each object's DOI (using Python 3) if the object contains reference SNP ID <i>rs5743810</i>:</h4>
  <pre style = "text-align: left; display: inline-block;"><code = "python">
import httplib2
import json
h = httplib2.Http()
resp, content = h.request("http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810")
assert resp.status == 200
result = content.decode("utf-8")
inJSON = json.loads(result)
for dictionary in inJSON:
    for key, value in dictionary.items():
        if key == "doi":
            print(value)
  </code></pre>
</div>
</body>
</html><commit_msg>Amended API example 3<commit_after><!DOCTYPE html>
<html>
<head>
  <title>SNiPhunter API</title>
 <!--HTML metatags-->
<meta charset="UTF-8"/>
<meta name="description" content="SNiPhunter SNP search engine: Single Nucleotide Polymorphisms (SNP) Application Programming Interface (API)"/>
<meta name="keywords" content="SNP, API"/>
<!--Dublin Core metatags-->
<meta name="DC.title" content="SNiPhunter"/>
<meta name="DC.subject" content="bioinformatics"/>
<meta name="DC.publisher" content="South African National Bioinformatics Institute"/>
<meta name="DC.creator" content="<NAME>">
<meta name="DC.date" scheme="W3CDTF" content="2015-10-01">
<!--Script and stylesheet references-->
<script language="javascript" type="text/javascript" src="/scripts/jquery-2.1.4.min.js"></script>
<script language="javascript" type="text/javascript" src="/stylesheet/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="/stylesheet/bootstrap-3.3.5-dist/css/bootstrap.css">
<link rel="stylesheet" href="/stylesheet/mystyle.css">
<link rel="icon" href="http://sniphunter.sanbi.ac.za/favicon.ico">
<link rel="stylesheet" href="/scripts/highlight/styles/darkula.css">
<script src="/scripts/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!--Google tracking code-->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-68718403-1', 'auto');
  ga('send', 'pageview');
</script>
</head>
<!--RDFa tags-->
<body vocab="http://schema.org/" typeof="MedicalWebPage">
<link property="audience" href="http://schema.org/MedicalResearcher"/>
<link property="audience" href="http://schema.org/Clinician"/>
<!--Navigation bar-->
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="/index.html" class="navbar-brand myFont">SNiPhunter</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="/index.html" alt="SNP identifiers">Search by rs identifier</a></li>
        <li><a href="/multiple.html" alt="Multiple queries">Search by rs identifier (multiple)</a></li>
        <li><a href="/keywords.html" alt="Article keywords">Search by keyword</a></li>
        <li><a href="/API.html" alt="API">API</a></li>
        <li><a href="/VCFparse.html" alt="VCF parsing">VCF file parse</a></li>
        <li><a href="/download.html" alt="Downloads">Download SNiPhunter</a></li>
        <li><a href="/contact.html" alt="Contact information">Contact</a></li>
      </ul>
    </div>
  </div>
</nav>
<!-- Main content -->
<div class = "divspecs" vocab="http://schema.org/" typeof="APIReference">
  <a href="https://www.plos.org/open-access/"><img src="/images/Open.png" alt="Open Access" style="margin: 0px 0px 15px" height="55px" width="70px"></a><a href="https://opensource.org/"><img src="/images/source.png" alt="Open Source" height="75px" width="75px"></a>
  <h1 class="myFont">SNP search engine<span style="font-size:15px; color:red"> beta</span></h1><br>
  <h3 property = "about"><b>Calls can be made to <span property = "name">SNiPhunter's API</span> using HTTP GET requests</b></h3> <br>
  <h4><u>Example 1</u></h4>
  <h4 property = "featureList">Return objects to browser in JSON if they contain the reference SNP ID <i>rs5743810</i>:</h4>
  <h4 property = "url" ><a style="color:Royalblue" href="http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810"><b>http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810</b></a></h4><br><br>
  <h4><u>Example 2</u></h4>
  <h4 property = "featureList">Return objects to browser in JSON if they contain both <i>cancer</i> and <i>USF</i> as keywords:</h4>
  <h4 property = "url" ><a style="color:Royalblue" href="http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?keywords[]=cancer&keywords[]=USF"><b>http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?keywords[]=cancer&keywords[]=USF</b></a></h4><br><br>
  <h4><u>Example 3</u></h4>
  <h4 property = "featureList">Return a list containing each object's DOI (using Python 3) if the object contains reference SNP ID <i>rs5743810</i>:</h4>
  <pre style = "text-align: left; display: inline-block;"><code = "python">
import httplib2
import json
h = httplib2.Http()
resp, content = h.request("http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810")
assert resp.status == 200
result = content.decode("utf-8")
inJSON = json.loads(result)
for dictionary in inJSON:
    for key, value in dictionary.items():
        if key == "doi":
            print(value)
  </code></pre>
<h4>The above example can be amended by replacing the term <i>doi</i> in the second from last line with <i>email_address</i>, <i>publication_date</i>, <i>pubmed_id</i>, <i>pubmed_file_name</i>, <i>keywords</i> or <i>rs_number_cited_in_article</i> depending on what information is required.</h4>
</div>
</body>
</html>
{'fraction_non_alphanumeric': 0.208049939439113, 'fraction_numerical': 0.021149725146743688, 'mean_word_length': 5.1689655172413795, 'pattern_counts': {'":': 2, '<': 333, '<?xml version=': 0, '>': 333, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7381771', 'n_tokens_mistral': 3890, 'n_tokens_neox': 3673, 'n_words': 719}