Browse Source

add morgan fp extractor and smiles extractor from PubChem

main
MahsaYazdani 2 years ago
parent
commit
d72ad6676c
2 changed files with 255 additions and 0 deletions
  1. 97
    0
      Drug/Dataset/Smiles/extract_smiles.ipynb
  2. 158
    0
      Drug/drug_features.ipynb

+ 97
- 0
Drug/Dataset/Smiles/extract_smiles.ipynb View File

@@ -0,0 +1,97 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import requests"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"\n",
"url = 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/vioxx/property/CanonicalSMILES/TXT'\n",
"data = '''{\n",
" \"query\": {\n",
" \"bool\": {\n",
" \"must\": [\n",
" {\n",
" \"text\": {\n",
" \"record.document\": \"SOME_JOURNAL\"\n",
" }\n",
" },\n",
" {\n",
" \"text\": {\n",
" \"record.articleTitle\": \"farmers\"\n",
" }\n",
" }\n",
" ],\n",
" \"must_not\": [],\n",
" \"should\": []\n",
" }\n",
" },\n",
" \"from\": 0,\n",
" \"size\": 50,\n",
" \"sort\": [],\n",
" \"facets\": {}\n",
"}'''\n",
"response = requests.post(url, data=data)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"200\n",
"CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3\n",
"\n"
]
}
],
"source": [
"print(response.status_code)\n",
"print(response.text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

+ 158
- 0
Drug/drug_features.ipynb
File diff suppressed because it is too large
View File


Loading…
Cancel
Save