! numtrees.cns ! Define the number of trees for torsion angle MD ! ! *********************************************************************** ! * Copyright 2003-2022 Alexandre Bonvin, Utrecht University. * ! * Originally adapted from Aria 1.2 from Nilges and Linge, EMBL. * ! * All rights reserved. * ! * This code is part of the HADDOCK software and governed by its * ! * license. Please see the LICENSE file that should have been included * ! * as part of this package. * ! *********************************************************************** ! evaluate ($numtrees = 1) evaluate ($ncount = 0) evaluate ($break=$data.ncomponents) while ($ncount < $data.ncomponents) loop nsloop evaluate ($ncount = $ncount + 1) for $id1 in id ( name C and bondedto(name CA) and segid $prot_segid_$ncount) loop break show (resid) (id $id1) evaluate ($resid1=$result) evaluate ($resid2=encode(decode($resid1)+1)) show sum(1) (id $id1 and known) if ( $result ne 0 ) then identity (store1) ( name N and bondedto(name CA) and segid $prot_segid_$ncount and resid $resid2 ) show element (store1) (attribute store1 > 0) if ( $result ne 0) then evaluate ($id2=$result) show sum(1) (id $id2 and known) if ( $result ne 0 ) then pick bond (name c and segid $prot_segid_$ncount and resid $resid1) (name n and segid $prot_segid_$ncount and resid $resid2) geometry if ( $result > 2.5 ) then evaluate ($break=$break+1) end if else evaluate ($break=$break+1) end if end if end if end loop break for $id1 in id ( name BB ) loop bbbreak show (resid) (id $id1) evaluate ($resid1=$result) evaluate ($resid2=encode(decode($resid1)+1)) show sum(1) (id $id1 and known) if ( $result ne 0 ) then identity (store1) ( name BB and segid $prot_segid_$ncount and resid $resid2 ) show element (store1) (attribute store1 > 0) if ( $result ne 0) then evaluate ($id2=$result) show sum(1) (id $id2 and known) if ( $result ne 0 ) then pick bond (name BB and segid $prot_segid_$ncount and resid $resid1) (name BB and segid $prot_segid_$ncount and resid $resid2) geometry if ( $result > 8.0 ) then evaluate ($break=$break+1) end if else evaluate ($break=$break+1) end if end if end if end loop bbbreak end loop nsloop ! check for water molecules do (store1 = 0) (all) do (store1 = 1) ((resn WAT or resn HOH or resn TIP*) and name OH2) show sum (store1) ((resn WAT or resn HOH or resn TIP*)) evaluate ($numtrees = $numtrees + $break + $result) evaluate ($numtrees = $numtrees + 300)