Segger
Segger partitions
volume data
to create a
surface model
with one or more segmentation regions (specialized
surface pieces)
shown in different colors.
Along with the SegFit tool,
Segger is part of the Segger package described in:
Quantitative analysis of cryo-EM density map segmentation by watershed and
scale-space filtering, and fitting of structures by alignment to regions.
Pintilie GD, Zhang J, Goddard TD, Chiu W, Gossard DC.
J Struct Biol. 2010 Jun;170(3):427-38.
Segmentation regions can be measured with
Measure and Color Blobs
and colored or selected by size using
Render/Select by Attribute.
The Measure and Color Blobs
tool can also be used on the
planar caps
where regions are clipped.
See also:
Segger documentation,
Segger how-to at the Chimera website,
Volume
Viewer,
Volume Filter,
Color Zone,
segment,
mask,
measure
Segger performs watershed segmentation:
a density map is partitioned so that each local maximum has its
own region, and the boundaries between regions lie at the
valleys between the local maxima. The goal is usually
one region per protein or domain, but the initial segmentation
often gives more numerous and smaller regions than desired,
especially if the data are noisy.
Segger provides various ways to combine regions after the initial segmentation:
However, it may also be necessary to smooth the data before
segmentation, as discussed below.
For working with large density maps (> 500 Mbytes), a 64-bit version of Chimera
and a machine with more than 4 Gbytes of memory are recommended.
It may be necessary to process a density map beforehand
to allow segmentation to finish in a reasonable amount of time.
Maps of size 2563 with grid spacing about 1/3 of the map resolution
are manageable on desktop computers circa 2010,
while larger maps may require smoothing and binning.
Calculation of 100,000 watershed regions is reasonable,
but calculation of a million is unusably slow. A map of size
2563 can easily have a million local maxima if it is noisy.
Gaussian filtering and binning to reduce the number of local maxima
can be performed with
Volume Filter
or the command vop.
Gaussian filtering reduces resolution to about six times the Gaussian
standard deviation. For visualization and analysis, it is desirable
for a density map to be oversampled by three times in each dimension,
so binning should aim for a grid spacing of approximately twice the
Gaussian standard deviation.
If interactive rotation speed is poor after segmentation, see
response time issues.
Dialog and Basic Usage
There are several ways to start
Segger, a tool in the Volume Data category
(including from the
Volume Viewer
Tools menu).
The map of interest should be chosen from the pulldown menu of
open volume data sets next to Segment map.
The threshold (contour level) of the map in
Volume Viewer should be adjusted
before segmentation, because the calculation will use only the voxels
with density values above that level.
Clicking Segment partitions the chosen map by the watershed method plus
smoothing and grouping as specified in the options.
The segmentation result is shown as a
surface model
with one or more segmentation regions (specialized
surface pieces)
of different colors. The resulting number of regions is reported in the
dialog and the Reply Log.
The segmentation is given the same name as the corresponding map except
with .seg appended.
The Current segmentation is indicated in the dialog and can be changed
by choosing a different segmentation name from the pulldown menu.
Designating a segmentation as the current segmentation
shows it and hides any others.
Grouping and ungrouping operations modify
the current segmentation model rather than creating a new one.
However, multiple segmentation models can be open at the same time,
and may have been generated from different density maps or opened from
previously saved segmentation files.
Grouping and ungrouping can be specified interactively
by selection. With default
Mouse preferences,
Ctrl-click selects a region and Shift-Ctrl-click selects additional regions
without erasing the pre-existing selection.
- If no segmentation regions are selected,
clicking Ungroup backtracks to the previous stage of grouping of the
current segmentation.
By default, Segment automatically applies three rounds of smoothing
and grouping; after that, the three intermediate stages could be accessed
by clicking Ungroup three times. If regions are selected,
Ungroup will backtrack to the previous stage of grouping for
the selected region(s).
- If no segmentation regions are selected,
Group traverses the stages in the opposite direction as Ungroup,
or performs further grouping.
If regions are selected,
Group will combine the selected regions into a single group.
Grouping, ungrouping, and other manipulations can also be performed with the
Segger Regions menu.
Segmentation results are not included in saved Chimera
sessions,
but can be saved using the Segger
File menu.
Close dismisses the Segger dialog.
Help shows documentation in a browser window.
Clicking Options reveals additional settings
(clicking the close button on the right
hides them again):
- Smoothing steps [N] step size [M] voxels
- how many rounds of automatic smoothing and grouping
(default N=3)
should be performed right after watershed segmentation
when the Segment button is clicked,
and how much smoothing to perform at each round
(default M=1).
If L is the minimum of the grid spacing along the three axes,
the standard deviation of the Gaussian used for smoothing
will be MxL in the first round and increase
by MxL in each subsequent round.
A single round consists of smoothing the data, then letting each
local maximum point from the previous round move by steepest ascent
to the location of a new local maximum.
If two or more previous maxima converge on a new maximum,
their regions from the previous round are coalesced into a single region.
In general, the number of rounds N is the dominant parameter to adjust
when fewer, larger regions are desired. A larger step size M may be
beneficial for noisier maps. However, a smaller step size gives more gradual
changes per round, thus more rounds to achieve a similar end result, and more
intermediate stages that can be traversed with the
Group and Ungroup buttons.
After the automatic rounds have completed, clicking Group
executes the minimum number of additional rounds needed to
change the grouping further.
- Keep only regions having at least [minsize] voxels
- throw out regions with fewer than minsize voxels (default 1,
retaining all regions). This applies only to the initial segmentation,
not after smoothing.
- Stop grouping if number of regions <= [minreg]
- backtrack to the previous stage of automatic grouping if the latest
round would give fewer than minreg regions (default 1).
This is useful for generating a segmentation with no fewer regions
than the known or suspected number of components in a complex.
- Display at most [maxreg] regions
- to avoid degrading performance, limit the number of displayed regions
to maxreg (default 2000).
If a greater number of regions is generated, however,
those which are not displayed will still be included in
subsequent smoothing and grouping calculations.
If response time is poor when a high number
(approaching maxreg) of regions is shown,
decreasing maxreg may help.
- Surface granularity
[trianglesize] voxels
- surfaces consist of triangles; smaller triangles give a smoother appearance,
but more triangles take longer to render. The default trianglesize
of 1 gives triangles comparable in size to the map grid spacing.
A value of 2 will make the triangles twice as large (quadruple the area)
and reduce their number by about a factor of 4. Increasing
trianglesize is recommended if response time
is poor.
- Group with mouse [button]
allows grouping watershed regions connected
at some density level, controlled interactively by mouse drag.
Activating this option reassigns the indicated mouse button
(which can be changed using the pulldown menu) from its normal function in the
Mouse preferences
to grouping by connectivity.
If the density map has not been segmented already,
the initial click on the map with the assigned button
performs watershed segmentation using only the voxels with density values above
the current threshold setting in
Volume Viewer, without subsequent smoothing/grouping.
If grouping has already been performed,
some ungrouping may be needed before using the connectivity method,
as it will not group watershed regions together if they are already
in different groups.
Watershed regions continuous with the clicked density are grouped and
shown in the same color. The level of density used
to determine connectivity can be adjusted by mouse drag.
Clicking a watershed region with the assigned button and dragging up (down)
shows what regions would be continuous with the first at more (less)
permissive density cutoffs. The coloring updates automatically:
regions that would be connected are shown in the same
color as the first, and unconnected but adjacent regions are shown
in their own group colors, or if not grouped, in gray.
The group being adjusted with the mouse
will not extend into a pre-existing group.
Releasing the mouse button groups the matching-color regions.
Clicking with the assigned button on the background
displays all of the ungrouped watershed regions
in the current segmentation,
and clicking again displays the grouped ones as well.
Any previously created group can be adjusted by clicking
one of its constituent watershed regions with the assigned button
and dragging as described above.
Clicking Shortcuts reveals several buttons
for quickly displaying, selecting, and acting upon selected
segmentation regions.
There are also buttons for calling separate dialogs:
- Fit - SegFit
- Extract - detailed options for extracting densities within
the selected regions
- rSeg - radial segmentation
- SegLoop - basic atomic structure modeling into regions
- ProMod - combining multiple atomic models into a probabilistic model
Clicking the close button on the right
hides the shortcut buttons.
Segmentation Region Attributes
Segmenting a map generates segmentation regions and
automatically assigns them several
attributes.
These attributes can be inspected and new attributes assigned
using the Region Attributes dialog, opened by choosing Regions...
Attributes table from the Segger menu.
Segmentation regions can be colored or
selected
based on their attribute values using the
Render/Select by Attribute tool.
See also:
Define Attribute,
measure spine
In the Region Attributes dialog,
each row is a region, and each column is an attribute that can be
shown or hidden using the Columns menu.
The table can be sorted by the values in any displayed column by
clicking the column header. Clicking the header once sorts the entries
in order of increasing value and places an up arrowhead (triangle)
in the header. Clicking again sorts the entries in decreasing
order and places a down arrowhead (inverted triangle) in the header.
One or more regions (rows) in the table
can be chosen with the left mouse button.
A contiguous block of rows can be chosen by dragging, or by
clicking on the first (or last) line and then Shift-clicking on the
last (or first). Ctrl-click toggles the status of a single line.
Choosing a region in the table
selects it, and
selecting a region in the
graphics window will center and highlight the corresponding row in the table.
The automatically created attributes are read-only:
- region - region ID number
- grid points - number of density map grid points within the region
- grouped - number of regions grouped to form the region
(next level in hierarchy, not necessarily the number of watershed regions)
- has surface - 1 if a surface has been made (not necessarily shown)
for the region
- contacts - number of contacting regions
- edge distance - number of voxels to the nearest edge
of the density map
- bounds (hidden by default) - grid indices bounding the region:
i_min, j_min, k_min, i_max, j_max, k_max
New attributes for the chosen region(s)
can be created or their values changed using:
- Set attribute [attr_name] to value [attr_value]
or [snapshot]
Region attribute values can be integers,
floating point numbers, text strings, or images, and a given attribute
(column) can have multiple types of values, although only one per region (row).
An attr_value can be entered, or the
snapshot button clicked to set the value to an image of the
graphics window. An image can be shown at full size by
clicking its miniature version in the table, and saved as PNG, JPEG, or TIFF
using the Save button on the full-size view.
The table can filtered to show only the rows meeting some attribute criterion:
The criterion is specified in Python syntax. Examples:
grid_points > 1500
note
contacts == 0 and note and "good" in note
where the second would list only regions with an attribute named note
and the third would list only regions that are not in contact with other regions
and that have an attribute named note containing the word good.
Clicking Update refreshes the Region Attributes dialog
to reflect any changes in the current segmentation
or its groupings. Close dismisses the dialog, and Help shows
this manual page in a browser window.
The contents (excluding images) of the rows and columns currently shown
in the filtered table can be saved in a comma-separated format using
File... Export in the Region Attributes dialog menu.
All of the attributes (including images)
can be saved along with other segmentation information
using File... Save Segmentation
in the Segger menu.
Segger Menu
Menu entries apply only to the current segmentation
unless stated otherwise.
File
- Open segmentation...
open a previously saved Segger segmentation file
- Save segmentation
- save the segmentation to a Segger file,
name/location previously specified
- Save segmentation as...
save the segmentation to a Segger file,
specify name/location
- Save selected regions to .mrc file...
save density map masked by the
selected segmentation regions
to an MRC file
(map dimensions set to the minimal box containing the regions)
- Save all regions to .mrc file...
save density map masked by all segmentation regions collectively
as an MRC file
(map dimensions set to the minimal box containing the regions)
- Save each region to .mrc file...
save density map masked by each
selected segmentation region
as a separate MRC file
(map dimensions set to the minimal box containing the corresponding region);
if no regions are selected, all are used
- Close segmentation
- close the current segmentation model
(a surface model)
- Close all segmentations except displayed
- close all hidden segmentation models
- Close all segmentations
- close all segmentation models
- Associate Selected
- associate the current segmentation
with the map currently chosen in the dialog
(useful when the map has been opened separately or from a different
location than expected by the session with the segmentation results)
Regions
- Show all
- show all segmentation regions
(surface pieces)
at the current level of grouping
- Show only selected
- show the selected
segmentation regions, hide all others
- Show adjacent
- show regions in contact with the
selected regions
- Show grouping
- show the watershed regions within groups
rather than the larger group surfaces;
affects the
selected
regions, or if none are selected, all regions; does not change the
groupings, only how they are shown
- Unshow grouping
- show the larger group surfaces rather than the watershed regions;
affects the
selected
regions, or if none are selected, all regions
- Hide
- undisplay the
selected
regions, or if none are selected, all regions
- Make transparent
- make 55% transparent the
selected
regions, or if none are selected, all regions
- Make opaque
- make opaque (0% transparent) the
selected
regions, or if none are selected, all regions
- Color density map
- color the density map display to match all regions
(subsequently changing the threshold will erase the coloring for
volume displays
in the surface or mesh but not solid style)
- Select groups
- select all regions composed of grouped watershed regions
- Select boundary regions
- select regions that contain at least one grid point within three voxels
of the edge of the density map
- Invert selection
- deselect the selected regions
and vice versa
- Regions overlapping current selection
- select any regions that overlap well with the currently
selected atoms,
deselect the atoms
- Group selected
- group the selected regions
- Ungroup selected
- ungroup the selected regions
- Smooth and group
- execute the minimum number of rounds of smoothing
and grouping needed to produce further grouping
(equivalent to clicking the Group button with nothing selected)
- Delete selected
- delete the selected regions
(cannot be undone)
- Delete all except selected
- delete all regions except those which are
selected (cannot be undone)
- Enclosed volume
- report the approximate total volume enclosed by the
selected regions
(number of grid points and Å3 value obtained by multiplying
the number of grid points by the voxel volume); more precise measurements
can be obtained with Measure
and Color Blobs
- Mean and SD
- report density map mean and standard deviation within each
selected region
of the current segmentation, which could be
based on a binned version of the chosen map
- Extract densities...
bring up a dialog with detailed options for extracting densities within
the selected regions
- Subtract selected from map
- inverse-mask the density map with the
selected regions
(create a new map: set the density values inside the regions to zero,
copy values elsewhere, maintain original map dimensions)
- Show axes for selected
- show principal axes of inertia as arrows for each
selected region
- Hide all axes
- remove all principal axes arrows
- Attributes table...
show table of region attributes
- How many sub-regions
- report number of subregions that have been grouped into the
selected region(s)
Response Time Issues
High number of surface triangles.
Surfaces are drawn as many small triangles.
The number of surface triangles can be reduced by increasing the
granularity (triangle size).
Doubling the value will reduce the number of triangles by approximately
a factor of 4 and may improve rendering speed by a similar factor.
Also, the display can be limited to a specified
maximum number of regions.
Selected surfaces.
Chimera shows selections with
a green outline (assuming default
Selection
preferences). Selection outlines can increase the time to draw a
single frame as much as fivefold. If rotation is slow, avoid having
objects selected when the selection is not needed.
Mac graphics speed.
Rendering many small segmentation surfaces on Mac OS 10.6 is about three
times slower than on other platforms (Linux, Windows). As mentioned above,
the display can be limited to a specified
maximum number of regions.
Also, increasing the surface granularity
will improve rendering speed.
The poor performance on the Mac is because Chimera has disabled use of
the fast rendering technique of OpenGL vertex buffer objects for small
surfaces, as it causes minute-long freezes on the Mac when over 5000
segmentation surfaces are shown.
UCSF Computer Graphics Laboratory / November 2020