From: Arneh Babakhani (ababakha_at_mccammon.ucsd.edu)
Date: Fri Jul 27 2007 - 07:58:41 CDT

Thanks Olaf! I'll give it a shot,

Arneh

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
> Hi Arneh!
>
> Arneh Babakhani wrote:
>> Is there such a thing as 'bondselect', analogous to atomselect (where
>> you can select bonds of a certain length, or orientation)????
>>
>> Or alternatively, how can I just cycle through all of bonds and delete
>> the ones that are greater than a certain threshold length?
>
> There is no such thing as bondselect. However, I have written a script
> that does simply delete bonds that are longer than a maximal length.
> Just call
>
> remove_long_bonds 3
>
> to remove all bonds that are longer than 3 in the top molecule.
>
> ##################################################
> ############## Remove long bonds #################
> ##################################################
> proc remove_long_bonds { max_length } {
> for { set i 0 } { $i < [ molinfo top get numatoms ] } { incr i } {
> set bead [ atomselect top "index $i" ]
> set bonds [ lindex [$bead getbonds] 0 ]
>
> if { [ llength bonds ] > 0 } {
> set bonds_new {}
> set xyz [ lindex [$bead get {x y z}] 0 ]
>
> foreach j $bonds {
> set bead_to [ atomselect top "index $j" ]
> set xyz_to [ lindex [$bead_to get {x y z}] 0 ]
> if { [ vecdist $xyz $xyz_to ] < $max_length } {
> lappend bonds_new $j
> }
> }
> $bead setbonds [ list $bonds_new ]
> }
> }
> }
>
> Cheers
> Olaf
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
>
> iD8DBQFGqZB5tQ3riQ3oo/oRAwzFAJ9QapiNmgx4NBXcndvAf/8jwvx02wCfTEOi
> Jp+BUuyZGEU+V+wKfcGmfYg=
> =NU/O
> -----END PGP SIGNATURE-----
>