3 __doc__ =
"Generate proteomics info from anchor graph and fits."
10 from optparse
import OptionParser
13 usage =
"""%prog [options] <asmb.input> <anchors.txt>
16 Generate a proteomics file automatically from the anchor graph and fitting
17 results. No interaction data is entered here, but the file can be modified
18 manually afterwards to add additional proteomics information.
21 options, args = parser.parse_args()
23 parser.error(
"incorrect number of arguments")
26 def run(asmb_fn,anchors_fn,proteomics_fn):
28 asmb.set_was_used(
True)
35 for i
in range(asmb.get_number_of_component_headers()):
36 fn = asmb.get_component_header(i).get_filename()
44 for j
in range(len(mhs)):
45 dist = IMP.algebra.get_squared_distance(pt,centroids[j])
52 for ind1,ind2
in ad.edges_:
53 ev_pairs.append([match[ind1],match[ind2]])
54 outf=open(proteomics_fn,
"w")
55 outf.write(
"|proteins|\n")
56 for i,mh
in enumerate(mhs):
58 outf.write(
"|%s|1|%d|nn|nn|\n" \
59 % (asmb.get_component_header(i).get_name(), numres))
60 outf.write(
"|interactions|\n")
61 outf.write(
"|residue-xlink|\n")
62 outf.write(
"|ev-pairs|\n")
66 sortpair = (min(*evp), max(*evp))
67 if sortpair
not in pairs_map:
68 name0 = asmb.get_component_header(evp[0]).get_name()
69 name1 = asmb.get_component_header(evp[1]).get_name()
70 outf.write(
"|%s|%s|\n" % (name0, name1))
75 asmb_fn, anchors_fn, proteomics_fn = parse_args()
76 run(asmb_fn, anchors_fn, proteomics_fn)
78 if __name__==
"__main__":