3 from optparse
import OptionParser
8 usage =
"usage: %prog [options] <complex.pdb> <output: anchor_graph.cmm>\n Description: The script gets as input a PDB file of a complex and calculates an anchor graph,\n such that nodes corresponds to the centroids of its chains and \n edges are between chains that are close in space."
10 (options, args) = parser.parse_args()
12 parser.error(
"incorrect number of arguments")
26 IMP.atom.setup_as_rigid_body(chain)
31 for id1,chain1
in enumerate(chains):
32 for id2,chain2
in enumerate(chains[id1+1:]):
34 if rdps.evaluate((chain1.get_particle(), chain2),
None)<0.5:
35 links.append([id1,id1+id2+1])
37 output=open(cmm_fn,
"w")
38 output.write(
'<marker_set name="centers_cryst">\n')
39 for id,c
in enumerate(centers):
40 output.write(
'<marker id="'+str(id)+
'" x="'+str(c[0])+
'" y="'+str(c[1])+
'" z="'+str(c[2])+
'" radius= "3.0" r= "0.9" g= "0.05" b= "0.18" />')
42 output.write(
'<link id1="'+str(id1)+
'" id2="'+str(id2)+
'" radius="1."/>\n')
43 output.write(
'</marker_set>\n')
45 if __name__ ==
"__main__":