Re: Atom selection in Tcl Force script with Amber partop file

From: Maxim Belkin (mbelkin_at_ks.uiuc.edu)
Date: Fri Aug 15 2014 - 16:48:12 CDT

Daniel,

VMD can help. You can load your pdb file into VMD and make two selections:

set sel1 [atomselect top "beta == 1"]
set sel2 [atomselect top "beta == 2"]

then write their serial numbers into text files like that:

set ch [open beta1.txt w]
puts $ch "[$sel1 get serial]"; # single line with serial numbers (1-based indicies)
close $ch

# and similar three lines for $sel2

Then, in your tcl script simply read these files

set ch [open beta1.txt r]
set atomindex1 [read $ch]
close $ch

# and, again, similar one for beta2.txt

At this point you have atomindex1 (and atomindex2) and can use addgroup, or anything you want.

Maxim

On Aug 15, 2014, at 12:25 PM, Daniel Torrente <xlb608_at_my.utsa.edu> wrote:

> Dear NAMD user,
>
> I am trying to calculate the PMF between two proteins by means of SMD simulations using amber ff. My problem is related with the selection of the pulling atoms in the Tcl script using the amber par-top file. Since the amber par-top file do not has segname information is there other way to define the pulled atoms in the Tcl script that is compatible with the amber par-top file?
>
> This question was asked a long time ago but is still without an answer.
> http://www.ks.uiuc.edu/Research/namd/mailing_list/namd-l.2005-2006/0196.html
>
> Thanks in advance,
>
> Daniel
>
> Here is the usual way to define the pulling atoms in SMD/Tclforce.
> ###################
> set targets1 {}
> set targets2 {}
> set inStream [open ionized_SMD2.pdb r]
> foreach line [split [read $inStream] "\n"] {
>
> set type [string trim [string range $line 0 5]]
> set name [string trim [string range $line 12 15]]
> set resid [string trim [string range $line 22 25]]
> set beta [string trim [string range $line 60 65]]
> set segname [string trim [string range $line 72 75]]
>
>
> if { $beta == 1.00 } {
> lappend targets1 "$segname $resid $name"
> }
> if { $beta == 2.00 } {
> lappend targets2 "$segname $resid $name"
> }
> }
> close $inStream
>
> set atoms1 {}
> foreach target1 $targets1 {
> foreach {segname resid atom} $target1 { break }
>
> set atomindex1 [atomid $segname $resid $atom]
> lappend atoms1 $atomindex1
> }
>
> set atoms2 {}
> foreach target2 $targets2 {
> foreach {segname resid atom} $target2 { break }
>
> set atomindex2 [atomid $segname $resid $atom]
> lappend atoms2 $atomindex2
> }
> set a1 [addgroup $atoms1]
> set a2 [addgroup $atoms2]
> ########################

This archive was generated by hypermail 2.1.6 : Wed Dec 31 2014 - 23:22:43 CST