VMD-L Mailing List
From: Olaf Lenz (olenz_at_fias.uni-frankfurt.de)
Date: Fri Jul 27 2007 - 01:28:09 CDT
- Next message: Christian Wohlschlager: "Re: Antw: Re: CAVE & Vmd"
- Previous message: Arneh Babakhani: "Deleting bonds based on length"
- In reply to: Arneh Babakhani: "Deleting bonds based on length"
- Next in thread: Arneh Babakhani: "Re: Deleting bonds based on length"
- Reply: Arneh Babakhani: "Re: Deleting bonds based on length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
-----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-----
- Next message: Christian Wohlschlager: "Re: Antw: Re: CAVE & Vmd"
- Previous message: Arneh Babakhani: "Deleting bonds based on length"
- In reply to: Arneh Babakhani: "Deleting bonds based on length"
- Next in thread: Arneh Babakhani: "Re: Deleting bonds based on length"
- Reply: Arneh Babakhani: "Re: Deleting bonds based on length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]