Re: [AMBER] closest command in cpptraj

From: Hai Nguyen <nhai.qn.gmail.com>
Date: Mon, 24 Aug 2015 17:31:31 -0400

Hi Joseph,

I want to give pytraj (Python interface of cpptraj) a try with your
problem. Can you send me (off-list) a small trajectory (several frames) +
topology file (solute + A + B)?

I probably will make a tutorial about this.

Hai

On Mon, Aug 24, 2015 at 5:05 PM, Joseph Baker <bakerj.tcnj.edu> wrote:

> Hi Dan,
>
> Just to follow up, I was able to get rid of the second instance of residues
> 1-4 by modifying the #read trajectory with solvent B, find closest to
>
> #read trajectory with solvent B, find closest
> parm noA.test.parm7
> trajin noA.nc
> solvent :B
> closest 30 :1-4 noimage
> strip :1-4 outprefix noA-closest
> trajout noA-closest.nc
> run
>
> and removing the strip :1-4 command from below the loadcrd command in the
> previous version.
>
> Now I have just the solute, and the solvent molecules surrounding it.
>
> If you have some suggestion for cleaning this up to not involve so many
> reads and writes of data, I'd appreciate it.
>
> Thanks again,
> 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 Mon, Aug 24, 2015 at 3: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
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Aug 24 2015 - 15:00:03 PDT
Custom Search