AW: tclBC incorrect output

From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Thu May 03 2012 - 00:55:58 CDT

Hi,

is there a special reason why you are using your own atomID ?? Remember that
not all lines of an pdb are atoms, but you inc every iteration of the
foreach loop. As the getcoord command uses the real atomids and yours are
wrong, your coordinates put are for different atoms. SOLUTION: Just read the
atomnumber from the second column of the pdb, easy to add to your script,
and forget the counter thing here. (Look to the <-- comments in the code)

Good luck.

PS: Please add tabs to the code next time. It's hard to read like this.

Norman Geist.

> -----Ursprüngliche Nachricht-----
> Von: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] Im
> Auftrag von P.-L. Chau
> Gesendet: Donnerstag, 3. Mai 2012 05:18
> An: namd-l_at_ks.uiuc.edu
> Betreff: namd-l: tclBC incorrect output
>
> I have adapted a TclBC script from the examples in the user-defined
> forces
> tutorial. I find that the coordinates output by the script are
> incorrect,
> and a search of the tutorial does not help me to understand why. Could
> I
> ask for some help, please?
>
> The tclBC script I have is as follows:
>
> #!/usr/bin/tcl
> set pdbSource nachr_popcwi_open.pdb
> set aalist {} ;# a list of atom IDs of the 5 key amino acids
> # chain A: Leu250
> # chain B: Leu256
> # chain C: Leu264
> # chain D: Leu250
> # chain E: Leu259
> set atomID 1 <-- remove this
> set inStream [open $pdbSource r]
> foreach line [split [read $inStream] \n] {
> set string1 [string range $line 13 14] <-- add another line here for
atomID
> set string2 [string range $line 17 19]
> set string2 [string trim $string2]
> set string3 [string range $line 21 21]
> set string4 [string range $line 23 25]
> if { [string equal $string2 "LEU"] } \
> {
> if { [string equal $string3 "A"] && [string equal $string4
"250"] || \
> [string equal $string3 "B"] && [string equal
$string4 "256"] || \
> [string equal $string3 "C"] && [string equal $string4 "264"]
|| \
> [string equal $string3 "D"] && [string equal $string4 "250"]
|| \
> [string equal $string3 "E"] && [string equal $string4 "259"]
} \
> {
> if { [string equal $string1 "CA"] } {
> puts "$string2 $string3 $string4 $string1"
> lappend aalist $atomID
> }
> }
> }
> incr atomID <-- remove
> }
> close $inStream
> puts $aalist
> #####################################################################
> wrapmode cell
> proc calcforces {step unique Rrate Rtarget K} {
> global aalist
> while {[nextatom]} {
> set atomid [getid]
> if { [lsearch $aalist $atomid] >= 0 } {
> set rvec [getcoord]
> puts $rvec
> foreach { x y z } $rvec {break}
> puts "$x $y $z"
> }
> }
> }
>
> and I have included the following in the NAMD conf file:
>
> tclBC on
> tclBCScript {
> set tclBCScript opentest4.tcl
> set pdbSource nachr_popcwi_open.pdb
> source $tclBCScript
> }
> tclBCArgs {15. 0.01 5.}
>
> to drive the tclBC files. Examining the files manually, I know that the
> first atom to be picked out should be the LEU A250 CA, which has its
> coordinates as (-7.644,8.145,-4.409) but on execution by NAMD 2.8b2 the
> ouptut is:
>
> [...]
> LEU A 250 CA
> LEU B 256 CA
> LEU C 264 CA
> LEU D 250 CA
> LEU E 259 CA
> 71170 77036 83081 89113 95134
> Info: Startup phase 8 took 1.28413 s, 271.677 MB of memory in use
> Info: Startup phase 9 took 0.000862837 s, 345.993 MB of memory in use
> Info: Finished startup at 4.43505 s, 345.993 MB of memory in use
>
> TCL: Running for 1 steps
> 1.4202225083 -10.3271917571 -3.90947041257
> [...]
>
> The coordinates are clearly incorrect. I have tried "wrapmode input"
> but
> that does not change the output.
>
> Could I ask for some advice on where I go wrong, please? Thank you very
> much indeed.
>
> P-L Chau
>
> email: pc104_at_pasteur.fr
> Bioinformatique Structurale
> CNRS URA 2185
> Institut Pasteur
> 75724 Paris
> France
> tel: +33 1 45688546
> fax: +33 1 45688719

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:21:56 CST