3 __doc__ =
"Anchor graph segmentation of a density map."
7 from IMP
import OptionParser
10 usage =
"""%prog [options] <density.mrc> <number of clusters>
11 <density threshold> <output.pdb>
13 Segments all voxels in the given density map, above the given threshold,
14 into the given number of clusters, and links between neighboring ones.
16 The cluster centers are written out into a single output PDB file, each
20 parser.add_option(
"--apix", type=
"float", default=
None,
21 help=
"map spacing, in angstroms/pix (default: read "
23 parser.add_option(
"-x",
"--x", type=
"float", default=
None,
24 help=
"X origin of the density map")
25 parser.add_option(
"-y",
"--y", type=
"float", default=
None,
26 help=
"Y origin of the density map")
27 parser.add_option(
"-z",
"--z", type=
"float", default=
None,
28 help=
"Z origin of the density map")
29 parser.add_option(
"--cmm", type=
"str", default=
"",
30 help=
"write results in CMM format")
31 parser.add_option(
"--seg", type=
"str", default=
"",
32 help=
"write out each cluster as an MRC file called "
33 "<seg>_.mrc, and write load_segmentation.cmd file "
34 "to easily load all segments into Chimera")
35 parser.add_option(
"--txt", type=
"str", default=
"",
36 help=
"write anchor points file in text format")
37 options, args = parser.parse_args()
40 parser.error(
"incorrect number of arguments")
45 opts, args = parse_args()
46 asmb_fn, num_cluster, threshold, output = args
47 num_cluster = int(num_cluster)
48 threshold = float(threshold)
51 opts.apix = dmap.get_spacing()
53 dmap.update_voxel_size(opts.apix)
61 dmap.set_origin(opts.x, opts.y, opts.z)
62 dmap.set_was_used(
True)
64 output, opts.cmm, opts.seg, opts.txt)
66 if __name__==
"__main__":
See IMP.multifit for more information.
See IMP.em for more information.
DensityMap * read_map(std::string filename)
IMP::kernel::OptionParser OptionParser
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.