Excellent question. This is a very common and specific error when moving from standard AutoDock/Vina to docking with explicit water maps using autodock-gpu.
Let's break down what the error message means and how to fix it.
Understanding the Error
Error: No map file specified for atom type W in fld and no derived type (--derivtype, -T) either.
...atom type W...: You used mapwater.py, which correctly generates an affinity grid map for water molecules. This map is associated with the atom type 'W' (for Water).
...No map file specified...: This is the core of the problem. When you run autodock-gpu for the actual docking, it needs to be told where to find the pre-calculated grid maps for every atom type it will encounter. Your command is missing the instruction to use the .W.map file you generated.
...in fld...: The .fld file (e.g., receptor.maps.fld) is a "field" file that acts as a table of contents, listing all the grid map files that autogrid generated. The error indicates autodock-gpu is looking at this file (or the information that should be in it) and can't find a map for the 'W' atom type.
...no derived type (--derivtype, -T) either: This is a hint from the program. It's saying, "I don't know what 'W' is, and you didn't give me a map for it. You also didn't tell me to treat 'W' as an alias for another atom type I do know (like 'OA' for oxygen)." This is not the solution you want, because you specifically want to use the special water map.
The Cause
The issue is almost always a mismatch between the grid generation step (autogrid) and the docking step (autodock-gpu).
- Grid Generation (
autogrid): You correctly created the receptor.W.map file.
- Docking (
autodock-gpu): You failed to tell autodock-gpu to use this receptor.W.map file during the docking simulation.
autodock-gpu gets its map information from the --ffile argument, which points to your .maps.fld file. The problem is either that the .fld file doesn't list the W.map or, more likely, you are not using the --ffile argument correctly in your autodock-gpu command.
Step-by-Step Solution
Follow these steps to ensure everything is set up correctly.
Step 1: Verify Your Grid Parameter File (.gpf)
Your .gpf file, used by autogrid, must include the line to generate the water map. It should look something like this:
receptor.gpf
npts 60 60 60 # num. grid points in xyz
gridfld receptor.maps.fld # grid_data_file
spacing 0.375 # grid spacing (A)
receptor_types A C HD N OA S W # atom types in the receptor + W for water
receptor receptor.pdbqt # macromolecule
gridcenter 15.0 20.0 25.0 # xyz-coordinates or "auto"
smooth 0.5 # store minimum energy w/in smooth
map receptor.A.map # atom-specific affinity map
map receptor.C.map # atom-specific affinity map
map receptor.HD.map # atom-specific affinity map
map receptor.N.map # atom-specific affinity map
map receptor.OA.map # atom-specific affinity map
map receptor.S.map # atom-specific affinity map
map receptor.W.map # <--- THIS LINE IS CRUCIAL
elecmap receptor.e.map # electrostatic potential map
dsolvmap receptor.d.map # desolvation potential map
dielectric -0.1465 # <optional>
Step 2: Run mapwater.py and autogrid
-
First, run mapwater.py to get the desolvation energy penalties for the water map. This script modifies your receptor PDBQT file.
pythonsh mapwater.py -r receptor.pdbqt -x 6
# This creates receptor_hydrated.pdbqt. Use THIS file in the GPF.
Correction: A common workflow is to add a 'W' atom type to the receptor PDBQT at water positions. The mapwater.py script is more about preparing the parameters for AutoGrid to properly calculate the W map. Ensure your GPF's receptor line points to the correct PDBQT file that autogrid should use.
-
Now, run autogrid using the .gpf file.
autogrid4 -p receptor.gpf -l receptor.gpf.log
Step 3: Verify the Output Files
After autogrid finishes, check your directory. You must have all the map files, including the water map, and the .fld file.
ls
You should see:
receptor.A.map
receptor.C.map
receptor.HD.map
- ...and so on for all types...
receptor.W.map <-- The important one
receptor.d.map
receptor.e.map
receptor.maps.fld <-- The "table of contents" file
Now, inspect the receptor.maps.fld file. It should contain a line for receptor.W.map.
# AUTODOCK Atomic Affinity and Electrostatic Grids
#
# Created by autogrid4...
#
GRID_PARAMETER_FILE receptor.gpf
GRID_DATA_FILE receptor.maps.fld
MACROMOLECULE receptor.pdbqt
GRID_CENTER 15.000 20.000 25.000
GRID_NELEM 60 60 60
GRID_SPACING 0.375
GRID_PARAMETER_FILE receptor.A.map
GRID_PARAMETER_FILE receptor.C.map
GRID_PARAMETER_FILE receptor.HD.map
GRID_PARAMETER_FILE receptor.N.map
GRID_PARAMETER_FILE receptor.OA.map
GRID_PARAMETER_FILE receptor.S.map
GRID_PARAMETER_FILE receptor.W.map # <--- VERIFY THIS LINE EXISTS
GRID_PARAMETER_FILE receptor.e.map
GRID_PARAMETER_FILE receptor.d.map
Step 4: Correct Your autodock-gpu Command (The Fix)
This is the most likely source of your error. Your autodock-gpu command must point to the .fld file using the --ffile argument. This single file tells autodock-gpu about all the other .map files it needs.
Correct Command:
# For a 128wi workgroup size version
autodock_gpu_128wi --ffile receptor.maps.fld --lfile ligand.pdbqt --nrun 100 --resnam results.dlg
# For a 256wi workgroup size version
autodock_gpu_256wi --ffile receptor.maps.fld --lfile ligand.pdbqt --nrun 100 --resnam results.dlg
Incorrect Command (What you might be doing):
If you are trying to list maps individually or omitting the --ffile flag, autodock-gpu will not know about the W map.
Summary: The Complete Workflow
- Prepare Receptor: Identify crystallographic water molecules you want to treat explicitly. Change their
resname to WAT and atom name to W.
- Prepare GPF: Create
receptor.gpf. Add W to the receptor_types line and add map receptor.W.map to the list of maps.
- Run AutoGrid: Execute
autogrid4 -p receptor.gpf -l receptor.gpf.log.
- Verify Files: Check that
receptor.W.map and receptor.maps.fld were created and that the .fld file lists the W.map.
- Run AutoDock GPU: Execute
autodock_gpu_... using the --ffile receptor.maps.fld argument to link the docking calculation to your generated maps.