Setting a group of atoms

Sorry. Here is the way to do it. I just tried it with in.lj script

variable grouplargeatoms
variable s file atomids.txt
group atoms id $s
group collect union atoms
next s
jump in.lj grouplargeatoms

After the loop the group collect will have all the atoms

Good luck

Arun Srikanth
Phd student
Drexel university

It seems that even without the line “group collect union atoms” it works.

Sorry. Here is the way to do it. I just tried it with in.lj script

variable grouplargeatoms
variable s file atomids.txt
group atoms id $s
group collect union atoms
next s
jump in.lj grouplargeatoms

After the loop the group collect will have all the atoms

​i don't think the union thing is necessary. group definitions are
incremental​, so the atoms group should already have all desired atoms.

also i tried the atomfile variant and it works fine, too (for in.lj you
also need to request an atom map).
the atom file format has the number of ID value pairs as the first line and
then reads the corresponding list of entries. all entries that are not set
are initialized to zero. zero means false and non-zero means true. so you
can have a file like this:

10
1 1
2 0
3 1
4 0
5 1
6 1
7 1
9 1
11 1
20 1

and then simply do:

variable ids atomfile atomfile.txt
group atoms variable ids

and the group will contain the 8 atoms that are set to 1.

axel.