Another question that I have, is the image built automatically? The system is a periodic box of molecule A in water, and some of the molecule might be near the edge.
*******************************
Mohd Farid Ismail
Graduate Student
Dept. of Chemistry/Biochemistry
University of Oklahoma
Norman 73019
________________________________________
From: Daniel Roe [daniel.r.roe.gmail.com]
Sent: Thursday, November 08, 2012 10:05 AM
To: AMBER Mailing List
Subject: Re: [AMBER] Dipole from a mask
Hi,
On Wed, Nov 7, 2012 at 3:26 PM, Ismail, Mohd F. <farid.ou.edu> wrote:
> Thank you Dr. Roe. The script is good. The only issue is for what ever reason, it won't work with cpptraj on my machine. It works if I switch to ptraj. I'm using AmberTools12.
Yes, I should have caught this before - the vector code in AT12
cpptraj is still using the old ptraj code under the hood, which
doesn't understand how cpptraj deals with reference structures. I have
since rewritten it and I was using the new cpptraj vector code when I
tested that script - my apologies.
Using ptraj should be fine but with one important caveat: unlike
cpptraj, ptraj can't pick a frame from a reference trajectory (i.e. it
always uses the first one), so you would need to split your trajectory
into separate frames and then read them back in. The modified script
for ptraj would be:
#!/bin/bash
NFRAMES=<frames>
TOP=<topfile>
rm ptraj.out
# Step 1 - Create restarts
ptraj $TOP >> ptraj.out <<EOF
trajin mdcrd.run1 1 $NFRAMES
trajout mdcrd.run1.rst7 restart
EOF
# Step 2 - Perform analysis
for ((FRAME=1; FRAME <= NFRAMES; FRAME++)) ; do
ptraj $TOP >> ptraj.out <<EOF
reference mdcrd.run1.rst7.$FRAME
trajin mdcrd.run1.rst7.$FRAME
vector ve1 :402<:5.0 dipole out fileout.$EXT
go
EOF
done
cat fileout.* | grep -v "#" > filetotal
rm fileout.*
Sorry for the confusion. Hope this helps,
-Dan
>
> *******************************
> Mohd Farid Ismail
> Graduate Student
> Dept. of Chemistry/Biochemistry
> University of Oklahoma
> Norman 73019
>
> ________________________________________
> From: Daniel Roe [daniel.r.roe.gmail.com]
> Sent: Tuesday, November 06, 2012 2:31 PM
> To: AMBER Mailing List
> Subject: Re: [AMBER] Dipole from a mask
>
> Hi,
>
> You have the correct syntax for the distance selection operator, but
> as with ptraj this currently this requires a reference structure to be
> loaded with the 'reference' command. However, this will only perform
> distance selection based on that reference frame - unfortunately,
> masks that update with every frame are not yet implemented (except
> within the 'mask' action). If you a mask to update update every frame
> in general, a current workaround could be to call cpptraj/ptraj on
> each individual frame, using that frame as a reference structure, e.g.
>
> #!/bin/bash
> NFRAMES=<frames>
> TOP=<topfile>
> rm cpptraj.out
> for ((FRAME=1; FRAME <= NFRAMES; FRAME++)) ; do
> EXT=`printf "%06i" $FRAME`
> cpptraj $TOP >> cpptraj.out <<EOF
> reference mdcrd.run1 $FRAME
> trajin mdcrd.run1 $FRAME $FRAME
> vector ve1 :402<:5.0 dipole out fileout.$EXT
> go
> EOF
> done
> cat fileout.* | grep -v "#" > filetotal
> rm fileout.*
>
> Hope this is helpful.
>
> -Dan
>
> On Mon, Nov 5, 2012 at 2:29 PM, Ismail, Mohd F. <farid.ou.edu> wrote:
>> Hi, I have a box of molecule A dissolved in water. I want to calculate the dipole moment of the water forming the cage around molecule A (i.e. the first layer of water molecule surrounding molecule A). I tried using cpptraj but I don't think I have what I really want.
>>
>> In general, I create a script file that contains these lines (1) and (2), and do cpptraj -i dipole.script -p prmtop > output. The commands in the script used:
>>
>> (1) trajin mdcrd.run1
>> vector ve1 (:402<:5.0) dipole out fileout
>>
>> >From what I understood, the :402 should be the residue number of molecule A, <: should give all the residue within, and the 5.0 is the distance. But when I change the value of 5.0 to 10.0, I still get the same dipole vector, thus I don't think I am doing it right.
>>
>> After a few trials, I just get the error in three separate lines, with no output file written.
>> "selectDistd(): No coordinate info for distance operator.
>> Error: selectDistd failed.
>> Segmentation fault"
>>
>> (2) trajin mdcrd.run1
>> vector ve1 [:402<:5.0] dipole out fileout
>>
>> if I try this, I will just get the error
>> "Unknown symbol ([) expression when parsing atom mask ([:402<5.0])
>> parsing atom mask: unknown symbol (?)
>> Segmentation fault"
>>
>> Can anyone shed some light on what I am missing here?
>>
>>
>> *******************************
>> Mohd Farid Ismail
>> Graduate Student
>> Dept. of Chemistry/Biochemistry
>> University of Oklahoma
>> Norman 73019
>> _______________________________________________
>> 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 201
> Salt Lake City, UT 84112-5820
> http://home.chpc.utah.edu/~cheatham/
> (801) 587-9652
> (801) 585-9119 (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 201
Salt Lake City, UT 84112-5820
http://home.chpc.utah.edu/~cheatham/
(801) 587-9652
(801) 585-9119 (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
Received on Thu Nov 08 2012 - 21:30:03 PST