-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
81 lines (63 loc) · 2.57 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import kdtree4atoms as kdt
import numpy as np
import ParserOnlyAtoms as poa
import os
#***# Already made
# motifData = {}
# for line in open("C:/Users/Brianna/PyCharmProjects/optimizer/Data/motifNames.txt"):
# name = line.strip("\n")
# motifData[name] += 'Motif : ' + name + "\n"
# Extra :
# motifData[name] = '"""\n'
# motifData[name] += "Data File Containing Results from Search Algorithm for Serine Protease for:"
# motifData[name] += "Author: Bri Miskovitz"
# motifData[name] += '"""'
old = '/home/michael/Documents/Git/bris_research/research/matching-functions-master/immediateFamily.txt'
# Very Small family
TREEs = {}
for pdb in open('C:/Users/Brianna/PycharmProjects/research/matching-functions/immediateFamily.txt'):
pdb = pdb.strip("\n")
print pdb
# Retrieve files
path = 'C:/Users/Brianna/PycharmProjects/research/matching-functions//pdbFiles'
if not os.path.exists(path):
os.makedirs(path)
PATH = poa.urllib.urlretrieve('http://files.rcsb.org/download/%s.pdb' % pdb,
'%s/%s.pdb' % (path, pdb))
# print "Path:", PATH
try:
file = 'C:\\Users\\Brianna\\PycharmProjects\\research\\matching-functions\\pdbFiles\\%s\\%s.pdb' % (path, pdb)
pdbData = poa.readFile(file)
except IOError:
pth = 'C:\\Users\\Brianna\\PycharmProjects\\research\\matching-functions\\pdbFiles'
file = '%s\\%s.pdb' % (pth, pdb)
pdbData = poa.readFile(file)
Atoms = pdbData["Atom"]
TREEs[pdb] = kdt.KDTree4Atoms(np.asarray(Atoms))
# pdb = '1a0j'
# file = '/home/michael/Documents/Git/bris_research/research/matching-functions/pdbFiles/1a0j.pdb'
# pdbData = poa.readFile(file)
Atoms = pdbData["Atom"]
TREEs[pdb] = kdt.KDTree4Atoms(np.asarray(Atoms))
# Big family
# TREEs = {}
# familyData = {}
# for pdb in open('serineProtease.txt'):
# pdb = pdb.strip("\n")
# # Retrieve files
# path = 'pdbFiles'
# if not os.path.exists(path):
# os.makedirs(path)
#
# PATH = poa.urllib.urlretrieve('http://files.rcsb.org/download/%s.pdb' % pdb,
# 'C:/Users/Brianna/PycharmProjects/optimizer/%s/%s.pdb' % (path, pdb))
# try:
# file = 'C:/Users/blm7643/Downloads/optimizer/%s/%s.pdb' % (path, pdb)
# pdbData = poa.readFile(file)
# except IOError:
# file = '%s/%s.pdb' % (path, pdb)
# pdbData = poa.readFile(file)
#
# Atoms = pdbData["Atom"]
# TREEs[pdb] = kdt.KDTree4Atoms(np.asarray(Atoms))
# familyData[pdb] = ""