load=1rh6
select protein
cpk 100
select dna
cartoon
set echo top center
color echo red
zoom out
pause

define phospate_P (*.P and dna)
define phospate_O (*.OP1,*.OP2 and dna)
define ribose_O ((*.O4',*.O3',*.O5') and dna)
define ribose_C(*.C?' and dna)
define big_groove_polar([DG]:*.O6, [DG]:*.N7, [DC]:*.N4, [DT]:*.O4, [DA]:*.N7, [DA]:*.N6)
define big_groove_nonpolar([DA]:*.C5, [DA]:*.C5, [DG]:*.C6, [DG]:*.C5, [DG]:*.C8, [DC]:*.C6, [DC]:*.C5, [DC]:*.C4, [DT]:*.C6, [DT]:*.C5, [DT]:*.C4, [DG]:*.C5M) 
define small_groove_polar( [DG]:*.N2, [DG]:*.N3, [DG]:*.N9, [DA]:*.N3, [DA]:*.N9, [DC]:*.N1, [DC]:*.O2, [DT]:*.O2, [DT]:*.N1)
define small_groove_nonpolar([DG]:*.C2,  [DG]:*.C4, [DA]:*.C2, [DA]:*.C4, [DC]:*.C2, [DT]:*.C2, [DT]:*.C6)       

define protein_polar ((oxygen, nitrogen) and protein)
define protein_nonpolar (not oxygen and not nitrogen and protein)

select phospate_P
cartoon off
cpk 300
restrict (within (4.5,phospate_P) and protein_nonpolar,phospate_P)
echo Nonpolar contacts of P in Phosphatic group with nonpolar protein atoms (17)
pause

restrict none 
select phospate_O
cartoon off
cpk 300
select  (within(3.5, phospate_O) and protein_polar)
cpk 100
center
echo Polar contacts of O in Phosphatic group with polar protein atoms (11)
pause

restrict none 
select  within(3.5, ribose_O) and protein_polar
cpk 0.5
select ribose_O
cpk
color red
center
echo Polar contacts of sugar-oxygens with polar protein atoms (4)
pause

restrict none 
select  within(3.5, big_groove_polar) and protein_polar
cpk 0.5
select big_groove_polar
cpk
center
echo Polar contacts of atoms of a large groove (DNA) with polar protein atoms (3)
pause

restrict none 
select  within(3.5, small_groove_polar) and protein_polar
cpk 0.5
select small_groove_polar
cpk
center
echo Polar contacts of atoms of a small groove (DNA) with polar protein atoms (1)
pause

restrict none 
select  within(4.5, ribose_C) and protein_nonpolar
cpk 0.5
select ribose_C
cpk
center
echo Non-polar contacts of sugar-oxygens with non-polar protein atoms (22)
pause

restrict none 
select  within(4.5, big_groove_nonpolar) and protein_nonpolar
cpk 0.5
select big_groove_nonpolar
cpk
center
echo Non-polar contacts of atoms of a large groove (DNA) with non-polar protein atoms (3)
pause

restrict none 
select  within(4.5, small_groove_nonpolar) and protein_nonpolar
cpk 0.5
select small_groove_nonpolar
cpk
center
echo Non-polar contacts of atoms of a small groove (DNA) with non-polar protein atoms (0)
pause