3 __doc__ =
"Anchor graph segmentation of a density map."
7 from IMP
import OptionParser
11 usage =
"""%prog [options] <density.mrc> <number of clusters>
12 <density threshold> <output.pdb>
14 Segments all voxels in the given density map, above the given threshold,
15 into the given number of clusters, and links between neighboring ones.
17 The cluster centers are written out into a single output PDB file, each
21 parser.add_option(
"--apix", type=
"float", default=
None,
22 help=
"map spacing, in angstroms/pix (default: read "
24 parser.add_option(
"-x",
"--x", type=
"float", default=
None,
25 help=
"X origin of the density map")
26 parser.add_option(
"-y",
"--y", type=
"float", default=
None,
27 help=
"Y origin of the density map")
28 parser.add_option(
"-z",
"--z", type=
"float", default=
None,
29 help=
"Z origin of the density map")
30 parser.add_option(
"--cmm", type=
"str", default=
"",
31 help=
"write results in CMM format")
32 parser.add_option(
"--seg", type=
"str", default=
"",
33 help=
"write out each cluster as an MRC file called "
34 "<seg>_.mrc, and write load_segmentation.cmd file "
35 "to easily load all segments into Chimera")
36 parser.add_option(
"--txt", type=
"str", default=
"",
37 help=
"write anchor points file in text format")
38 options, args = parser.parse_args()
41 parser.error(
"incorrect number of arguments")
46 opts, args = parse_args()
47 asmb_fn, num_cluster, threshold, output = args
48 num_cluster = int(num_cluster)
49 threshold = float(threshold)
52 opts.apix = dmap.get_spacing()
54 dmap.update_voxel_size(opts.apix)
62 dmap.set_origin(opts.x, opts.y, opts.z)
63 dmap.set_was_used(
True)
65 output, opts.cmm, opts.seg, opts.txt)
67 if __name__ ==
"__main__":
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.
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.