Originally Posted By: Antoniel Gomes
Thanks a lot for telling me about the .subset. command. Now I can iterate the cysteine residues only. It makes the loop faster.

New code bellow:

Code:
set count = 0

define CYSTEINES sele resname CYS .and. type SG end

label cysloop
incr count by 1

coor mind sele CYSTEINES .subset. @count end sele CYSTEINES end

if ?mind .lt. 2.5 then
define CYS1 sele bynu ?minda1 end
set CYS1 = ?selsegi ?selresi
define CYS2 sele bynu ?minda2 end
set CYS2 = ?selsegi ?selresi
patch disu @CYS1 @CYS2 setup warn
endif

define CYSTEINES sele resname CYS .and. type SG end

if count .lt. ?nsel goto cysloop


Unfortunately (it's not that bad), you must to define CYSTEINES group in every loop because the PSF changes due the atoms deletion.

Thank you all.

Last edited by Antoniel Gomes; 07/29/19 06:11 PM.

Antoniel A. S. Gomes