From: Axel Kohlmeyer (
Date: Tue Jan 21 2014 - 15:55:02 CST

On Tue, Jan 21, 2014 at 4:01 PM, Steven Neumann <> wrote:
> Dear Users,
> Would you please recommend any script which once read the pdb file will save
> e.g. every 6th atom in a separate file? using atomselect serial 1 to 6 or
> serial 12 to 18 etc. is not helps as I have over 400 K atoms :(

your example does not select every 6th atom, but groups of 6 atoms.
every 6th atom should be accessible using the modulus operator eg.
using: index % 6 == 0

if you need something more complex, what about programming a loop? you
can also write a loop to build the atom selection by extending a
string to contain the final selection and then generate the
atomselection from that string.


> Please advise,
> Steven

Dr. Axel Kohlmeyer
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.