Alexandre Bonvin bio photo

Computational Structural Biology group focusing on dissecting, understanding and predicting biomolecular interactions at the molecular level.

Email Bluesky Github Youtube Subscribe


Supported by:




PowerFit Tutorial

This tutorial consists of the following sections:

This tutorial was last updated on 08-11-2026 and is up-to-date with release v6.1.0.

Introduction

PowerFit is a software application developed to fit atomic resolution structures of biomolecules to cryo-electron microscopy (cryo-EM) density maps. It is open-source and available for download on Github. In addition you can find a manual on usage of PowerFit here.

This tutorial will show you how to utilize PowerFit by applying it to an E.coli ribosome case. To follow this tutorial, you need, in addition to PowerFit, the UCSF ChimeraX visualization software, a popular tool in the cryo-electron microscopy community for its volume visualization capabilities. We will further discuss the limits of rigid body fitting and compare the models with experimental structures of the complex. We provide the data necessary to run this tutorial here. If you do not want to install PowerFit, the same case can be run with our PowerFit web server.

PowerFit is described in

Throughout the tutorial, colored text will be used to refer to questions or instructions, Linux and/or ChimeraX commands.

This is a question prompt: try answering it! This an instruction prompt: follow it! This is a ChimeraX prompt: write this in the ChimeraX command line! This is a Linux prompt: insert the commands in the terminal!

The case we will be investigating is a complex between the 30S E. coli ribosomal subunit and RsgA, a GTPase involved in ribosome biogenesis. There are models (2YKR) and a cryo-EM density map of around 9.8Å resolution (EMD-1884) available for the complex.

Setup

Installing PowerFit

PowerFit is a Python package that requires Python 3.11 or greater. It runs on Linux, macOS and Windows. We recommend installing it in its own virtual environment.

Create and activate a virtual environment, and install PowerFit in it. python3 -m venv powerfit-env
source powerfit-env/bin/activate
pip install powerfit-em

If you use a csh or tcsh shell, activate the environment with source powerfit-env/bin/activate.csh instead. On macOS, also install pyFFTW, which makes the search faster and is needed for the map used in this tutorial (see this issue):

pip install pyfftw

Check that the installation worked:

powerfit --version

This installs the CPU version of PowerFit, which is all you need for this tutorial. To run PowerFit on a GPU, follow the installation instructions for your operating system.

You will also need UCSF ChimeraX to visualize the data and the results, and a web browser to view the PowerFit report.

Note: In this tutorial we start ChimeraX from the command line with the files to load (e.g. chimerax ribosome-RsgA.map ribosome.pdb). If the chimerax command is not available in your terminal, start the ChimeraX application instead and load the same files with the File > Open... menu.

Getting the data

We prepared a folder that contains the cryo-EM density map file in CCP4 format (ribosome-RsgA.map), the model of the ribosome (ribosome.pdb), which has already been fitted in the density, and the model of RsgA (RsgA.pdb), taken from the 2YKR entry, centred at the origin and randomly rotated so that it does not start from its position in the map. It also contains the experimental structure 7NAR.pdb, used at the end of the tutorial, in case it cannot be downloaded from the PDB.

Download the data and unpack the archive. curl -L -O https://www.bonvinlab.org/education/Others/powerfit/powerfit-tutorial.zip
unzip powerfit-tutorial.zip
cd powerfit-tutorial

Inspecting the data

Let us first inspect the data we have available, namely the cryo-EM density map and the structures we will attempt to fit.

Using ChimeraX, we can easily visualize and inspect the density and models, mostly through a few mouse clicks.

Open the density map together with the ribosome and RsgA. chimerax ribosome-RsgA.map ribosome.pdb RsgA.pdb

In the Volume Viewer window, the middle slide bar provides control on the value at which the isosurface of the density is shown. At high values, the envelope will shrink while lower values might even display the noise in the map. We will first make the density transparent, to see the fitted structure inside:

transparency #1 60

Notice that the density becomes transparent providing a better view of the fit of the ribosome model. On closer inspection, you can also discern a region of the density that is not accounted for by the ribosome structure alone; this is the binding location of RsgA. If you cannot find it, try to lower the value of the isosurface using the slider in the Volume Viewer window. RsgA itself is located at the origin of the coordinate system, outside of the density. Although you could try and manually place it in the empty region of the density, finding the correct orientation is not straightforward. PowerFit can help here as it attempts to find the best fit automatically and exhaustively, based on an objective score.

Rigid body fitting

