-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7c82262
commit 6d895f8
Showing
9 changed files
with
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/env python | ||
|
||
# usage: simi.py (similar|exact) inputfile | ||
# input file format: | ||
# smiles identifier | ||
# | ||
# Contributing authors: | ||
# Teague Sterling, Pascal Wassam, Gurgen Turmanian and John Irwin, 2010-2013 | ||
# | ||
|
||
import xmlrpclib, sys, pprint | ||
|
||
|
||
def checkAggregators(smi): | ||
result = server.similarity.getSimilars(smi) | ||
try: | ||
similarCount = len(result['aggregators']) | ||
|
||
for r in result['aggregators']: | ||
if r['similarity'] == 1.0: | ||
exactMatch = True | ||
exactmatchref = r['reference'] | ||
return (similarCount, exactMatch, exactmatchref) | ||
|
||
except: | ||
pass | ||
|
||
|
||
lines = file(sys.argv[1]).readlines() | ||
lookups = {} | ||
myfile = sys.argv[2] | ||
for l in lines: | ||
t = l.split(',') | ||
smi = t[1] | ||
id = t[0] | ||
activity = t[2] | ||
if len(id) == 0: id = None | ||
lookups[id] = smi | ||
|
||
|
||
server_url = "http://advisor.bkslab.org:8080/aggregate_lookup/xml-rpc/" | ||
server = xmlrpclib.ServerProxy(server_url); | ||
similarCount = 0 | ||
exactMatch = False | ||
outfile = open(myfile, 'w') | ||
outfile.write('ID, Activity, No. of matches,Exact match, Ref for exact match') | ||
for (id, smi) in lookups.iteritems(): | ||
try: | ||
checkResult = checkAggregators(smi) | ||
try: | ||
outfile.write(id+","+activity+","+",".join(str(x) for x in checkResult)+"\n") | ||
print id, checkResult | ||
except: | ||
outfile.write(id+ ","+ activity +","+ "None"+"\n") | ||
print id, checkResult | ||
except: | ||
pass | ||
outfile.close() |
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,27 @@ | ||
from dipan_utilities import utilities | ||
import getUnique as gt | ||
import exportOverlaps as ex | ||
|
||
overlaps13 = ex.exportOverlaps(0, 2) | ||
overlaps23 = ex.exportOverlaps(1, 2) | ||
overlaps12 = ex.exportOverlaps(0, 1) | ||
desktopDir = '/Users/dghosh/Desktop/' | ||
|
||
#Accounting for all the molecules showing class changing | ||
switchersForset1 = utilities.extractList(overlaps13[0], gt.set3dict) | ||
switchersForset2 = utilities.extractList(overlaps23[0], gt.set3dict) | ||
switchersForset2and1 = utilities.extractList(overlaps12[0], gt.set2dict) | ||
switchersForset2and1From1 = utilities.extractList(overlaps12[0], gt.set1dict) | ||
|
||
print len(switchersForset2and1From1) | ||
|
||
set3list = utilities.extractList(gt.set3idSet, gt.set3dict) | ||
uniqFromSet1 = utilities.extractList(gt.uniq1to3, gt.set1dict) | ||
uniqFromSet2 = utilities.extractList(gt.uniq2to3, gt.set2dict) | ||
|
||
combined = set.union(set(set3list), set(uniqFromSet1), set(uniqFromSet2)) | ||
|
||
|
||
combinedExcludeSwitching =(set(switchersForset1)|set(switchersForset2)|set(switchersForset2and1)|set(switchersForset2and1From1)) | ||
print len(combinedExcludeSwitching) | ||
utilities.listToFile(desktopDir+'toExclude.txt', combinedExcludeSwitching) |
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
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
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,13 @@ | ||
import loadfiles as ld | ||
from dipan_utilities import utilities | ||
|
||
with open('/Users/dghosh/Desktop/set3_aggregators') as f: | ||
set3Aggre = f.read().splitlines() | ||
with open('/Users/dghosh/Desktop/set3-nonAggregators') as f: | ||
set3NonAggre = f.read().splitlines() | ||
|
||
switchFile = open(ld.desktopDir + 'set3AggreRID.csv', 'w') | ||
notSwitchFile = open(ld.desktopDir + 'set3nonAggreRID.csv', 'w') | ||
|
||
utilities.pullFromDictAndWriteToFIle(ld.set3dict, set3Aggre, switchFile) | ||
utilities.pullFromDictAndWriteToFIle(ld.set3dict, set3NonAggre, notSwitchFile) |
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
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
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,10 @@ | ||
for i in range(100): | ||
if i%3 == 0: | ||
if i%5==0: | ||
print 'fizzbuzz' | ||
else: | ||
print 'fizz' | ||
elif i%5 == 0: | ||
print 'buzz' | ||
else: | ||
print i |
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,11 @@ | ||
''' | ||
Created on 13 Mar 2017 | ||
@author: dghosh | ||
''' | ||
import os | ||
dirName = "/Users/dghosh/Creative Cloud Files/portfolio_site/rome/Rome-web/day1" | ||
os.chdir(dirName) | ||
for filename in os.listdir("."): | ||
basename = filename[:-8] | ||
print '<a href="./'+dirName.split("/")[-1]+'/'+basename+'-web.jpg" data-toggle="lightbox" data-gallery="christmasmarket"><figure class="photothumbnail"><img src="./'+dirName.split("/")[-1]+'/thumb/'+basename+'-web-thumb.jpg" alt="'+filename+'" class="center-block"></figure></a>' |