VMD-L Mailing List
From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Tue Feb 19 2002 - 10:47:58 CST
- Next message: John Stone: "VMD CVS and build procedure changes..."
- Previous message: Fei Xu: "python script of atomsel expression"
- In reply to: Fei Xu: "python script of atomsel expression"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
The way to do it will necessarily depend on how the molecule is set up. Say
the 5' and 3' segments of the DNA are labeled chain A and chain B, and you want
the 24th base pair. You could probably select it with something like the
following:
bp24=AtomSel('resid 24 or (chain B and same residue as (within 2 of resid 24))')
The other thing you could try is to rename the resid of chain B so that it
matches up with chain A. For example, if you had 50 bp in the DNA, numbered
1-50 in chain A and 51-100 in chain B, something like the following should
work:
chainB=AtomSel('chainB')
Bres=chainB.get('resid')
newBres=map(lambda x: 101-x, Bres)
chainB.set('resid',newBres)
This maps the resid of each atom in chain B from r to 101-r. After these
operations, selecting any resid should give you both members of the base pair.
Be sure to save your pdb file after doing this!
Justin
vmd_at_ks.uiuc.edu
On Tue, Feb 19, 2002 at 10:42:25AM -0500, Fei Xu wrote:
> I am trying to write a python script, which can select base pairs in DNA
> and then give them different colors according to some parameter values.
>
> But I don't know how to select base pairs in the specific chain of a DNA,
> as a DNA molecules always contains two or more chains in PDB bank.
> That's to say, if I JUST know a base pair that is No.24 in chain,
> what should I write in python script to select it and give it some color.
>
> And does python in VMD provide as extensive scripting components as Tcl
> does?
>
> I am looking for the reply.
-- Justin Gullingsrud 3111 Beckman Institute H: (217) 384-4220 I got a million ideas that I ain't even rocked yet... W: (217) 244-8946 -- Mike D
- Next message: John Stone: "VMD CVS and build procedure changes..."
- Previous message: Fei Xu: "python script of atomsel expression"
- In reply to: Fei Xu: "python script of atomsel expression"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]