PowerFit is a rigid body fitting software that quickly calculates the cross-correlation, a common measure of the goodness-of-fit, between the atomic structure and the density map. It performs a systematic 6-dimensional scan of the three translational and three rotational degrees of freedom. In short, PowerFit will try to fit the structure in many orientations at every position on the map and calculate a cross-correlation score for each of them.

Perform the rigid-body fitting of the RsgA structure on the cryo-EM density map. powerfit ribosome-RsgA.map 9.8 RsgA.pdb -d run-RsgA -p 4 --report --delimiter , --progressbar

While performing the search, PowerFit will update you on the progress of the search. The example case in this tutorial should run in a few minutes.

Note: The command above uses 4 processors (-p 4). If your computer has more CPU cores, you can increase this value to speed up the search (e.g. -p 8). You can check the number of cores with nproc on Linux or sysctl -n hw.ncpu on macOS.

Note: If the search is much slower than expected, check whether the OMP_NUM_THREADS environment variable is set (echo $OMP_NUM_THREADS). Each PowerFit process then uses that many threads for its FFTs, and with several processors (-p) the computer gets overloaded. Set it to 1 before running PowerFit with export OMP_NUM_THREADS=1 (bash/zsh) or setenv OMP_NUM_THREADS 1 (csh/tcsh).

While the calculation is running, open a second terminal window (or tab) and type powerfit --help to have a look at the several features and options of PowerFit and what each flag of the previous command means.

PowerFit requires three arguments: a target cryo-EM density map to fit the structure in (ribosome-RsgA.map), the resolution, in ångstrom, of the density map (9.8), and a high-resolution atomic structure of the biomolecule to be fitted (RsgA.pdb).

The -a (or --angle) option, not used here, specifies the rotational sampling interval in degrees, i.e. how tightly the three rotational degrees of freedom will be sampled. Lower values will cause PowerFit to perform a finer search, at the expense of computational time. The default value of 10° is used in this tutorial; it can be lowered to 5° for more sensitive searches, or raised to 20° if time is an issue or if there aren’t sufficient computational resources. The -d option specifies where the results will be stored while the -p option specifies the number of processors that PowerFit can use during the search, to leverage available CPU resources. The --report option creates an HTML report with an interactive 3D view of the best fits; it requires --delimiter ,, which writes the solutions.out file in comma-separated format.

In this example scenario, all other options are left at their default values, which are also the defaults of the PowerFit web server, but feel free to explore them.

Analyzing the results

After the search, PowerFit creates a run-RsgA directory containing the following files:

  • fit_N.pdb: the best N fits, judged by the cross-correlation score.
  • solutions.out: all the non-redundant solutions found, ordered by their correlation score. The first column shows the rank, column 2 the correlation score, column 3 and 4 the Fisher z-score and the relative z-score (the number of standard deviations); column 5 to 7 are the x, y and z coordinate of the center of the chain; column 8 to 16 are the rotation matrix values.
  • lcc.mrc: a cross-correlation map showing, at each grid position, the highest cross-correlation score found during the search, thus showing the most likely location of the center of mass of the structure.
  • powerfit.log: a log file of the calculation, including the input parameters with date and timing information.
  • report.html and state.mvsj: an HTML report and its MolViewSpec state file, with an interactive 3D view of the best fits. A copy of the density map is placed next to them for the viewer.

Viewing the report

The report loads its data from the files in the run-RsgA directory, so it must be opened through a web server rather than by double-clicking report.html. Python comes with a simple one.

Start a local web server in the results directory. python3 -m http.server -d run-RsgA Open http://localhost:8000/report.html in your web browser.

At the top of the report, a Mol* viewer shows the density map with the best non-redundant solutions. While clicking through the models, the viewer reports the rank, cross-correlation score, Fisher z-score and sigma difference of each fit. Below the viewer, a table lists these values for all solutions. A difference in Fisher z-score of more than ~2.5 standard deviations between the two top solutions indicates a reliable fit; this is explained in more detail in the PowerFit web server tutorial, whose result page is the same report.

Based on the sigma differences, does PowerFit find one solution that clearly stands out?

When you are done, stop the web server by pressing Ctrl-C in the terminal.

Inspecting the fits in ChimeraX

For a closer look at the fits, we will now use ChimeraX.

Open the density map, the lcc.mrc cross-correlation map, and the 10 best-ranked solutions in ChimeraX. chimerax ribosome-RsgA.map run-RsgA/lcc.mrc ribosome.pdb run-RsgA/fit_*.pdb

Make the density map transparent again to 60. The values of the lcc.mrc slider bar correspond to the cross-correlation score found. In this way, you can selectively visualize regions of high or low cross-correlation values: i.e., pushing the slider to the right (higher cutoff) shows only regions of the grid with high cross-correlation scores.

