3 __doc__ =
"Anchor graph segmentation of a density map."
7 from IMP
import ArgumentParser
12 Segments all voxels in the given density map, above the given threshold,
13 into the given number of clusters, and links between neighboring ones.
15 The cluster centers are written out into a single output PDB file, each
18 p = ArgumentParser(description=desc)
19 p.add_argument(
"--apix", type=float, default=
None,
20 help=
"map spacing, in angstroms/pix (default: read "
22 p.add_argument(
"-x",
"--x", type=float, default=
None,
23 help=
"X origin of the density map")
24 p.add_argument(
"-y",
"--y", type=float, default=
None,
25 help=
"Y origin of the density map")
26 p.add_argument(
"-z",
"--z", type=float, default=
None,
27 help=
"Z origin of the density map")
28 p.add_argument(
"--cmm", default=
"",
29 help=
"write results in CMM format")
30 p.add_argument(
"--seg", default=
"",
31 help=
"write out each cluster as an MRC file called "
32 "<seg>_.mrc, and write load_segmentation.cmd file "
33 "to easily load all segments into Chimera")
34 p.add_argument(
"--txt", default=
"",
35 help=
"write anchor points file in text format")
36 p.add_argument(
"density", help=
"density map filename (in MRC format)")
37 p.add_argument(
"num_cluster", type=int,
38 help=
"number of clusters")
39 p.add_argument(
"threshold", type=float,
40 help=
"density threshold")
41 p.add_argument(
"output", help=
"output PDB file name")
49 args.apix = dmap.get_spacing()
51 dmap.update_voxel_size(args.apix)
59 dmap.set_origin(args.x, args.y, args.z)
60 dmap.set_was_used(
True)
62 args.num_cluster, args.output, args.cmm,
66 if __name__ ==
"__main__":
Fitting atomic structures into a cryo-electron microscopy density map.
Basic utilities for handling cryo-electron microscopy 3D density maps.
void get_segmentation(em::DensityMap *dmap, double apix, double density_threshold, int num_means, const std::string pdb_filename, const std::string cmm_filename, const std::string seg_filename, const std::string txt_filename)
Segment a density map using the anchor graph.