The other day I got annoyed always having to type "and not (name c,n,ca)" when I want to see sidechains without the mainchain. The attached script takes care of this.

run sidechain.py
sidechain resi 34
(instead of "show sticks, resi 34 and not (name c,n,ca)")


Andreas



Andrea Spitaleri wrote:
1) I superimposed two protein structures. They are similar but have
different numbering of residues, e.g residue 34 in structure A is equivalent
to residue 38 in structure B. I want to show only the side chain of residue
34 for structure A and residue 38 for structure B. I selected only structure
A, and type the command: show sticks, resi 34; and select only structure B
and: show sticks, resi 38. But the residue 34 in structure B and residue 38
in structure A were also shown. Could anyone teach me how to show residue 34
in structure A and 38 in structure B only?

select 34A, resi 34 and structureA
select 38B, resi 38 and structureB
then show sticks 34A and show sticks 38B


2) Related to the same molecules. I want to show sticks for the R-group of
residue 34 only. I typed the command: show sticks, resi 34. But the backbone
atoms were shown also. Could anyone teach me how to show sticks for the
R-group only??

select 34AR, resi 34 and structure and not (name c,n,ca)
show sticks, 34AR

ciao

andrea
Thanks in advance!!!!


Phoebe
from pymol import cmd

def sidechain(selection=''):
   '''
DESCRIPTION
   sidechain draws a stick representation for the given selection
   but only for sidechain atoms.  Mainchain atoms remain invisible.
   This is useful for show sidechains on top of cartoon representations.

USAGE
   sidechain selection

EXAMPLE
   sidechain /model//B/73
   sidechain c;A & r;lys
   '''

   if selection == '':
      print 'no selection defined\n'
      print 'try: \'sidechain selection\''
      return -1
      # abort if no selection given

   print "Your selection is %s" % selection
   cmd.show("sticks", "%s and not (n;C,O,N and not pro/n)" % selection)

cmd.extend('sidechain',sidechain)

Reply via email to