As you can see, PowerFit found quite some local optima, one of which stands out. Further, the 10 best-ranked solutions are centered on regions corresponding to local cross-correlation maxima.

To view each fitted solution individually, in the main panel, go to Tools → Models to open the Model Panel window. The window shows each model and its associated color that ChimeraX has processed. To show or hide a specific model you can click the box in the column with an eye.

Go through the 10 solutions one by one to appreciate their goodness-of-fit with the density. Do you agree with what PowerFit proposes as the best solution?

In a new ChimeraX session, reopen the density map and the fit that you find best. Replace ? by the appropriate solution number. chimerax ribosome-RsgA.map ribosome.pdb run-RsgA/fit_?.pdb

You now have combined the ribosome structure with the rigid-body fit of RsgA calculated by PowerFit, yielding an initial model of the complex. Take a closer look at residues R47 to H51 of RsgA, which contribute to the interface with the ribosome.

In the same session of ChimeraX where you have your chosen fitted RsgA structure, type in the command line of ChimeraX the following instructions to center your view on these residues and highlight their interactions:

hide #2 atoms
show #2 cartoons
sel #3:47-51
view sel
contacts sel distanceOnly 5.0 makePseudobonds true reveal true
Take some time to inspect the model, paying particular attention to these five residues and their spatial neighbors.

Clash analysis

Since PowerFit treats the structures as rigid bodies and only considers their fit into the density, the fitted model can contain clashes with the ribosome. ChimeraX can find all atom pairs between RsgA and the ribosome that overlap too much:

~contacts
clashes #3 restrict cross reveal true

The number of clashes is reported in the bottom bar of the ChimeraX window and in the Log; the clashes are shown as pseudobonds between the atoms.

How many clashes are there between the ribosome and RsgA? Which parts of RsgA are involved?

ChimeraX also includes a tool to locally optimize the fit of a rigid structure against a given density map, which can be an additional help on top of the PowerFit calculations. To judge whether the optimization improves the fit, we first calculate the correlation between the density map and a map simulated from the PowerFit model at 9.8 Å, without moving the model:

fitmap #3 inMap #1 resolution 9.8 metric correlation shift false rotate false

Note the correlation and correlation about mean values reported in the Log. ChimeraX also adds the simulated map as a new model, which you can hide in the Models panel.

Make the main display window active by clicking on it.
Go to Tools → Volume Data → Fit in Map.
In the Fit in Map window, select the best-fitted structure of PowerFit (fit_?.pdb) as Fit model and the original density map (ribosome-RsgA.map) as the map.
Press Fit to start the optimization.

Does the ChimeraX local fit optimization tool improve the results of PowerFit? Calculate the correlation again with the same fitmap command and compare it with the value before the fit. Repeat the clash analysis to check.

If the optimization does not improve the fit, click Undo in the Fit in Map window.

Next, we will try to optimize the fit using the cross-correlation that ChimeraX provides.

Click Options.
Check the Use map simulated from atoms, resolution box and fill in 9.8 for the resolution.
Check the correlation radio button.
Uncheck the Use only data above contour level from first map box.
Press Fit.

Does this second strategy improve the quality of the fit? Compare again the correlation and the clashes with the values before the fit. If it does not improve, undo it again.

Comparison with experimental structures

Since the publication of the 9.8Å map, higher resolution cryo-EM structures of RsgA bound to the 30S subunit have been determined, for example 7NAR (3.0Å), 5NO2 (5.2Å) and 5UZ4 (5.8Å). We can use them to check how close our models are to the experimental structure. To compare the position of RsgA, we first superimpose the 16S ribosomal RNA of the experimental structure on the one of our ribosome model. We then calculate the root mean square deviation (RMSD) of the C-alpha atoms of RsgA, without any further fitting.

Open the ribosome and your preferred PowerFit fit in a new ChimeraX session. chimerax ribosome.pdb run-RsgA/fit_?.pdb Download the 7NAR structure from the PDB and superimpose its 16S rRNA (chain A) on the one of the ribosome model. open 7nar
matchmaker #3/A to #1/A cutoffDistance none
hide atoms
show cartoons

Note: If the download from the PDB fails (e.g. network problems), use the copy of the structure provided in the tutorial data instead: replace open 7nar by open 7NAR.pdb.

RsgA is chain W in 7NAR. Our RsgA model has a few gaps, so we select in 7NAR only the residues that are also present in the model:

rmsd #2@CA to #3/W:35-85,93-110,116-237,251-337@CA How close is the PowerFit fit to the experimental structure? Open the other top-ranked PowerFit solutions, show them as ribbons only (hide atoms, show cartoons) and calculate their RMSD in the same way, adapting the model number. Does the best-scoring PowerFit solution also have the lowest RMSD?

