-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython3.py
More file actions
43 lines (30 loc) · 1.11 KB
/
Python3.py
File metadata and controls
43 lines (30 loc) · 1.11 KB
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
import os
count = 0
def checkfile(file, name):
subfiles = os.listdir(file)
if name in subfiles:
if "files.rcsb.org" not in subfiles:
os.chdir(file)
print(os.getcwd())
f = open(file+"/"+name, 'r')
line = f.readline()
PDBS = line.strip().split(",")
global count
count+=1
print("Number of new pdb's created: ",count)
for PDB in PDBS:
os.system("wget -r https://files.rcsb.org/download/"+PDB+
".pdb")
print(PDB)
f.close()
print("\n Count : ",count)
for s in subfiles:
if os.path.isdir(file+'/'+s):
checkfile(file+'/'+s, name)
path = input("Enter the path which contains Output_prosite_pattern")+"/Output_prosite_pattern"
name = "3D_structure.txt"
files = os.listdir(path)
for file in files:
file = path+"/"+file
if os.path.isdir(file):
checkfile(file, name)