zap
load 1H9T_old.pdb 
define npol (*.C??, *.S??, *.P??)
define pol (*.N??, *.O??)
define drib (*.C1*, *.C2*,*.C3*,*.C4*,*.C5*,*.O3*,*.O4*,*.O5*) and dna
define majg (c.n4,a.n6,t.o4,g.o6,g.n7,a.n7,t.c5,c.c5,g.c8,a.c8,t.c6,c.c6,g.c5,a.c5,t.c5M) and dna
define ming  (c.o2,t.o2,g.n3,g.n2,a.n3,a.c2) and dna
define pr_pol (pol and protein)
define pr_npol (npol and protein)
define drib_pol (pol and drib)
define drip_npol (npol and drib)
echo Polar atoms (O and N) in entire stricture = pol
echo Non-polar atoms (C, P and S) in entire structure = npol
echo Polar atoms in protein = pr_pol
echo Non-polar atoms in protein = pr_npol
echo Atoms in deoxyribose = drib
echo Atoms facing major groove = majg
echo Atoms facing minor groove = ming
echo " "
define ph_pol ((*.O1P or *.O2P) and dna)
define ph_npol (*.P and dna)
echo Polar atoms in phosphoric acid = ph_pol
echo Non-polar atoms in phosphoric acid = ph_npol
echo " "
define drib_pol (drib and pol) 
define drib_npol (drib and npol)
echo Polar atoms in deoxyribose = drib_pol
echo Non-polar atoms in deoxyribose = drib_pol
echo " "
define majg_pol (majg and pol)
define ming_pol (ming and pol)
echo Polar atoms facing major groove = majg_pol
echo Polar atoms facing minor groove = ming_pol
echo " "
define majg_npol (majg and npol)                 
define ming_npol (ming and npol)                 
echo Non-polar atoms facing major groove = majg_npol
echo Non-polar atoms facing minor groove = ming_npol