forked from LadyBluenotes/global-chem
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
..._chem_extensions/software_adapters/smarts_pattern_visualizer/smarts_pattern_visualizer.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
...xtensions/global_chem_extensions/software_adapters/smarts_visualizer/smarts_visualizer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# GlobalChemExtensions - SMARTS Pattern Visualizer | ||
# | ||
# ------------------------------------------------ | ||
|
||
|
||
# Imports | ||
# ------- | ||
|
||
import urllib | ||
import requests | ||
|
||
from rdkit import Chem | ||
from IPython.display import Image | ||
|
||
class SmartsVisualizer(object): | ||
|
||
__version__ = '0.0.1' | ||
|
||
|
||
def __init__(self, | ||
smarts_pattern | ||
): | ||
|
||
self.smarts_pattern = smarts_pattern | ||
|
||
self.base_url = "https://smarts.plus/smartsview/download_rest?" | ||
self.url = self.base_url + f"smarts={self.smarts_pattern}" | ||
|
||
def get_image(self): | ||
|
||
res = requests.get(self.url) | ||
return Image(res.content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters