From: JC Gumbart (gumbart_at_ks.uiuc.edu)
Date: Fri Apr 25 2014 - 15:27:30 CDT

Why not use the Hbonds plugin instead?

On Apr 25, 2014, at 7:36 AM, Norman Geist <norman.geist_at_uni-greifswald.de> wrote:

> Try to expand the selection to measure the hbonds from to „all“ and see if you actually get any output then.
>
> Norman Geist.
>
> Von: HongTham [mailto:hongtham0709_at_gmail.com]
> Gesendet: Freitag, 25. April 2014 13:01
> An: Norman Geist
> Betreff: Re: vmd-l: measure Hbond and orient (with vec {0 0 1}) of a selected molecule
>
> hi Geist,
> I tried, deleted or replaced many time, step by step, command by command, but the result is still the same. I hope someone who have any experience in measuring hbond can help me or can give me some advice. Anyway, I will find another method to solve my problem. Thank you so much.
> HongTham
>
>
> On Fri, Apr 25, 2014 at 7:39 PM, Norman Geist <norman.geist_at_uni-greifswald.de> wrote:
> As nobody will want to read and follow you whole script, as there’s no obvious failure, you might want to find the problem yourself by checking the code and its output step by step, this is called debugging and will improve your skills.
>
> Norman Geist.
>
> Von: HongTham [mailto:hongtham0709_at_gmail.com]
> Gesendet: Freitag, 25. April 2014 12:27
>
> An: Norman Geist
> Betreff: Re: vmd-l: measure Hbond and orient (with vec {0 0 1}) of a selected molecule
>
> Yes. there are (1 at least)
> Hongtham
>
>
> On Fri, Apr 25, 2014 at 4:49 PM, Norman Geist <norman.geist_at_uni-greifswald.de> wrote:
> Are there any hbonds if you visualize them for the DCDs via the Hbonds drawing method under Representation?
>
> Norman Geist.
>
> Von: HongTham [mailto:hongtham0709_at_gmail.com]
> Gesendet: Freitag, 25. April 2014 08:56
> An: Norman Geist
> Betreff: Re: vmd-l: measure Hbond and orient (with vec {0 0 1}) of a selected molecule
>
> hi Geist,
> Thank you for your response.
> let me describe my problem clearly. May be you can give me some advices.
>
> Because Im trying to measure Hydrogen bond between 2 string (residue 180 to residue 210) of a same molecule. I have my all pdb file and open pdb file by using VMD.
>
> First of all, I tried by using Tl console in VMD extension/ Analysis. you can see the script and result below
>
> Main console display active (Tcl8.5.6 / Tk8.5.6)
>
> >Main< (psfgen) 3 % set sel [atomselect 0 {protein and chain A and resid 180 to 210 and name "N.*""O.*"}]
> atomselect1
> >Main< (psfgen) 5 % measure hbonds 30 3.4 $sel
> 3041 3211 3043
>
> 3041 3211 3043 is the result ( index of Donor index of Acceptor index of Hydro ) -> there is only 1 hydrogen bond in this current frame.
>
>
> however, when I try to using TCl scrip to measure Hbond thoughout all the simulation, file out (result) has nothing. That is really weird.
> You can check my soure script and my script.
> The script in VMD not only measure hbond but also seperate which is intra hbond, which is inter hbond. Howerver I just want to know is there any hydrogen bond or not, so I deleted and modified that script (I have display my script and my soure script in previous mail)
>
>
> below script is the inital script I downloaded from VMD script
>
> # count the number of inter- and intra helical H-bonds
>
> proc hbond {donor acceptor {cutoff 3.4} {angle 30.0}} {
> set idx [measure hbonds $cutoff $angle $donor $acceptor]
> set don [lindex $idx 0]
> set acc [lindex $idx 1]
>
> set inter 0
> set intra 0
> if {[llength $don] != 0} {
> foreach d $don a $acc {
> if {abs([expr $d-$a]) > 200} {
> incr inter
> } else {
> incr intra
> }
> }
> }
> return [list $inter $intra]
> }
>
>
>
> On Fri, Apr 25, 2014 at 3:13 PM, Norman Geist <norman.geist_at_uni-greifswald.de> wrote:
> Doesn’t „measure Hbonds“ also need the hydrogens, as the angle is measured D->A->H? Also I’m not sure if “N.*” works, why not simply use “nitrogen or oxygen or hydrogen”. The HBonds drawing method does work with only the heavy atoms selected, but maybe not so the measure command.
>
> Norman Geist.
>
> Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag von HongTham
> Gesendet: Freitag, 25. April 2014 02:52
> An: vmd-l_at_ks.uiuc.edu
> Betreff: vmd-l: measure Hbond and orient (with vec {0 0 1}) of a selected molecule
>
> Hi VMD users,
> I have some problem in calculating Hydrogen bond and orient that I cant resolve them. Thanks in advance for any advices
>
> 1. Measure Hbond:
> I made the Tcl script below. although in visual simulation there are some hbonds, and by TC console as well, the file out just display {} {} {}. I set cutoff 3.4 and angle 30.
>
> mol new ../proion.pdb
> animate delete all
> mol addfile ../pro12_16.dcd waitfor all
> mol addfile ../pro17_31.dcd waitfor all
> mol addfile ../pro32_46.dcd waitfor all
> mol addfile ../pro47_61.dcd waitfor all
> mol addfile ../pro62_76.dcd waitfor all
> mol addfile ../pro77_89.dcd waitfor all
> mol addfile ../pro90_99.dcd waitfor all
>
> source /home/hongtham/VMD/Nhbond.tcl
>
> set nf [molinfo 0 get numframes]
> set clist [list A C D]
>
> foreach ch $clist {
> set fout [open "hbond$ch.dat" w]
> set sel [atomselect 0 {protein and chain $ch and resid 180 to 200 and name "N.*" "O.*"}]
>
> #calculation
> for { set i 0 } { $i < $nf } { incr i } {
> $sel frame $i
>
> puts $fout "[expr ($i*0.01)+20.1] [Nhbond $sel]"
> }
> close $fout
> }
> ~
> the source script is below:
> # Count the number of H-bonds with one selection
>
> proc Nhbond {sel {cutoff 3.4} {angle 30}} {
> return [measure hbonds 3.4 30 $sel]
> }
>
>
>
> 2. measure orient
> with the same selected molecule. I made the script below, i try to find some explaination about the script but file out has nothing. Thank for any suggestion
>
> # analysis
> set clist [list A B C D E]
> set vec {0 0 1}
> #set clist [list A ]
> # set fout [open "ori$ch.dat" w]
>
> foreach ch $clist {
> set fout [open "ori$ch.dat" w]
> set sel [atomselect 0 "protein and chain $ch and name CA"]
> set fout [open "ori$ch.dat" w]
>
> # distance calculaton
> for { set i 0 } { $i < $nf } { incr i } {
> $sel frame $i
>
> set ori [orient $sel $vec]
> puts $fout "$ori"
> }
> close $fout
>
> and the source script is:
> proc orient { sel {vec {0 0 1} }} {
> set all [atomselect [$sel molid] "all"]
> set vec [vecnorm $vec]
>
> set vec1 [lindex [measure inertia $sel] 1 2]
> set vec2 [vecnorm [veccross $vec1 $vec]]
> set ang [expr acos([vecdot $vec1 $vec])]
> $all move [trans center [measure center $sel] axis $vec2 $ang rad]
> }
>
> Thank you so much.
> Hong Tham
>
> Biomedical engineering department
> Pukyong National University
> Pusan, South Korea
> email: hongtham0709_at_gmail.com
>
>
>
>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
>
>
>
>
>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
>
>
>
>
>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
>
>
>
>
>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
>