3 from __future__
import print_function
6 from IMP
import OptionParser
8 __doc__ =
"Generate anchors for a density map."
11 usage =
"""%prog [options] <assembly input> <output anchors prefix>
13 Generate anchors for a density map."""
14 parser = OptionParser(usage)
15 parser.add_option(
"-s",
"--size", type=
"int", dest=
"size", default=-1,
16 help=
"number of residues per bead")
17 options, args = parser.parse_args()
20 parser.error(
"incorrect number of arguments")
25 options, args = parse_args()
29 asmb.set_was_used(
True)
32 if options.size == -1:
33 number_of_means = asmb.get_number_of_component_headers()
35 total_num_residues = 0
37 for i
in range(asmb.get_number_of_component_headers()):
38 total_num_residues += len(
41 asmb.get_component_header(
45 IMP.atom.RESIDUE_TYPE))
46 number_of_means = total_num_residues / options.size
47 print(
"Calculating a segmentation into", number_of_means,
"regions")
48 density_threshold = asmb.get_assembly_header().get_threshold()
52 output +
".pdb", output +
".cmm",
55 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.
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
Gather all the molecular particles of a certain level in the hierarchy.
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.
DensityMap * read_map(std::string filename)
Read a density map from a file and return it.