Re: FEP on an amino acid ligand

From: JC Gumbart (gumbart_at_ks.uiuc.edu)
Date: Wed Jan 23 2013 - 18:10:00 CST

While I can't envision when someone would want to do this, the code has the flexibility as it is now to mutate different resnames in different segments. If you set the hybrid resname only once, you lose this ability.

In your case, it's getting caught on a segment that doesn't possess the residue of interest (probably too short). This is why I usually use the (optional) segment flag. However, the problem is that the hybrid resname is set BEFORE checking if the segment should be mutated or not. What's funny is that I had fixed this a couple years ago but apparently forgot to commit it to the VMD CVS.

Anyway, here's the new code that I'm committing now - please try it out if you like.

        foreach i [lsort -unique [$prot get segname]] {
            segment $i {
                pdb mtemp-$i.pdb
                if {$npatches > 0} { first none }
                set alpha [atomselect top "segname $i and resid $resid and alpha"]
                if { [info exists cmdline(-ressegname)] } {
                    #puts "\n Mutator DEBUG: $i $ressegname"
                    if { $i == $ressegname } {
                        if { [$alpha num] == 0 } {
                           error "Mutator: no resid $resid of segment $i - are you sure you wanted to mutate this segment?"
                        }
                        set oldres [$alpha get resname]
                        set hyb [format "%s2%s" $aa($oldres) $aa([string toupper $mut])]
                        puts "\n Mutator: Residue $oldres $resid of segment $ressegname is now $hyb"
                        mutate $resid $hyb
                    }
                } else {
                    if { [$alpha num] > 0 } {
                        set oldres [$alpha get resname]
                        set hyb [format "%s2%s" $aa($oldres) $aa([string toupper $mut])]
                        puts "\n Mutator: Residue $oldres $resid of segment $i is now $hyb"
                        mutate $resid $hyb
                    } else {
                        error "Mutator: no resid $resid of segment $i - are you sure you wanted to mutate this segment?"
                    }
                }
                $alpha delete
                if {$npatches > 0} { last none }
            }
        }

On Jan 23, 2013, at 6:18 PM, Gordon Wells wrote:

> I get this when trying to mutate a protein and produce the fep files. I tried this for different proteins and different builds of vmd (on mac and linux).
>
> PS, forgot to mention that changes I posted are for the file mutator.tcl in the $VMDDIR/plugins/LINUXAMD64/tcl/mutator1.4 directory
>
> The script seems to iterate over each protein segment but this means it tries to generate the hybrid amino acid code each time. I put the condition in to stop this.
>
>
>
> -- max(∫(εὐδαιμονία)dt)
>
> Dr Gordon Wells
> Chemistry Department
> Emory University
> Atlanta, Georgia, USA
>
>
> On 23 January 2013 17:45, JC Gumbart <gumbart_at_ks.uiuc.edu> wrote:
> Can you explain what you do to generate the error in the first place?
>
> On Jan 23, 2013, at 3:44 PM, Gordon Wells wrote:
>
>> (apologies, forgot to post to the list)
>>
>> I've been having similar problems with the mutator plugin, it crashes when trying to generate FEP input files. This is the error:
>>
>> can't read "aa()": no such element in array
>> ERROR: failed while building segment
>> MOLECULE DESTROYED BY FATAL ERROR! Use resetpsf to start over.
>>
>>
>> this seems to fix it, "diff before after":
>> < set hyb [format "%s2%s" $aa($oldres) $aa([string toupper $mut])]
>> < if { [info exists cmdline(-ressegname)] } {
>> < #puts "\n Mutator DEBUG: $i $ressegname"
>> < if { $i == $ressegname } {
>> < puts "\n Mutator: Residue $oldres $resid of segment $ressegname is now $hyb"
>> < mutate $resid $hyb
>> < }
>> < } else {
>> < puts "\n Mutator: Residue $oldres $resid of segment $i is now $hyb"
>> < mutate $resid $hyb
>> < }
>> ---
>> > puts $oldres
>> > puts $mut
>> > if {[$alpha num] == 1} {
>> > set hyb [format "%s2%s" $aa($oldres) $aa([string toupper $mut])]
>> >
>> > if { [info exists cmdline(-ressegname)] } {
>> > #puts "\n Mutator DEBUG: $i $ressegname"
>> > if { $i == $ressegname } {
>> > puts "\n Mutator: Residue $oldres $resid of segment $ressegname is now $hyb"
>> > mutate $resid $hyb
>> > }
>> > } else {
>> > puts "\n Mutator: Residue $oldres $resid of segment $i is now $hyb"
>> > mutate $resid $hyb
>> > }
>> >
>> > }
>> >
>>
>>
>>
>> -- max(∫(εὐδαιμονία)dt)
>>
>> Dr Gordon Wells
>> Chemistry Department
>> Emory University
>> Atlanta, Georgia, USA
>>
>>
>> On 23 January 2013 12:29, JC Gumbart <gumbart_at_ks.uiuc.edu> wrote:
>> No idea.
>>
>> If the mutator plugin breaks, it should be fixed. Send me off-list the files (if they aren't too big) and an exact description of what you tried that crashed it.
>>
>>
>> On Jan 23, 2013, at 12:21 PM, Thomas Albers wrote:
>>
>> > Hello!
>> >
>> > On Wed, Jan 23, 2013 at 12:16 PM, JC Gumbart <gumbart_at_ks.uiuc.edu> wrote:
>> >> I have no idea what you're trying to do here, but it looks very non-standard. Try using the Mutator plugin in VMD on your original structure (with the FEP box checked) to produce the files you need.
>> >
>> > But it works. :-) The Mutator plugin actually has its own problems,
>> > when I was using it to mutate the glycine molecule that sits in the
>> > binding pocket the plugin always crashed.
>> >
>> > Anyway, I downloaded the NAMD-2.9-Linux-x86_64-ibverbs binary, and
>> > that one works fine on our cluster. The one that we compiled
>> > ourselves does not. Would you have any hunch what went wrong during
>> > compilation.
>> >
>> > Regards,
>> > Thomas
>>
>>
>>
>
>

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:22:55 CST