3 __doc__ =
"Generate indexes of fitting solutions."
6 from optparse
import OptionParser
9 usage =
"""%prog [options] <assembly name> <assembly input> <number of fits> <indexes filename>
11 Generate indexes of fitting solutions.
14 options, args = parser.parse_args()
16 parser.error(
"incorrect number of arguments")
19 def run(assembly_name,asmb_fn,num_fits,mapping_fn=""):
22 asmb_input.set_was_used(
True)
23 ap_em_fn=asmb_input.get_assembly_header().get_coarse_over_sampled_ap_fn()
25 mapping_fn=assembly_name+
".indexes.mapping.input"
26 mapping_data=open(mapping_fn,
"w")
27 mapping_data.write(
"|anchors|"+ap_em_fn+
"|\n")
28 for i
in range(asmb_input.get_number_of_component_headers()):
29 name=asmb_input.get_component_header(i).get_name()
30 trans_fn = asmb_input.get_component_header(i).get_transformations_fn()
32 print "number of fits for component",i,
"is",len(fits),trans_fn
33 index_fn=assembly_name+
"."+name+
".fit.indexes.txt"
35 for i
in range(min(num_fits,len(fits))):
38 mapping_data.write(
"|protein|"+name+
43 options,args = parse_args()
46 max_fits = int(args[2])
48 run(asmb_name,asmb_input,max_fits,mapping_fn)
50 if __name__==
"__main__":