restrict none 
select all

define polar_a oxygen or nitrogen
define unpolar_a carbon, *.P, sulphur



define polar_d (protein and polar_a) 
define unpolar_d (protein and unpolar_a) 



define dribosa (*:*.C?', *:*.O?') and dna

define phosphat (*:*.P, *:*.O?P) and dna

define base (*:*.N?, *:*.O2, *:*.O4, *:*.O6) and (purine, pyrimidine)




select dna
cpk off
wireframe 20







cpk off
select polar_d and within(3.5, dribosa)
cpk 100
color green
echo "2'-deoxyribose polar contacts"
pause



cpk off
select unpolar_d and within(4.5, dribosa)
cpk 100
color green
echo "2'-deoxyribose unpolar contacts"
pause



cpk off
select polar_d and within(3.5, phosphat)
cpk 100
color pink
echo "phosphate polar contacts is pink"
pause



cpk off
select unpolar_d and within(4.5, phosphat)
cpk 100
color purpur
echo "phosphate unpolar contacts is purpur"
pause



cpk off
select polar_d and within(3.5, base)
cpk 100
color white
echo "base polar contacts"
pause



cpk off
select unpolar_d and within(4.5, base)
cpk 100
color yellow
echo "base unpolar contacts"
pause