Re: [AMBER] closest command in cpptraj

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Tue, 8 Sep 2015 09:48:02 -0600

Hi,

This is because the topology commands currently can't operate on
COORDS data sets directly (I have plans to allow this in the future).
Under the hood, a COORDS data set creates a copy of the input topology
so that when e.g. the coordinates are stripped or something the
topology can be changed to match without changing the original
topology. So what happens with your input here:

// Load test.parm7
parm ../../test.parm7
// Load coordinates from test.nc with a copy of test.parm7 into closestA
loadcrd test.nc closestA
// Modify solvent definition in original test.parm7
solvent :A

What you need to do is have the 'solvent' command come *before* the
loadcrd command. Does that make sense? Let me know if not.

-Dan


On Mon, Sep 7, 2015 at 12:22 PM, Joseph Baker <bakerj.tcnj.edu> wrote:
> Hi Dan,
>
> I'm trying to go back to the loadcrd approach to streamline this a bit, but
> when I include the solvent :A and crdaction closestA closest 10 :1-4 lines,
> I get an error from cpptraj that
>
> Warning: Parm test.parm7 does not contain solvent.
>
> So it seems like the solvent :A command isn't compatible with a trajectory
> that is loaded using loadcrd? Script I am currently using is pasted below.
>
> parm ../../test.parm7
> loadcrd test.nc closestA
> solvent :A
> crdaction closestA strip :B outprefix noB
> crdaction closestA closest 10 :1-4
> crdaction closestA autoimage
> crdout closestA noB.nc
> run
>
> On Wed, Aug 26, 2015 at 10:49 AM Daniel Roe <daniel.r.roe.gmail.com> wrote:
>
>> Ok, I see the issue now - it's a small error on my part in the initial
>> input I gave you. By default, when you enter an Action in cpptraj it
>> goes into the Action list (or Action queue). Actions in the Action
>> list operate on frames from input trajectories. Coordinates data sets
>> are separate from this, which is why the 'crdaction' command exists.
>> These concepts are explained a bit more in the Amber 15 manual
>> sections 29.1.3/29.1.4 and 29.4.
>>
>> If you want to strip a coordinates dataset you would use crdaction
>> with strip, e.g.
>>
>> loadcrd test.nc 1 10 ClosestA
>> crdaction ClosestA strip :B
>>
>> will strip residues matching ':B' from the ClosestA coordinates set.
>> Does that make more sense now? Let me know if you have more questions.
>>
>> -Dan
>>
>> On Tue, Aug 25, 2015 at 8:21 PM, Joseph Baker <bakerj.tcnj.edu> wrote:
>> > Hi Dan,
>> >
>> > Sorry, no warnings or errors. Was just running up against the strip
>> > commands not seeming to influence things that had been read in using
>> > loadcrd. For example, the strip :1-4 didn't get rid of those solute
>> > residues. Also, if I tried to add a strip command after loadcrd like
>> below
>> > (in just a simple script)
>> >
>> > parm test.parm7
>> > solvent :A
>> > loadcrd test.nc 1 10 ClosestA
>> > strip :B
>> > crdaction ClosestA closest 10 :1-4
>> > crdout ClosestA Combined.pdb
>> >
>> > B does not get stripped from the resulting trajectory written by crdout.
>> So
>> > basically it was finding the closest A and B, but was not getting rid of
>> > all of the other A's and B's (which got kept as part of the solute).
>> >
>> > The cpptraj version is 15.00
>> >
>> > Joe
>> >
>> >
>> > --
>> > Joseph Baker, PhD
>> > Assistant Professor
>> > Department of Chemistry
>> > C101 Science Complex
>> > The College of New Jersey
>> > Ewing, NJ 08628
>> > Phone: (609) 771-3173
>> > Web: http://bakerj.pages.tcnj.edu/
>> > <https://sites.google.com/site/bakercompchemlab/>
>> >
>> > On Tue, Aug 25, 2015 at 9:23 AM, Daniel Roe <daniel.r.roe.gmail.com>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> I'm glad you got something that works for you. Out of curiosity, what
>> >> problems were you having with 'crdaction' (specific error/warning
>> >> messages etc)? Also, what version of cpptraj are you using?
>> >>
>> >> -Dan
>> >>
>> >>
>> >> On Mon, Aug 24, 2015 at 1:34 PM, Joseph Baker <bakerj.tcnj.edu> wrote:
>> >> > I was having trouble getting the crdaction commands to work, but I
>> took
>> >> > your workflow and chunked up the procedure into various parm and
>> trajin
>> >> > lines, and the script below seems to very nearly work like a charm.
>> The
>> >> > last remaining problem is that it seems to produce two copies of the
>> >> solute
>> >> > (resid 1-4 in this case), so that strip command down below the second
>> >> > loadcrd doesn't seem to be doing anything. Any idea there?
>> >> >
>> >> > Thanks again,
>> >> > Joe
>> >> >
>> >> >
>> >> > #get first solvent, strip second solvent so it doesn't get considered
>> as
>> >> > part of the solute later during closest command
>> >> > parm test.parm7
>> >> > trajin test.nc 1 10
>> >> > strip :B outprefix noB
>> >> > autoimage
>> >> > trajout noB.nc
>> >> > run
>> >> >
>> >> > #clear parm and traj
>> >> > clear parm
>> >> > clear trajin
>> >> >
>> >> > #get second solvent, strip first solvent so it doesn't get considered
>> as
>> >> > part of the solute later during closest command
>> >> > parm test.parm7
>> >> > trajin test.nc 1 10
>> >> > strip :A outprefix noA
>> >> > autoimage
>> >> > trajout noA.nc
>> >> > run
>> >> >
>> >> > #clear parm and traj
>> >> > clear parm
>> >> > clear trajin
>> >> >
>> >> > #read trajectory with solvent A, find closest
>> >> > parm noB.test.parm7
>> >> > trajin noB.nc
>> >> > solvent :A
>> >> > closest 30 :1-4 noimage outprefix noB-closest
>> >> > trajout noB-closest.nc
>> >> > run
>> >> >
>> >> > #clear parm and traj
>> >> > clear parm
>> >> > clear trajin
>> >> >
>> >> > #read trajectory with solvent B, find closest
>> >> > parm noA.test.parm7
>> >> > trajin noA.nc
>> >> > solvent :B
>> >> > closest 30 :1-4 noimage outprefix noA-closest
>> >> > trajout noA-closest.nc
>> >> > run
>> >> >
>> >> > #clear parm and traj
>> >> > clear parm
>> >> > clear trajin
>> >> >
>> >> > #read in both of the trajectories with just closest solvent molecules
>> >> > parm noB-closest.noB.test.parm7
>> >> > loadcrd noB-closest.nc noB
>> >> >
>> >> > clear parm
>> >> >
>> >> > parm noA-closest.noA.test.parm7
>> >> > loadcrd noA-closest.nc noA
>> >> > strip :1-4
>> >> >
>> >> > #combine together into one file
>> >> > combinecrd noB noA parmname CombinedParm crdname Combined
>> >> > parmwrite out Combined.parm7 1
>> >> > crdout Combined Combined.nc
>> >> >
>> >> >
>> >> > --
>> >> > Joseph Baker, PhD
>> >> > Assistant Professor
>> >> > Department of Chemistry
>> >> > C101 Science Complex
>> >> > The College of New Jersey
>> >> > Ewing, NJ 08628
>> >> > Phone: (609) 771-3173
>> >> > Web: http://bakerj.pages.tcnj.edu/
>> >> > <https://sites.google.com/site/bakercompchemlab/>
>> >> >
>> >> > On Mon, Aug 24, 2015 at 10:17 AM, Joseph Baker <bakerj.tcnj.edu>
>> wrote:
>> >> >
>> >> >> Thanks, Dan! I'll give this a shot and let you know if it works out
>> for
>> >> >> me. I won't be using the topology for anything else. This is purely a
>> >> data
>> >> >> reduction endeavor since I only need a solvation shell or two of my
>> >> mixed
>> >> >> solvent around the solute for analysis, and want to get rid of all of
>> >> the
>> >> >> excess stuff to save hard drive space.
>> >> >>
>> >> >> Joe
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Joseph Baker, PhD
>> >> >> Assistant Professor
>> >> >> Department of Chemistry
>> >> >> C101 Science Complex
>> >> >> The College of New Jersey
>> >> >> Ewing, NJ 08628
>> >> >> Phone: (609) 771-3173
>> >> >> Web: http://bakerj.pages.tcnj.edu/
>> >> >> <https://sites.google.com/site/bakercompchemlab/>
>> >> >>
>> >> >> On Fri, Aug 21, 2015 at 5:46 PM, Daniel Roe <daniel.r.roe.gmail.com>
>> >> >> wrote:
>> >> >>
>> >> >>> Hi,
>> >> >>>
>> >> >>> This is certainly an interesting problem! Unfortunately it's not one
>> >> >>> that the 'closest' command can currently handle (need to pop another
>> >> >>> thing on the to-do list).
>> >> >>>
>> >> >>> However, you might be able to get what you want using two 'closest'
>> >> >>> commands and combinecrd. Something like this:
>> >> >>>
>> >> >>> # Load topology, mark A as solvent, get closest 10
>> >> >>> parm myparm.parm7
>> >> >>> solvent :A
>> >> >>> loadcrd mytraj.nc ClosestA
>> >> >>> crdaction ClosestA closest 10 <mask>
>> >> >>>
>> >> >>> # Reload topology, mark B as solvent, get closest 15
>> >> >>> clear parm
>> >> >>> parm myparm.parm7
>> >> >>> solvent :B
>> >> >>> loadcrd mytraj.nc ClosestB
>> >> >>> crdaction ClosestB closest 15 <mask>
>> >> >>> strip <mask>
>> >> >>>
>> >> >>> # Combine COORDS sets, write topology and trajectory
>> >> >>> combinecrd ClosestA ClosestB parmname CombinedParm crdname Combined
>> >> >>> # parmindex 1 should be the combined parm
>> >> >>> parmwrite out Combined.parm7 1
>> >> >>> crdout Combined Combined.nc
>> >> >>>
>> >> >>> In this case you should (hopefully) end up with Combined.parm7 and
>> >> >>> Combined.nc which contains your solute, 10 of A, and 15 of B. Note
>> >> >>> that I have not tested this input so I'll be surprised if it works
>> off
>> >> >>> the bat, but in theory it should work. Try it on a small subset of
>> >> >>> your trajectory (say 10 frames or so) first.
>> >> >>>
>> >> >>> Also note DO NOT use the topology generated this way for anything
>> but
>> >> >>> analysis/visualization since 'combinecrd' does not deal with
>> >> >>> parameters.
>> >> >>>
>> >> >>> Hope this helps,
>> >> >>>
>> >> >>> -Dan
>> >> >>>
>> >> >>>
>> >> >>> On Fri, Aug 21, 2015 at 1:31 PM, Joseph Baker <bakerj.tcnj.edu>
>> wrote:
>> >> >>> > Hi all,
>> >> >>> >
>> >> >>> > I have a system with a solute and a two-component solvent (let's
>> say
>> >> the
>> >> >>> > solvent residues are A and B). I'd like to produce a
>> >> trajectory/topology
>> >> >>> > file pair with just the solute and the N closest A molecules and M
>> >> >>> closest
>> >> >>> > B molecules to the solute. It doesn't seem that using the solvent
>> and
>> >> >>> > closest commands in cpptraj I am able to get both of these
>> >> >>> simultaneously
>> >> >>> > (note that A and B have different numbers of atoms). Is there some
>> >> way
>> >> >>> to
>> >> >>> > do this within cpptraj that I am missing?
>> >> >>> >
>> >> >>> > Thanks,
>> >> >>> > Joe
>> >> >>> >
>> >> >>> > --
>> >> >>> > Joseph Baker, PhD
>> >> >>> > Assistant Professor
>> >> >>> > Department of Chemistry
>> >> >>> > C101 Science Complex
>> >> >>> > The College of New Jersey
>> >> >>> > Ewing, NJ 08628
>> >> >>> > Phone: (609) 771-3173
>> >> >>> > Web: http://bakerj.pages.tcnj.edu/
>> >> >>> > <https://sites.google.com/site/bakercompchemlab/>
>> >> >>> > _______________________________________________
>> >> >>> > AMBER mailing list
>> >> >>> > AMBER.ambermd.org
>> >> >>> > http://lists.ambermd.org/mailman/listinfo/amber
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> -------------------------
>> >> >>> Daniel R. Roe, PhD
>> >> >>> Department of Medicinal Chemistry
>> >> >>> University of Utah
>> >> >>> 30 South 2000 East, Room 307
>> >> >>> Salt Lake City, UT 84112-5820
>> >> >>> http://home.chpc.utah.edu/~cheatham/
>> >> >>> (801) 587-9652
>> >> >>> (801) 585-6208 (Fax)
>> >> >>>
>> >> >>> _______________________________________________
>> >> >>> AMBER mailing list
>> >> >>> AMBER.ambermd.org
>> >> >>> http://lists.ambermd.org/mailman/listinfo/amber
>> >> >>>
>> >> >>
>> >> >>
>> >> > _______________________________________________
>> >> > AMBER mailing list
>> >> > AMBER.ambermd.org
>> >> > http://lists.ambermd.org/mailman/listinfo/amber
>> >>
>> >>
>> >>
>> >> --
>> >> -------------------------
>> >> Daniel R. Roe, PhD
>> >> Department of Medicinal Chemistry
>> >> University of Utah
>> >> 30 South 2000 East, Room 307
>> >> Salt Lake City, UT 84112-5820
>> >> http://home.chpc.utah.edu/~cheatham/
>> >> (801) 587-9652
>> >> (801) 585-6208 (Fax)
>> >>
>> >> _______________________________________________
>> >> AMBER mailing list
>> >> AMBER.ambermd.org
>> >> http://lists.ambermd.org/mailman/listinfo/amber
>> >>
>> > _______________________________________________
>> > AMBER mailing list
>> > AMBER.ambermd.org
>> > http://lists.ambermd.org/mailman/listinfo/amber
>>
>>
>>
>> --
>> -------------------------
>> Daniel R. Roe, PhD
>> Department of Medicinal Chemistry
>> University of Utah
>> 30 South 2000 East, Room 307
>> Salt Lake City, UT 84112-5820
>> http://home.chpc.utah.edu/~cheatham/
>> (801) 587-9652
>> (801) 585-6208 (Fax)
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber



-- 
-------------------------
Daniel R. Roe, PhD
Department of Medicinal Chemistry
University of Utah
30 South 2000 East, Room 307
Salt Lake City, UT 84112-5820
http://home.chpc.utah.edu/~cheatham/
(801) 587-9652
(801) 585-6208 (Fax)
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Sep 08 2015 - 09:00:06 PDT
Custom Search