IMP  2.0.0
The Integrative Modeling Platform
lib/IMP/multifit/merge_tree.py
1 #!/usr/bin/env python
2 
3 __doc__ = "Show the DOMINO merge tree to be used in alignment."
4 
5 import IMP.multifit
6 from optparse import OptionParser
7 
8 def parse_args():
9  usage = """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
10  <alignment.params>
11 
12 Show the DOMINO merge tree to be used in the alignment procedure
13 """
14  parser = OptionParser(usage)
15 
16  options, args = parser.parse_args()
17  if len(args) !=4:
18  parser.error("incorrect number of arguments")
19  return options,args
20 
21 def run(asmb_fn, proteomics_fn, mapping_fn, params_fn):
22  asmb=IMP.multifit.read_settings(asmb_fn)
23  asmb.set_was_used(True)
24  dmap=IMP.em.read_map(asmb.get_assembly_header().get_dens_fn())
25  dmap.get_header().set_resolution(
26  asmb.get_assembly_header().get_resolution())
27  threshold=asmb.get_assembly_header().get_threshold()
28  dmap.update_voxel_size(asmb.get_assembly_header().get_spacing())
29  dmap.set_origin(asmb.get_assembly_header().get_origin())
30 
31  alignment_params = IMP.multifit.AlignmentParams(params_fn)
32  alignment_params.show()
33  IMP.base.set_log_level(IMP.WARNING)
34  prot_data=IMP.multifit.read_proteomics_data(proteomics_fn)
35 
36  mapping_data=IMP.multifit.read_protein_anchors_mapping(prot_data,
37  mapping_fn)
38 
39  em_anchors = mapping_data.get_anchors()
40 
41  #load all proteomics restraints
42  align=IMP.multifit.ProteomicsEMAlignmentAtomic(mapping_data,asmb,
43  alignment_params)
44 
45  align.set_fast_scoring(False)
46  align.set_density_map(dmap,threshold)
47  align.add_states_and_filters()
48  align.add_all_restraints()
49  print "\n\n\nDOMINO MERGE TREE\n\n"
50  align.show_domino_merge_tree()
51 
52 def main():
53  options,args = parse_args()
54  run(args[0], args[1], args[2], args[3])
55 
56 if __name__ == "__main__":
57  main()