The experimental structure also tells us how many clashes to expect between RsgA and the ribosome in a well-refined model:

clashes #3/W restrict cross interModel false How does this number compare with the one you found for the PowerFit fit?

Finally, we can score the experimental position of RsgA in our density map. Save RsgA from 7NAR in the coordinate frame of the ribosome model:

select #3/W
save RsgA-7NAR.pdb models #3 selectedOnly true relModel #1

The powerfit-score command, installed together with PowerFit, calculates the cross-correlation, Fisher z-score and relative z-score of a structure at its current position in the map, without any rotational or translational search.

powerfit-score ribosome-RsgA.map 9.8 RsgA-7NAR.pdb
powerfit-score ribosome-RsgA.map 9.8 run-RsgA/fit_?.pdb

The scores are printed in the same comma-separated format as solutions.out. Note that the score of a PowerFit fit can differ from the one reported in solutions.out, as powerfit-score rebuilds the density from the atomic coordinates instead of rotating precomputed grids (see powerfit-score --help). Also note that RsgA in 7NAR contains more residues than our model.

How does the fit of the experimental structure in the density compare with the PowerFit solution?

The experimental structures differ between them by a few ångstrom, as they capture different states of the 30S subunit; you can repeat the comparison with 5NO2 or 5UZ4 (RsgA is chain Z in both) to see how much.

BONUS: how robust is the fit to the starting orientation?

PowerFit samples a fixed set of rotations, here every 10°. The orientation of the input structure therefore determines how close the sampled rotations come to the correct one. To test how much this matters, create rotated copies of RsgA in ChimeraX and fit each of them. RsgA is centred at the origin, so we rotate it around the origin:

open RsgA.pdb
turn x 45 models #1 center 0,0,0 coordinateSystem #1
save RsgA-x45.pdb models #1
close
open RsgA.pdb
turn y 90 models #1 center 0,0,0 coordinateSystem #1
save RsgA-y90.pdb models #1
close
open RsgA.pdb
turn z 135 models #1 center 0,0,0 coordinateSystem #1
save RsgA-z135.pdb models #1
powerfit ribosome-RsgA.map 9.8 RsgA-x45.pdb -d run-x45 -p 2 --report --delimiter ,
powerfit ribosome-RsgA.map 9.8 RsgA-y90.pdb -d run-y90 -p 2 --report --delimiter ,
powerfit ribosome-RsgA.map 9.8 RsgA-z135.pdb -d run-z135 -p 2 --report --delimiter ,

For each run, look at the two top solutions in solutions.out, and calculate the RMSD of fit_1.pdb to 7NAR as described above.

Is the position of the best solution robust to the starting orientation? And its score and the sigma difference to the second solution? What happens if you use a finer rotational sampling (-a 5) for one of the orientations?

See our results
Input orientationSamplingcc rank 1Sigma difference rank 1-2CA-RMSD fit_1 to 7NAR
RsgA.pdb10°0.4014.34.6 Å
RsgA-x45.pdb10°0.4176.43.8 Å
RsgA-y90.pdb10°0.3982.14.6 Å
RsgA-z135.pdb10°0.4514.93.8 Å
RsgA.pdb5°0.4415.03.8 Å
another random orientation10°0.3610.24.9 Å
another random orientation5°0.4312.54.0 Å

In all cases, the best solution is found at the same position, with orientations within 3.5 Å RMSD of each other and 4-5 Å from the experimental structure. The cross-correlation and the sigma difference to the second solution, however, depend on how close the sampled rotations come to the correct orientation: for some orientations, the sigma difference drops below the ~2.5 threshold, even though the solution is correct. A finer rotational sampling gives a higher score and makes the result less dependent on the starting orientation, at the cost of an about seven times longer run. When the sigma difference is close to the threshold, it is therefore worth repeating the search with a different starting orientation or a finer rotational sampling.

Conclusions

In this tutorial, we showed you how to use PowerFit to fit high-resolution structures to a cryo-EM density map, how to interpret the results, and how to compare the models with experimental structures. The obvious limitation of rigid-body fitting is that it cannot account for any conformational changes the structures might undergo, resulting in clashes at the interface between the molecules. Further, the low resolution of this particular density map does not allow the identification of side-chain atoms. Such models can be refined with flexible refinement protocols, for example with HADDOCK using the cryo-EM data as restraints:

Thank you for following this tutorial. If you have any questions or suggestions, feel free to contact us via email or by submitting an issue in the appropriate Github repository.