restrict none
select all
wireframe 20
color white

define dribose (*.O?*,*.C?*) and dna
define phosphat (*.O?P,*.P) and dna
define base not(backbone) and dna and (*.N?,*.C?)
define polar_ oxygen,nitrogen
define unpolar carbon,sulphur,*.P

select dribose and polar_
cpk 200
color red
echo red - set of oxygens from deoxyribose
pause
cpk off

select phosphat and polar_
cpk 200
color yellow
echo yellow - set of oxygens from phosphates
pause
cpk off

select base and polar_ and not(oxygen)
cpk 200
color blue
echo blue - set of nitrogens from bases
pause
cpk off

define polar_contact polar_ and dna and within(3.5,polar_ and protein)
define unpolar_contact unpolar and dna and within(3.5,unpolar and protein)

select polar_contact and dribose
cpk 200
color green
echo Polar contacts with deoxyriboses
pause
cpk off

select polar_contact and phosphat
cpk 200
echo Polar contacts with phosphates
pause
cpk off

select polar_contact and base
cpk 200
echo Polar contacts with bases
pause
cpk off

select unpolar_contact and dribose
cpk 200
color green
echo Unpolar contacts with deoxyriboses
pause
cpk off

select unpolar_contact and phosphat
cpk 200
echo Unpolar contacts with phosphates
pause
cpk off

select unpolar_contact and base
cpk 200
echo Unpolar contacts with bases
pause
cpk off