IMP logo
IMP Reference Guide  develop.b3a5ae88fa,2024/05/06
The Integrative Modeling Platform
lib/IMP/multifit/merge_tree.py
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 import IMP.multifit
5 from IMP import ArgumentParser
6 
7 __doc__ = "Show the DOMINO merge tree to be used in alignment."
8 
9 
10 def parse_args():
11  desc = """
12 Show the DOMINO merge tree to be used in the alignment procedure
13 """
14  p = ArgumentParser(description=desc)
15  p.add_argument("assembly_file", help="assembly file name")
16  p.add_argument("proteomics_file", help="proteomics file name")
17  p.add_argument("mapping_file", help="mapping file name")
18  p.add_argument("param_file", help="parameter file name")
19  return p.parse_args()
20 
21 
22 def run(asmb_fn, proteomics_fn, mapping_fn, params_fn):
23  asmb = IMP.multifit.read_settings(asmb_fn)
24  asmb.set_was_used(True)
25  dmap = IMP.em.read_map(asmb.get_assembly_header().get_dens_fn())
26  dmap.get_header().set_resolution(
27  asmb.get_assembly_header().get_resolution())
28  threshold = asmb.get_assembly_header().get_threshold()
29  dmap.update_voxel_size(asmb.get_assembly_header().get_spacing())
30  dmap.set_origin(asmb.get_assembly_header().get_origin())
31 
32  alignment_params = IMP.multifit.AlignmentParams(params_fn)
33  alignment_params.show()
34  IMP.set_log_level(IMP.WARNING)
35  prot_data = IMP.multifit.read_proteomics_data(proteomics_fn)
36 
37  mapping_data = IMP.multifit.read_protein_anchors_mapping(prot_data,
38  mapping_fn)
39 
40  _ = mapping_data.get_anchors()
41 
42  # load all proteomics restraints
43  align = IMP.multifit.ProteomicsEMAlignmentAtomic(mapping_data, asmb,
44  alignment_params)
45 
46  align.set_fast_scoring(False)
47  align.set_density_map(dmap, threshold)
48  align.add_states_and_filters()
49  align.add_all_restraints()
50  print("\n\n\nDOMINO MERGE TREE\n\n")
51  align.show_domino_merge_tree()
52 
53 
54 def main():
55  args = parse_args()
56  run(args.assembly_file, args.proteomics_file, args.mapping_file,
57  args.param_file)
58 
59 
60 if __name__ == "__main__":
61  main()
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.
Fitting atomic structures into a cryo-electron microscopy density map.
ProteomicsData * read_proteomics_data(const char *proteomics_fn)
Proteomics reader.
void set_log_level(LogLevel l)
Set the current global log level.
double get_resolution(Model *m, ParticleIndex pi)
Estimate the resolution of the hierarchy as used by Representation.