### Draw and show inter-chain interface contacts
spectrum-atoms -by chain
construct-contacts
select-contacts [-inter-chain] -name iface
show-contacts [iface]
color-contacts [iface] -col yellow

### Draw and show inter-chain interface contacts plus some adjacent SAS
spectrum-atoms -by chain
construct-contacts
select-contacts [-inter-chain] -name iface
show-contacts [iface]
color-contacts [iface] -col yellow
select-atoms ([-sel-of-contacts iface] and [c<A>]) \
  -full-residues -name iface_atoms_A
select-atoms ([-sel-of-contacts iface] and [c<B>]) \
  -full-residues -name iface_atoms_B
unmark-atoms
show-atoms [iface_atoms_A] -rep sticks
show-atoms [iface_atoms_B] -rep sticks
color-atoms [iface_atoms_A] 0xFF7700 -rep sticks
color-atoms [iface_atoms_B] 0x0077FF -rep sticks
list-selections-of-contacts
list-selections-of-atoms
select-contacts [-a1 [iface_atoms_A] -solvent] \
  -name iface_atoms_A_sas
show-contacts [iface_atoms_A_sas]
color-contacts [iface_atoms_A_sas] -col 0x77FFFF

### Draw and show protein-ligand interface contacts
hide-atoms
show-atoms -rep sticks
color-atoms 0xAAAAAA
select-atoms [-t het] -name ligand
color-atoms [ligand] 0x0011BB
construct-contacts
select-contacts [-a1[ligand]] -name iface
show-contacts [iface]
color-contacts [iface] -col yellow
color-contacts ([iface] and [-solvent]) -col cyan
select-atoms ([-sel-of-contacts iface] and (not [ligand])) \
  -name prot_to_lig
color-atoms [prot_to_lig] -full-residues -col 0x00AA00
color-atoms [prot_to_lig] -col 0xFF2200
hide-atoms -rep sticks
show-atoms ([prot_to_lig] or [ligand]) \
  -full-residues -rep sticks
show-atoms -rep cartoon

### Calculate VoroMQA-light global and local scores
restrict-atoms [-t! het]
construct-contacts
voromqa-global
spectrum-atoms -adjunct voromqa_score_r \
  -scheme rwb -min-val 0.25 -max-val 0.75

### Calculate VoroMQA-dark global and local scores
restrict-atoms [-t! het]
construct-contacts
voromqa-global
voromqa-dark-global
set-adjunct-of-atoms-by-residue-pooling \
  -source-name vd1 -destination-name vd1s \
  -pooling-mode min -smoothing-window 0
spectrum-atoms -adjunct vd1s \
  -scheme rwb -min-val 0.45 -max-val 0.75

### Calculate VoroMQA surface frustration scores
#restrict-atoms [c<A>]
restrict-atoms [-t! het]
construct-contacts
voromqa-global
voromqa-frustration -adj-atom-frustration-energy-mean afem \
  -adj-contact-frustration-energy-mean cfem \
  -smoothing-iterations 1 -smoothing-depth 3
hide-atoms
show-atoms -rep balls
color-atoms 0x555555
spectrum-atoms -adjunct afem -scheme bwr -min-val -0.5 -max-val 0.5

### Calculate VoroMQA inter-chain interface frustration scores
restrict-atoms [-t! het]
construct-contacts
voromqa-global
voromqa-interface-frustration [-inter-chain] \
  -adj-contact-interface-frustration-energy-mean cifem \
  -smoothing-iterations 2
hide-contacts
spectrum-contacts [-inter-chain] -adjunct cifem -scheme bwr -min-val -2 -max-val 1
show-contacts [-inter-chain]

### Calculate geometric exposure values for surface atoms
restrict-atoms [-t! het]
construct-contacts
delete-adjuncts-of-atoms -adjuncts ev
describe-exposure -adj-atom-exposure-value ev \
  -probe-min 2.0 -probe-max 30 -expansion 1 \
  -smoothing-iterations 2 -smoothing-depth 1
hide-atoms
show-atoms
color-atoms 0x555555
spectrum-atoms -adjunct ev -scheme bwr # -min-val 0.1 -max-val 0.5

### Demo multiple representations
grid-by-object

import 4ung.pdb
spectrum-atoms -by chain -scheme co
hide-atoms
show-atoms -rep molsurf

import 4ung.pdb
spectrum-atoms -by chain -scheme co
hide-atoms
show-atoms -rep sticks
construct-contacts
select-contacts [-inter-chain] -name iface
color-contacts [iface] -col yellow
show-contacts [iface]
select-contacts [-solvent -a1 [-chain B]] -name sas_b
color-contacts [sas_b] -col orange
show-contacts [sas_b]

import 4ung.pdb
spectrum-atoms -by chain -scheme co
construct-contacts
select-contacts [-inter-chain] -name iface
color-contacts [iface] -rep edges -col black
spectrum-contacts [iface] -by residue-ids -scheme random
show-contacts [iface] -rep faces

import 4ung.pdb
spectrum-atoms -by chain -scheme co
color-atoms -col 0xBBBBBB
color-atoms [-chain A -rnum 16] -col cyan
color-atoms [-chain B -rnum 15] -col orange
show-atoms ([-chain A -rnum 16] or [-chain B -rnum 15]) -rep sticks
construct-contacts
select-contacts [-a1 [-chain A -rnum 16]] -name contacts_r1
select-contacts [-a1 [-chain B -rnum 15]] -name contacts_r2
color-contacts ([contacts_r1] or [contacts_r2])  -rep edges -col black
show-contacts ([contacts_r1] or [contacts_r2]) -rep edges
select-contacts [-inter-chain -a1 [-chain A -rnum 16] -a2 [-chain B -rnum 15]] -name iface
color-contacts [iface] -rep faces -col yellow
show-contacts [iface] -rep faces

