How do I create a ligand–receptor contact table in ICM and export it as a CSV file? What do the ligDiagInteraction2D arguments mean?

5 views
Skip to first unread message

Andrew Orry

unread,
Dec 27, 2025, 12:15:27 AM (13 days ago) 12/27/25
to MolSoft ICM Knowledge Base
Q.  How do I create a ligand–receptor contact table in ICM and export it as a CSV file? What do the ligDiagInteraction2D arguments mean?
A.
You can generate a ligand–receptor contact table in ICM using the ligDiagInteraction2D command and then export the resulting table as a CSV file. Below is a complete example script, followed by an explanation of the command arguments. The option is also available in the GUI if you right click on a ligand and choose  Toois -> Ligand 2D Diagram -> check the box for 'create table with Contacts'.

#########################
l_commands = no
call _macro

# Read receptor–ligand structure
read pdb "1xbb"

# Convert to ICM object and prepare (remove waters, add hydrogens, etc.)
convertObject a_ no yes yes no yes yes no "water=tight"

# Generate ligand–receptor interaction diagram and contact table
ligDiagInteraction2D a_H [1] a_ & !a_H [1] Chemical() 4.5 0.8 1 no yes

# Get table name and write it to CSV
s_tab = Name(table)[$]
write table separator="," header $s_tab s_tab + ".csv" delete

quit
#########################

This script identifies ligand–receptor contacts within a 4.5 Å cutoff, creates a contact table, and writes it to a CSV file for downstream analysis.

ligDiagInteraction2D arguments explained

The full argument list is:

ligDiagInteraction2D ms_lig os_rec (a_none.) P_chemTempl (Chemical()) \
                    r_hphobDist (4.5) r_hbStrength (0.8) i_labelStyle (1) \
                    l_assignSites (no) l_makeContactTable (no) auto

Key arguments:

  • ms_lig
    Ligand molecule selection.

  • os_rec
    Receptor selection. The ligand should be excluded from this selection.

  • P_chemTempl
    2D template for ligand drawing. Use Chemical() for automatic layout.

  • r_hphobDist
    Hydrophobic contact cutoff distance (Å).

  • r_hbStrength
    Hydrogen-bond strength threshold for displaying H-bonds.
    Values range from 0.0 to 2.0. Lower values (for example, 0.2 instead of 1.0) will show weaker hydrogen bonds.

  • i_labelStyle
    Label style in the 2D diagram, corresponding to the resLabelStyle preference.

  • l_assignSites
    Assign binding sites in 3D.

  • l_makeContactTable
    Create a separate ligand–receptor contact table. This must be set to yes if you want to export the contacts.

In practice, you only need to specify two selections (ligand and receptor) and set the last argument to yes to generate the contact table. All other parameters can usually be left at their default values.

Reply all
Reply to author
Forward
0 new messages