VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Feb 10 2006 - 13:26:44 CST
- Next message: John Stone: "Re: VTK with VMD"
- Previous message: ziemys_at_ecr6.ohio-state.edu: "AtomSel with object index (Python scripting)"
- In reply to: ziemys_at_ecr6.ohio-state.edu: "AtomSel with object index (Python scripting)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
You could create an atom selection string from the list of serial numbers
you're interested in, and then use that string in the AtomSel() routine.
The issue is you need to generate the selection text string from your list
before feeding it into AtomSel(). I don't have a Python example of this
handy, but in Tcl you'd just do something like:
set a { 60 2 3 5 }
set seltext [format "serial %s" $a]
set sel [atomselect top $seltext]
$sel list
1 2 4 59
$sel get serial
2 3 5 60
John Stone
vmd_at_ks.uiuc.edu
On Fri, Feb 10, 2006 at 07:04:07PM +0000, ziemys_at_ecr6.ohio-state.edu wrote:
> HI !
>
> I got a list object, which contains records with atom serial numbers and related amino acid inforation to the atoms, in my script.
>
> Is there any way to use 'AtomSel' in scripts to make appropriate selection from may particular atoms from the list.
>
> Say we have list atom serial numbers in a list A = [n1,n2,n3]. I want to get selection liek that :
> sel1 = AtomSel('searial -> A[index],...)
>
> I tryed various ways , but get errors. Is any clue to to this proeblem ?
>
> Arturas
>
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: John Stone: "Re: VTK with VMD"
- Previous message: ziemys_at_ecr6.ohio-state.edu: "AtomSel with object index (Python scripting)"
- In reply to: ziemys_at_ecr6.ohio-state.edu: "AtomSel with object index (Python scripting)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]