Mosflm and Scala
- Input and Output Files
- After you collect your first few
images...
- Data Integration
- Scaling and merging
- Converting Data into Other
Formats
- Detailed Description of Files
and Scripts
- The Mosflm User
Guide and Mosflm help site
- Scala and Truncate documentation.
Mosflm runs on the "blcpu" computers dedicated
for data processing (see the Data
Processing Environment help).
For interactive auto indexing, strategy, cell parameter refinement
and integration use the mosflm command. For batch integration following autoindexing, use
integ. For the final scaling and merging you may use the
scale command; if you wish to scale MAD data sets processed
with mosflm, it is better to use the MAD scripts instead.
The new ipmosflm GUI "imosflm" is also available on the data processing
computers. The SSRL mosflm script relies on the old GUI. Both
imosflm and the mosflm script run the same version of ipmosflm.
The final output Fobs are written to 'yourcrystal.mtz'
(CCP4 mtz file) and 'yourcrystal_F.mtz'. Summary and
log files are written to 'yourcrystal.mosflm_sum',
'yourcrystal.mosflm_log','yourcrystal.scale_sum' and
'yourcrystal.scale_log'.
Final statistics can be looked at graphically with the commands
'xloggraph yourcrystal.mosflm_sum' and 'xloggraph
yourcrystal.scale_sum'.
For information about the directory structure of your computer
account, please read the the Data
Processing Environment help
Back to TOC
Start mosflm and then...
- AUTO INDEX to check crystal quality.
- Use the STRATEGY option to determine
phi range for completeness.
- The TESTGEN option may then be used to
determine the optimal oscillation range.
- INTEGRATE two images to determine
I/sigma(I) to set the correct exposure time.
See also: The Official Mosflm User Guide: [Inspection of New Images] [Check Exposure Time] [ Autoindexing] [Estimating the Mosaic
Spread]
Back to TOC
The mosflm and scale scripts create and read
a file called symbols which contains input parameters
for mosflm and scala.
- To launch the mosflm program, enter the command
mosflm followed by the name of the first image file of
the data set. For example:
blcpu4> mosflm
/data/spokesperson/xtal2/xtal2_001.img
Tip:
mosflm_SD can be used instead if the normal GUI does not fit in the
screen.
- The program will read most of the information needed for
autoindexing from the image header. If the detector is offset, you can
specify determine the correct center from the header: use the BEAM_X
coordinate from the header for the center y coordinate , and subtract
the BEAM_Y coordinate from the detector width (315, 325, etc.) for the
center x coordinate. Tip: You can use the WebIce Image
tab to view the image header.
Then use the
-beamcenter option followed by the correct beam center for the
image. For example you may enter:
blcpu4> mosflm crystal_001.img -beamcenter 150.1
149.7
- To view a list of all the options available using the
mosflm script type:
blcpu4> mosflm -h
- After entering the mosflm command, the mosflm
interactive window will appear on the screen and the image you
specified should be displayed.
 (Click on this image
to get a full size view in a new window.)
- Now determine the radius required to exclude the beam stop
shadow. The red circle in the center indicates what is currently
excluded (too small in our case). This can be modified by clicking on
the Beam /mask areas button in the main
menu. Another menu will come up:
 |
- Click on the Circular backstop option; follow the
instructions in the pop-up window (5 to 8 points are OK to
define the shadow): Then click on Fit points in the
Menu and confirm that you want to update the backstop radius and
position in the pop-up window

Tip: You can use the Mask areas menu to exclude
other parts of the image
|
- If you are collecting data with a square area detector (Q315,
MAR325 or Q4 CCDs) and you do not have or do not wish to use diffraction
spots in the corners, you can limit the maximum resolution by
editing the corresponding line in the Processing parameters
list:
- You can find out the resolution on any point of the image by
clicking on it. The resolution is displayed on the Output
window.
|
 |
Back to TOC
Now you can try to autoindex using this first image.
Back to TOC
- Verify all parameters, especially the direct beam position,
distance and wavelength.
- If you have very faint spots, add spots manually or decrease
the Min I/sig or threshold parameter
at the bottom of the processing parameters module. Using
more images for autoindexing will also help.
- For very strong diffraction images with a large number of
spots, change the Min I/sig threshold up to about 100. This is done by
entering 't' in the autoindexing command window and then
the new threshold parameter:

See also: The Official Mosflm User Guide:[Autoindexing] [Autoindexing Interactively]
Back to TOC
The Strategy Option helps the experimenter optimize data collection
parameters in order to utilize the available beam time to collect
the most complete data set possible. For a single axis rotation
camera, the strategy option will calculate the starting phi angle
and phi range necessary to obtain a complete data set, as well as
calculate statistics on completeness and multiplicity for various
phi ranges. In addition, if data has been previously collected from
the current crystal or from other crystals, the strategy option can
determine the best phi range to complete the data set.
Before using this option the crystal symmetry and orientation
must be determined using the autoindexing
option of Mosflm.
- To Start the Strategy option when running Mosflm choose the menu
option Strategy. The program will then prompt for
input:
Do you want to proceed (Y): y
MOSFLM =>
- To obtain the starting phi angle and rotation required to obtain a
complete data set if possible, and obtain statistics on
completeness and multiplicity, type:
MOSFLM =>STRATEGY AUTO
MOSFLM =>GO
- In order to maximize the anomlaous pairs (for example, for MAD
data collection) type:
MOSFLM =>STRATEGY ANOMALOUS
MOSFLM =>GO
- Type STATS at the prompt to get statistics on
completeness and multiplicity.
- Use Rotate {phirot} with the Auto option
to obtain the best phi range to use when the total phi rotation is
restricted to a given value, {phirot}. Use Segment
{nseg} to allow the data collection to be divided into {nseg}
segments with approximately equal values of phi or one may also
specify the size of the segments by including Sizes {size1,
size2, ...} with a size for each segment. Remember that as
the amount of segments are increased so does the amount of
unmatched partial reflections in the data set.
STRATEGY =>AUTO ROTATION 60 SEGMENTS 2
STRATEGY =>GO
- The above commands will cause the Strategy option to find the
best 2 segments of 30 degrees that will give the maximum
completeness. Remember that if data collection time is limited, it
is better to collect a more complete data set than an incomplete
data set with high multiplicity. If the phi range is
specified and {phirot} is larger than the initial range specified
when the strategy option first starts, then the program will
complain. If this occurs, exit the Strategy option and restart with
the larger initial phi range.
- Type Exit to stop the strategy option.
See also: The Official Mosflm User Guide: [Strategy][Overview of Strategy] The
Mosflm Help File: [Strategy]
Back to TOC
After the strategy has been worked out you can then use the TESTGEN
option to help determine what the (maximum) rotation angle is to
avoid getting (too many) spatial overlaps on the images. If the
maximum rotation angle is too small, you may want to try using
another phi range (Use Strategy with the SEGMENT keyword to help find
another range that will give reasonable completeness).
- It is essential to have a good estimate of your mosaic spread before using this
option.
- To get a list of the possible TESTGEN keywords type (in the
strategy menu):
STRATEGY=> TESTGEN
- If your data collection is to be from 10 to 100 degrees and you
would like no overlaps, type :
STRATEGY=> TESTGEN START 10 END 100
STRATEGY=> GO
- The program will calculate the MAXIMUM possible rotation angles
for this range, at intervals of 5 degrees.
- The command below will calculate the maximum possible rotation
angles for this range, that will result in less than 2% of the
reflections to be overlapping:
STRATEGY=> TESTGEN START 10 END 100 OVERLAP 2
STRATEGY=> GO
- When the minimum oscillation angle per frame suggested by
TESTGEN is significantly larger than the mosaicity, using a smaller
angle will increase the I/sigma statistics in the data set. This is
particularly particularly reccommended when using the fast-readout
Q315 detector. On the other hand, collecting phi slices less than
half the mosaicity is discouraged.
See also: The Official Mosflm User Guide: [Testgen][Testgen Option], The
Mosflm Help File:[Testgen]
Back to TOC
- Collect an image using the oscillation angle derived from TESTGEN
 |
- Click on the main menu button Integrate. Select
all the default options in the pop-up window. The options in the main
menu window will change
- If you are integrating the data on the corners of the detector,
abort the procedure and edit Resolution in the processing
parameters module until you are not clipping the pattern of
predicted reflections.
- Select the Auto-refine option. This will refine the
prediction. A pop-up window will display the average profile. For
good patterns, the rms residual should be around 0.05 or less.
Click on continue. If bad spots are found, you will get another
pop-up window:

- Typically, a few bad spots are found between the modules in the
ADSC CCDs or the beamstop shadow. If you reply "yes" to the above
question, they will be marked with a red cross.
|
See also: The Official Mosflm User Guide:[Masking detector regions]
- Click on continue, until you get back to the original main
menu. Then bring up the unix shell window from which you are
running mosflm and scroll upwards until you get to the intensity
analysis as a function of resolution:

- Look at I/sigmaI for the profile fitted reflections.
As a rough rule of thumb, you are measuring significant data if the
I/sigmaI for fully recorded reflections is larger than 2-3
(or 1-2 for partially recorded reflections). If it is less than
that, you should either move the detector further away from the sample
(to use the detector efficiently by collecting meaningful data to
the edge of the surface area )
or increase the exposure time - remember that, approximately,
to double I/sigmaI you have to increase the exposure time
at least about x4.
- If I/sigmaI is large for the highest resolution shell, you
can move the detector closer to the sample to collect to higher
resolution or, if collecting high resolution data is not a
priority, cut down the exposure time to reduce radiation
damage.
- If the pattern contains overloaded reflections and you wish to
collect data to high resolution, consult the
Ultra-High Resolution Data Collection documentation
- It is advisable to check the exposure time is correct on an
image collected at a different phi in the rotation angle,
especially if the crystal has an irregular shape
See also: The Official Mosflm User Guide: [Checking the exposure time]
Back to TOC
After a few images have been collected, you can refine your cell and
detector parameters. To start refinement, click the Refine
cell
The program prompts for input. Depending on your space group,
you are recommended to use either 1 or 2 segments in phi space for
the parameter refinement.
For your initial data quality check, you should simply use the
images that are available. Full data processing should include at
least 4 images from two segments separated as far as possible in
phi space.
The refined values of the unit cell and mosaic spread are
displayed in the Processing parameters module. The central
profile for each image is also displayed.
See also: The Official Mosflm User Guide: [Accurate Cell Parameters] [Refine Cell][Post Refinement of Cell],
The Mosflm Help File: [Refinement]
Back to TOC
Before integrating your data set, the unit
cell parameters and mosaicity should be refined.
If data collection of a set will go on for longer than 15-20
minutes, it is advisable to first integrate (and subsequently
scale) a few images rather than the entire data set. This will
allow you to find out if you made an incorrect choice of space
group and modify the data
collection strategy accordingly.
Choose the menu option Integrate, and answer a few
questions. Changing the output file
name or using the 'add' keyword is not compatible with the
SSRL scripts, except for the MAD scripts.
While interactive integration is useful to verify visually that
refinement and integration are proceeding well (e.g., the
predicted reflections coincide with the observed ones, there
are no unexpected overlapped reflections caused by an increase in the
mosaicity, etc.), the program runs much faster if the integration is
carried out in batch mode without the GUI. To integrate images in this
mode, use the integ script:
blcpu4> integ 1 20
The above command will integrate and postrefine images 1 to 20.
- When the integration is complete, look in the file called
'yourcrystal.mosflm_sum', to check I/sig(I),
Rsym and SDRatio, etc..., as well as any warning
messages that may occur. The warning messages may suggest adding
keyword options during your next integration cycle. The
.sum file contains both text and graphic output. The text
may be read by using a text editor such as nedit or
xemacs
blcpu4> xemacs crystal.mosflm_sum
- The statistics can also be looked at graphically by typing the
command:
blcpu4> xloggraph crystal.mosflm_sum
For more information see [The Official Mosflm User Guide: The
SUMMARY file], [The
Official Mosflm User Guide: Checking Data Quality]
- To enter keyword options in subsequent data integrations click on
the Keyword input
main menu option and then enter the desired command line. The command
lines may also be saved in the
symbols file by either editing the symbols file and
setting the addinteg = "command line". For example:
addinteg = "SEPARATION 1.0 1.0 CLOSE"
- Yet another option is to add the command lines in the
mosflm script command line used to start mosflm.
For example: blcpu4> mosflm crystal_001.image -addinteg
"SEPARATION 1.0 1.0 CLOSE"
- If you wish to process the images as they are written out by
the data collection collection, use the 'wait "minutes"'
command (enetered as described above). For example:
wait 0.5
will cause mosflm to wait for the next image for 0.5 minutes.
The time should be slightly longer than the exposure time plus the
detector readout time.
- It may take several cycles of integration and scaling, followed
by going back to some earlier stage (such as cell refinement,
setting the mosaic spread, etc...) before you optimize your data
integration. During synchrotron experiments it is recommended to do
a faster integration at the beamline and attempt structure solution
before removing the crystal and to do a more thorough job back at
home.
See also: [The Official
Mosflm User Guide: Integrating the Data set]
Back to TOC
Once you are done integrating you data, your next step is to
scale and merge your data set. Scaling and merging are done with
the CCP4 program scala. (If you want to process a MAD
data set (or proceed with phasing with a SAD data set, use the MAD
scripts).
- To start scala, type the following command:
blcpu4> scale filename.mtz
- For scaling and merging together more than one .mtz file simply
list all the files after the scale command:
blcpu4> scale crystal1.mtz crystal2.mtz
crystal3.mtz
- Each input file will get a different "run" number assigned to
it.
- To view a list of all the options available using
scale type:
blcpu4> scale -h
- The summary file outputroot.scale_log contains data
reduction statistics, including I/sig(I), Rsymm, data redundancy,
systematic absences, etc. This file should be examined with a text
editor such as nedit or xemacs and graphically with
the program xloggraph to make sure there were no problems
with the data.
If you are running mosflm on one of the alpha
computers (blcpus), a shorter summary file named
outputroot.scale_sum will also be created.
- Options for scaling can be added by editing the
symbols file and setting addscale = "COMMAND
LINE". The options may also be added on the scale command line
in quotes. For example:
blcpu4> scale crystal_001.mtz -addscale "INTENSITIES
PARTIALS"
- In contrast to integration, scaling is usually very simple as
only a few combinations of options are commonly used, namely:
"INTENSITIES
PARTIALS"
Includes partial reflections in the scaling calculation. This
option must be used when one or more images have no full
reflections in common with the rest of the images but can also
improve the scales even when this isn't the case.
"SCALES BATCH BFACTOR
ON"
This is the default option in the prototype. The BATCH
keyword indicates that the linear scales are not restrained to
change smoothly from image to image and BFACTOR ON
calculates an overall B factor for each image to compensate for
crystal decay.
"SCALES BROTATION SPACING 10 BATCH
BFACTOR ON"
Is similar to the previous option but restrains the B factors to
change smoothly with time.
"SCALES ROTATION SPACING 5 DETECTOR 3
3"
The overall scale factor changes smoothly from image to image
and from point to point on the detector. This is often combined
with:
"TIE DETECTOR 0.1"
To restrain the amount of point-to-point variation.
"RESOL RUN 1 LOW 20 HIGH 2.3"
"RESOL RUN 2 LOW 14 HIGH 2.5"
When scaling two data sets together, this will cause the program
to use different resolution limits for the scaling.
See also: [Scala:
Keywords]
Back to TOC
Once you are done scaling and merging your data, to create data
files for input into other programs simply type
'makedata'.
blcpu4> makedata
- An '.fob' file for X-plor, a '.fin'
file for XtalView, a '.hkl' file for
SHELXL97 and a '.sca' file for phases will be
created.
- Each file is written twice - with and without anomalous
signal.
- The merged intensities are converted to structure factors with
the CCP4 program truncate. The default options in the
prototype script do not normally need to be changed.
- If the makedata command does not function correctly,
make sure that there is a symbols file present in your
current directory and that the correct directory and outputroot is
specified in the symbols file.
Now you can start phasing or calculating maps. There are
several packages installed at SSRL computers for complete structure
several packages installed at SSRL computers for complete structure
determination.
Back to TOC
In the "/home/template/mosflm-scala" directory there
are copies of the SSRL specific mosflm input and shell files. These
scripts require the CCP4
program suite.
If you would like to use the mosflm and
scale scripts at home you may ftp these files to your
home computer and put them in your .../bin directory.
Choose the appropriate subdirectory depending on which beamline you
were using. In addition you may
click here to view or download these files from the
web.
Back to TOC
The symbols file is created and used by both the
mosflm and scale script files. Any required
information not specified in the command line used to start
mosflm or scala will be read from the
symbols file. After mosflm exits a copy of
symbols will be saved as
outputroot.symbols.
You may modify the symbols file (no longer required)
to match your specific experiment or view this file after
autoindexing, integration and scaling to see the parameters that
were used. You may use an editor (such as nedit or xemacs) to open
symbols
blcpu4> xemacs symbols

(click for a larger view of the xemacs
editor in a separate window)
Under normal circumstances the symbols file need not
be modified since most parameters can be taken from the image file
header. However, you may make the following modifications:
set imagename =
crystal_001.image
(Set imagename to the name of the first image file)
set ident = crystal
(the root name of your first image file. If your first image
file is mbo50_001.image, then 'crystal' should be set to
'mbo50'.)
set extension = image
(the image file extension)
set start = 0
(the starting number to be included in the data set)
set highres = 1.
set lowres = 100.0
(the high and low resolution limit of your data)
set title = "your title"
(the title that will be saved on the .mtz files)
set mosaic = (mosaic
spread)
set data =
/data/yourusername/crystal
(the directory where the image files are located)
set space = P1
(space group if known)
set distance = 300.0
(the crystal to detector distance)
set beamcenter = "150.00
150.00"
(the beam center as given by the centre program)
set backstopcenter = "150.0
150.0"
(the beamstop center)
set backstopradius =
11
(the beamstop radius)
set nullpix = 0
(the minimum valid pixel value, you may set this value to reject
the beamstop shadow)
set wavelength = (wavelength)
set nresidue = 500
(number of residues in the protein)
set addinteg = "command
line"
(integration keyword input)
set addscale = "command
line"
(scaling and merging keyword input)
See also: The Official Mosflm User Guide: [Startup Keywords]
Back to TOC
|