Skip to content

Instantly share code, notes, and snippets.

View mnowotka's full-sized avatar

Michał Nowotka mnowotka

  • Bolt
  • Warsaw, PL
View GitHub Profile
from chembl_webresource_client.new_client import new_client
# Get Molecules with ATC 'A10' classification
molecules = new_client.molecule.filter(atc_classifications__level5__startswith='A10')
molecule_ids = list(set(map(lambda d: d['molecule_chembl_id'], molecules)))
print molecule_ids
# Get Targets for Molecules
activities = new_client.activity.filter(molecule_chembl_id__in=molecule_ids).filter(pchembl_value__gte=6)
from chembl_webresource_client.new_client import new_client
# Get Molecules with ATC 'A10' classification
molecules = new_client.molecule.filter(atc_classifications__level5__startswith='A10')
molecule_ids = [mol['molecule_chembl_id'] for mol in molecules]
# Get Targets for Molecules
activities = new_client.activity.filter(molecule_chembl_id__in=molecule_ids).filter(pchembl_value__gte=6)
target_ids = set([act['target_chembl_id'] for act in activities])
from chembl_webresource_client.new_client import new_client
molecules = new_client.molecule
clean_mols = molecules.filter(molecule_properties__full_mwt__isnull=False)
len(clean_mols)
weights = [x['molecule_properties']['full_mwt'] for x in clean_mols[0:1000]]
@mnowotka
mnowotka / postgresql.conf
Last active April 21, 2016 09:33 — forked from anonymous/postgresql.conf
current Ubuntu 9.4 postgres conf (non-default settings only)
data_directory = '/var/lib/postgresql/9.4/main' # use data in another directory
hba_file = '/etc/postgresql/9.4/main/pg_hba.conf' # host-based authentication file
ident_file = '/etc/postgresql/9.4/main/pg_ident.conf' # ident configuration file
external_pid_file = '/var/run/postgresql/9.4-main.pid' # write an extra PID file
listen_addresses = '*' # what IP address(es) to listen on;
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
ssl = true # (change requires restart)
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart)
#!/bin/sh
wmctrl -o 0,0
setsid gnome-terminal -t "PIPELINE" -e "ssh pipeline -t \"htop\"" --geometry=71x15+0+0 &
setsid gnome-terminal -t "API1" -e "ssh api1 -t \"htop\"" --geometry=71x15+640+0 &
setsid gnome-terminal -t "API2" -e "ssh api2 -t \"htop\"" --geometry=71x15+1280+0 &
setsid gnome-terminal -t "UI" -e "ssh ui -t \"htop\"" --geometry=71x15+0+325 &
setsid gnome-terminal -t "UI3" -e "ssh ui3 -t \"htop\"" --geometry=71x15+640+325 &
setsid gnome-terminal -t "MYSQL" -e "ssh mysql -t \"htop\"" --geometry=71x15+1280+325 &
#!/bin/sh
wmctrl -o 0,0
setsid firefox -new-window -url "http://sark.ebi.ac.uk:9000/chembl/chembl_new_webservices/" &
sleep 5
wmctrl -o 1920,0
setsid firefox -new-window -url "http://ves-ebi-56.ebi.ac.uk/surechemblmonitor/#/dashboard/db/overview" &
sleep 5
wmctrl -o 0,1200
setsid firefox -new-window -url "https://uptimerobot.com/dashboard#tvMode" &
#!/bin/sh
wmctrl -o 0,0
setsid gnome-terminal -t "PIPELINE SHANDLERS.LOG" -e "ssh pipeline -t \"tail -f /srv/pipelinelogs/shandlers-1.log | ccze\"" --geometry=215x15+640+0 &
setsid gnome-terminal -t "PIPELINE ATT-REAPER.LOG" -e "ssh pipeline -t \"tail -f /srv/surechem-pipeline/shared/log/att-reaper.log | ccze\"" --geometry=215x15+640+325 &
setsid gnome-terminal -t "PIPELINE BATCH_MAPPER.LOG" -e "ssh pipeline -t \"tail -f /srv/surechem-pipeline/shared/log/batch-mapper.log | ccze\"" --geometry=215x15+640+625 &
setsid gnome-terminal -t "PIPELINE PIPELINE-REAPER-RESTART.LOG" -e "ssh pipeline -t \"tail -f /srv/surechem-pipeline/shared/log/pipeline-reaper-restart.log | ccze\"" --geometry=215x15+640+960 &
sleep 5
@mnowotka
mnowotka / LICENSE
Last active August 3, 2016 10:09 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
# This scripts reads a list of compounds, identified by their chembl ids from a CSV file
# given as an input. For each compound it find related targets, optionally filtered by
# organism. It saves a mepping between the compound and targets in the output CSV file.
# import libraries for reading csv files, parsing command line arguments
# and the python client library
import csv
import argparse
from chembl_webresource_client.new_client import new_client
#!/bin/bash
# This script will get a list of targets related to a compound.
# Each compound, identified by its chembl id will be read from
# the CSV file specified as the first argument.
# This script assumes that you have a 'jq' command line tool installed.
# Installation instructions can be found here:
# https://stedolan.github.io/jq/download/