3 from __future__
import print_function
6 from IMP
import ArgumentParser
8 __doc__ =
"Generate anchors for a density map."
11 desc =
"""Generate anchors for a density map."""
12 p = ArgumentParser(description=desc)
13 p.add_argument(
"-s",
"--size", type=int, dest=
"size", default=-1,
14 help=
"number of residues per bead")
15 p.add_argument(
"assembly_file", help=
"assembly file name")
16 p.add_argument(
"anchor_prefix", help=
"prefix for output anchors file names")
23 output = args.anchor_prefix
25 asmb.set_was_used(
True)
26 dmap = IMP.em.read_map(asmb.get_assembly_header().get_dens_fn(),
29 number_of_means = asmb.get_number_of_component_headers()
31 total_num_residues = 0
33 for i
in range(asmb.get_number_of_component_headers()):
34 total_num_residues += len(
37 asmb.get_component_header(
41 IMP.atom.RESIDUE_TYPE))
42 number_of_means = total_num_residues / args.size
43 print(
"Calculating a segmentation into", number_of_means,
"regions")
44 density_threshold = asmb.get_assembly_header().get_threshold()
48 output +
".pdb", output +
".cmm",
51 if __name__ ==
"__main__":
SettingsData * read_settings(const char *filename)
void read_pdb(TextInput input, int model, Hierarchy h)
Class for storing model, its restraints, constraints, and particles.
void get_anchors_for_density(em::DensityMap *dmap, int number_of_means, float density_threshold, std::string pdb_filename, std::string cmm_filename, std::string seg_filename, std::string txt_filename)
Generate anchors in several formats for a given density map.
Fitting atomic structures into a cryo-electron microscopy density map.
Basic utilities for handling cryo-electron microscopy 3D density maps.