IMP  2.2.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 IMP import OptionParser
7 
8 
9 def parse_args():
10  usage = """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
11  <alignment.params>
12 
13 Show the DOMINO merge tree to be used in the alignment procedure
14 """
15  parser = OptionParser(usage)
16 
17  options, args = parser.parse_args()
18  if len(args) != 4:
19  parser.error("incorrect number of arguments")
20  return options, args
21 
22 
23 def run(asmb_fn, proteomics_fn, mapping_fn, params_fn):
24  asmb = IMP.multifit.read_settings(asmb_fn)
25  asmb.set_was_used(True)
26  dmap = IMP.em.read_map(asmb.get_assembly_header().get_dens_fn())
27  dmap.get_header().set_resolution(
28  asmb.get_assembly_header().get_resolution())
29  threshold = asmb.get_assembly_header().get_threshold()
30  dmap.update_voxel_size(asmb.get_assembly_header().get_spacing())
31  dmap.set_origin(asmb.get_assembly_header().get_origin())
32 
33  alignment_params = IMP.multifit.AlignmentParams(params_fn)
34  alignment_params.show()
35  IMP.base.set_log_level(IMP.WARNING)
36  prot_data = IMP.multifit.read_proteomics_data(proteomics_fn)
37 
38  mapping_data = IMP.multifit.read_protein_anchors_mapping(prot_data,
39  mapping_fn)
40 
41  em_anchors = mapping_data.get_anchors()
42 
43  # load all proteomics restraints
44  align = IMP.multifit.ProteomicsEMAlignmentAtomic(mapping_data, asmb,
45  alignment_params)
46 
47  align.set_fast_scoring(False)
48  align.set_density_map(dmap, threshold)
49  align.add_states_and_filters()
50  align.add_all_restraints()
51  print "\n\n\nDOMINO MERGE TREE\n\n"
52  align.show_domino_merge_tree()
53 
54 
55 def main():
56  options, args = parse_args()
57  run(args[0], args[1], args[2], args[3])
58 
59 if __name__ == "__main__":
60  main()
void set_log_level(LogLevel l)
Set the current global log level.
double get_resolution(kernel::Model *m, kernel::ParticleIndex pi)
SettingsData * read_settings(const char *filename)
ProteinsAnchorsSamplingSpace read_protein_anchors_mapping(multifit::ProteomicsData *prots, const std::string &anchors_prot_map_fn, int max_paths=INT_MAX)
Align proteomics graph to EM density map.
See IMP.multifit for more information.
DensityMap * read_map(std::string filename)
ProteomicsData * read_proteomics_data(const char *proteomics_fn)
Proteomics reader.
IMP::kernel::OptionParser OptionParser