Skip to content
Permalink
5ab4ed8e4a
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
44 lines (33 sloc) 1.12 KB
# to_iupac.py
from util import *
import sys
from paths import *
if len(sys.argv) < 2:
print("python3 to_iupac.py <pdb_id>")
raise
pdb_id = sys.argv[1].lower()
es_dir1 = PDB_FILES + pdb_id.upper()
es_dir2 = PDB_FILES + pdb_id.upper() + '_alt'
# get files
files = []
if isdir(es_dir1):
for f in listdir(es_dir1):
files.append(es_dir1 + '/' + f )
if isdir(es_dir2):
for f in listdir(es_dir2):
files.append(es_dir2 + '/' + f)
if exists(f'{experimental_structures}exp_'+pdb_id+'.pdb'):
files.append(f'{experimental_structures}exp_'+pdb_id+'.pdb')
if isdir(f'{experimental_structures}'+pdb_id):
for f in listdir(f'{experimental_structures}'+pdb_id):
files.append(f'{experimental_structures}'+pdb_id + '/' + f)
if exists(f'{computational_structures}comp_'+pdb_id+'.pdb'):
files.append(f'{computational_structures}comp_'+pdb_id+'.pdb')
for inf in tqdm(files):
string = ""
string += 'load coo pdb ' + inf + '\n'
string += 'to iupac\n'
string += 'write coo pdb ' + inf +"\n"
with open('cmd.txt', 'w') as outf:
outf.write(string)
os.system('pdbstat -s < cmd.txt')