The script is included at the bottom of this message.
This script reads in a docking results file (either a MolSoft hitlist or an SDF file with hits), minimizes each ligand in parallel, and writes a new SDF file containing the minimized ligands and updated scores. Two extra columns are added to the output SDF file:
Score_min – the re-calculated ICM Score after minimization
RTCNN_min – the re-calculated RTCNN Score after minimization
Originally, the script only accepted MolSoft “hitlist” tables. It has now been updated so that you can pass an SDF file of hits directly without having to convert it to a hitlist first.
Save the script (e.g. hitlistminimize2.icm) somewhere on your system.
Open a terminal and change into the directory containing your docking project and the SDF file or hitlist.
Run the command below, replacing the placeholders with your own values:
proj=<dock_proj_name> – the name of your docking project folder.
nproc=<num_parallel> – how many CPU cores to use.
answers=<hits.sdf> – your results file (e.g. molcart_results.sdf).
If you already have a MolSoft hitlist table instead of an SDF file, you can omit the answers= argument and it will default to your project’s answers file.
The script produces a new SDF file in the same directory. Each ligand is minimized and rescored, and the resulting file contains both the structures and the new scores.
#Script
l_commands = no
call _macro
call _docking
call _vls
s_proj = Getarg("proj","mydock10")
s_ans = Getarg("answers",s_proj + "_answers*.ob")
i_nfork = Getarg("nproc",1)
dockUpdateGlobals s_proj -1
currentDockProj.data[8] = "yes"
s_grid4DFlex = ""
s_hitlist = "t"
icSdf = no
if (Extension( s_ans ) == ".sdf") then
read table mol s_ans name="t"
icSdf = yes
else
scanMakeHitList s_proj s_ans s_hitlist no no yes 0 yes ""
endif
add column t Rarray(Nof(t)) name="Score_min"
add column t Rarray(Nof(t)) name="RTCNN_min"
s_recName = Name(s_proj) + "_rec"
dockCheckObj s_recName ""
rename a_ "RECEPTOR"
for i=1,Nof(t) fork i_nfork t
if( Type( $s_hitlist.OBJECTS )!="unknown")then # self-containing hitlist
load object $s_hitlist.OBJECTS [i]
elseif (icSdf) then
read mol $s_hitlist.mol [i]
build hydrogen
set type mmff
convert auto
else
read object $s_hitlist.FILE [i] number= $s_hitlist.POS [i]
if(Type( $s_hitlist.CONF )!="unknown" & $s_hitlist.CONF [i] != 0)then
if(Nof( a_ stack) >0) load conf a_ $s_hitlist.CONF [i]
if(Nof( a_ stack)==0) read conf $s_hitlist.CONF [i] Replace( $s_hitlist.FILE [i] ".ob" "") +"_"+ $s_hitlist.IX [i] +".cnf"
endif
endif
nRecMol = Nof( a_RECEPTOR.* )
move a_ a_RECEPTOR.
set object a_RECEPTOR.
ms_lig = a_RECEPTOR.!1:$nRecMol
#
minimize cartesian ms_lig 1000
scanScoreExternal a_RECEPTOR.1:$nRecMol ms_lig yes # calculate score and RTCNN score of minimized ligand
t.Score_min[i] = Field( ms_lig "Score" )[1]
t.RTCNN_min[i] = Field( ms_lig "RTCNN" )[1]
t.mol[i] = Chemical( ms_lig exact hydrogen )
#
delete a_RECEPTOR.!1:$nRecMol
endfor
write table mol t delete Name( s_ans simple ) + "_min_score.sdf"
quit