-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDB_process.py
54 lines (45 loc) · 871 Bytes
/
PDB_process.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
#!/usr/bin/python
import os
import csv
import sys
import copy
from itertools import *
import itertools
import math
import string
import random
import shutil
import getopt
import shlex
import subprocess
from subprocess import call
from subprocess import Popen
import os.path
import glob
import types
import shutil
import re
from time import sleep
import unittest
import time
if len(sys.argv) == 2:
prot_name = sys.argv[1]
def a():
a = []
b = []
aline = open(prot_name, 'r').readlines()
for line in aline:
if line[:4] == "ATOM":
#print line
if line[13:16]+" "+line[17:26] not in a:
b.append(line[:16]+" "+line[17:])
a.append(line[13:16]+" "+line[17:26])
return b
b = a()
out = open(prot_name[:-4]+"a.pdb", 'w')
for line in b:
out.write(line)
out.close()
else:
print("Usage python dock.py <prot_name>")
sys.exit()