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
from collections import defaultdict | |
from itertools import chain | |
from banyan import SortedDict, OverlappingIntervalsUpdator | |
class Rectangle(object): | |
def __init__(self, left, top, right, bottom): | |
self.left = left | |
self.bottom = bottom | |
self.right = right |
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
# necessary imports first: | |
from chembl_webresource_client import * | |
# create resource object: | |
compounds = CompoundResource() | |
# before you do anythong else, please check webservices status: | |
print compounds.status() | |
True |
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
# our standard invocation: | |
from chembl_webresource_client import * | |
targets = TargetResource() | |
print targets.status() | |
True | |
# status returns True so we can proceed: | |
#first let's get a single target: | |
t = targets.get('CHEMBL2477') |
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
# first things first: | |
from chembl_webresource_client import * | |
assays = AssayResource() | |
print assays.status() | |
True | |
# assays are simple, we can get them by chembl ID: | |
a = assays.get('CHEMBL1217643') | |
print a | |
{u'assayType': u'B', u'chemblId': u'CHEMBL1217643', u'journal': u'Bioorg. Med. Chem. Lett.', |
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
from chembl_webresource_client import * | |
compounds = CompoundResource() | |
cs = compounds.get(['CHEMBL%s' % x for x in range(1,1001)]) |
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
from bioservices import * | |
s = ChEMBLdb(verbose=False) | |
res = [] | |
for i in range(1,1001): | |
try: | |
res.append(s.get_compounds_by_chemblId('CHEMBL%s' % i)) | |
except: | |
res.append(404) |
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
# let's import settings class first: | |
from chembl_webresource_client.settings import Settings | |
# we can now decide which protocol to use: | |
Settings.Instance().WEBSERVICE_PROTOCOL = 'http' | |
# point our client to our local webservices instance | |
Settings.Instance().WEBSERVICE_DOMAIN = 'localhost' | |
# and change their prefix: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:f784ff75e0dec53c6fef16fc487214e1f81833324cfa31e787b2ed105592c612" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
import requests | |
from chembl_webresource_client import * | |
# For some special SMILES, using GET method against webservices will end up with failure: | |
res = requests.get('https://www.ebi.ac.uk/chemblws/compounds/smiles/CN1C\C(=C/c2ccc(C)cc2)\C3=C(C1)C(C(=C(N)O3)C#N)c4ccc(C)cc4') | |
print res.ok | |
False | |
print res.status_code |
OlderNewer