Hi,
I am trying to automate running Dimplot on a list of 500 PDB ids, any suggestions? I am trying to do this using Python.
This is the code I tried 2 run..... I am using dimplot for dimer interfacing. I am using a list of pdbs and chains.....(as a dictionary)
!/usr/bin/python
read the list of PDB chains and run dimplot
Before runing dimplot an output directory for each PDB file is created
After running dimplot the output files not reqiried are removed
import re import math import os
filename1 = "/usr/local/share/ligplot/dimplot.scr /data/bio/db/pdb/pdb" pdblist = "/XXXXX/new_pdb1.txt" diroutput = "/XXXXXXXX/dimout/"; filenames = "/Desktop/fll" # list of output files 2 be deleted pdbs = {}
def read_pdb_list(pdblist, pdbs):
#read the list of PDBs and input PDB_ID and chains into dictionary
fh = open(pdblist, 'r')
all_line=fh.read() fh.close()
lines=all_line.split("\n")
for line in lines:
if 'ent' in line:
columns =line.split()
chains= columns[1:3]
# print chains
chains.sort()
pdbs.setdefault(columns[0],{})
pdbs[columns[0]].setdefault(chains[0],{})
pdbs[columns[0]][chains[0]].setdefault(chains[1],line)
read_pdb_list(pdblist,pdbs)
for p in pdbs.keys(): print p
a = os.getcwd()
if p[0:5] in a:
print a
work_dir= a
os.chdir(work_dir)
for c1 in pdbs[p].keys():
for c2 in pdbs[p][c1].keys():
print p,c1,c2
run = filename1 + pdbs[p][c1][c2]
print run
os.system(run)
os.rename("dimplot.hhb", pdbs[p][c1][c2]+".hhb")
os.rename("dimplot.nnb", pdbs[p][c1][c2] +".nnb")
os.rename("ligplot.sum" , pdbs[p][c1][c2]+".sum")
os.remove("dimplot.pdb")
fh = open(filenames, 'r')
all_line=fh.read()
fh.close()
lines=all_line.split("\n")
for line in lines:
line = line.rstrip('\r\n')
#print line
os.chdir(work_dir)
try:
os.remove(line)
except OSError, detail:
print "%s %s" % (detail[1],line)
python
There's not enough information here for anyone to help you. Are you using dimplot for dimer interfacing or domain/domain interfacing? It's important as the dimer interfacing would only require you to extract the chain information from the PDB files to run. The domain/domain interfacing requires you to build domain definitions in a .dom file. This would appear to add a little more complexity to the task. How far have you got with this? Do you have any sample code or pseudocode in mind?
Hi samihk. Your question would be much easier to read if it were formated properly. It is crucial that you edit your questions properly if you want people to spend time trying to give you a useful answer. Cheers
Hello Samihk!
We believe that this post does not fit the main topic of this site.
Inactive for >2 years
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!